claude-code - 💡(How to fix) Fix Feature request: configurable preview-server cap (currently hardcoded at 5) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54155Fetched 2026-04-29 06:34:49
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1

Fix Action

Fix / Workaround

Current workaround

RAW_BUFFERClick to expand / collapse

What I want

A configurable cap on the number of concurrent preview servers (mcp__Claude_Preview__preview_*), instead of the hardcoded limit of 5.

Why

Heavy users hit the cap constantly. My setup has ~40 apps and ~30 routine -report preview targets defined in .claude/launch.json. Every routine run that wants to start a preview must first evict another routine's preview. With ~70 potential targets sharing 5 slots, contention is the steady-state — not an edge case.

Current workaround

Manual preview_stop + preview_start rotation, or skill-level auto-evict heuristics that pick an oldest/lowest-priority server to kill before each preview_start. It works but adds friction, breaks ongoing inspections, and forces every routine to implement its own eviction logic.

Proposed

Either or both:

  1. A --max-preview-servers <N> CLI flag on claude startup.
  2. A previewServerCap setting in settings.json (and/or .claude/settings.local.json).

Default remains 5; users with the headroom opt in to a higher cap.

Alternatives considered

  • An env var override (e.g. CLAUDE_CODE_MAX_PREVIEW_SERVERS=20) would be the smallest possible change and equally good for my use case.
  • Per-launch-target priority hints so the auto-evict heuristic picks better victims — useful, but doesn't solve the underlying scarcity.

Happy to test a build with this exposed if it's a quick lever to flip.

extent analysis

TL;DR

Implementing a configurable cap on the number of concurrent preview servers via a CLI flag or settings file can help alleviate contention issues.

Guidance

  • Consider adding a --max-preview-servers <N> CLI flag to the claude startup command to allow users to configure the cap.
  • Introduce a previewServerCap setting in settings.json (and/or .claude/settings.local.json) to provide an alternative configuration method.
  • Evaluate the feasibility of using an environment variable override (e.g., CLAUDE_CODE_MAX_PREVIEW_SERVERS=20) as a minimal change.
  • Assess the potential benefits of implementing per-launch-target priority hints to improve the auto-evict heuristic.

Example

No code snippet is provided as the issue focuses on configuration and feature requests rather than code-level changes.

Notes

The proposed solutions aim to address the contention issue caused by the hardcoded limit of 5 concurrent preview servers. However, the implementation details and potential interactions with existing features (e.g., auto-evict heuristic) require careful consideration.

Recommendation

Apply a workaround by using an environment variable override (e.g., CLAUDE_CODE_MAX_PREVIEW_SERVERS=20) as a quick and minimal change to increase the cap, allowing for testing and evaluation of the proposed solutions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING