Feature request: configurable preview-server cap (currently hardcoded at 5)

Resolved 💬 3 comments Opened Apr 28, 2026 by adamkane Closed May 1, 2026

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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗