[BUG] Issue running multiple claude code terminals sessions simultaneously

Resolved 💬 3 comments Opened Feb 11, 2026 by xapids Closed Mar 11, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When running many native Claude Code CLI sessions in parallel on macOS, a significant fraction stop mid-processing.

In interactive TUI usage this appears as sessions halting unexpectedly. In a reproducible non-interactive load test (claude -p), failures show up as subtype: error_during_execution with result: null.

This is specifically triggered under higher concurrency (10-way bursts). Lower concurrency is usually stable.

What Should Happen?

All sessions should complete reliably for trivial prompts under 10-way parallel load, or return a clear actionable error if capacity is exceeded. Sessions should not silently stop with result: null in normal operation.

Error Messages/Logs

Sample failure payload from native CLI under 10-way parallel run:


{
  "type": "result",
  "subtype": "error_during_execution",
  "is_error": false,
  "duration_ms": 30066,
  "duration_api_ms": 30029,
  "result": null
}


Observed aggregate results (same machine/account):

- Native CLI (user settings): 5 rounds x 10 concurrent => `36/50` success
  - round results: `8/10, 7/10, 7/10, 7/10, 7/10`
- Native CLI control (`--setting-sources local`): 5 rounds x 10 concurrent => `50/50` success
- Native CLI low concurrency control (2 workers, 10 total calls) => `10/10` success

Steps to Reproduce

  1. On macOS, install latest Claude Code and verify:

``shell
claude --version
``

  1. Use user-level Claude settings with custom env routing (redacted token):

``json
{
"env": {
"API_TIMEOUT_MS": "300000",
"ANTHROPIC_BASE_URL": "http://127.0.0.1:8000",
"ANTHROPIC_AUTH_TOKEN": "<redacted>",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "antigravity/claude-sonnet-4.5"
},
"model": "opus"
}
``

  1. Run this concurrent repro script:

```shell
python3 - <<'PY'
import concurrent.futures, subprocess, json

cmd = ["claude", "-p", "--model", "sonnet", "--output-format", "json", "Reply with exactly OK"]

def one():
p = subprocess.run(cmd, capture_output=True, text=True, timeout=180)
if p.returncode != 0:
return False, f"exit={p.returncode}"
d = json.loads(p.stdout)
ok = d.get("subtype") == "success" and str(d.get("result", "")).strip() == "OK"
return ok, d.get("subtype")

for r in range(1, 6):
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as ex:
out = [f.result() for f in [ex.submit(one) for _ in range(10)]]
ok = sum(1 for s, _ in out if s)
print(f"round{r} ok={ok}/10")
if ok < 10:
print(" sample_fail=", [x for x in out if not x[0]][0])
PY
```

  1. Observe intermittent failures with error_during_execution and null result.
  1. Control check (same machine): rerun with --setting-sources local and observe stable completion.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

Unknown

Claude Code Version

2.1.39 (Claude Code) (Also observed previously on 2.1.38.)

Platform

Other

Operating System

macOS

Terminal/Shell

Other

Additional Information

  • This does not appear to be a simple rate-limit case from user-side observation.
  • claude --doctor provided environment info but did not surface a direct cause for this high-concurrency failure mode.
  • Comparison point: running equivalent parallel tasks through CodeLayer/HumanLayer orchestration path on the same machine completes reliably in local tests, suggesting a native CLI concurrency/runtime-path sensitivity.
  • Request: guidance/fix for native CLI/TUI reliability under 10 concurrent sessions, especially when using custom ANTHROPIC_BASE_URL and user settings.

Terminal is Ghostty

View original on GitHub ↗

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