claude-code - 💡(How to fix) Fix [Bug] Unexpected high token consumption with multi-agent Opus orchestrator spawning Sonnet agents [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#54623Fetched 2026-04-30 06:40:34
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×6commented ×1

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/mikkel/.local/share/claude/versions/2.1.121 (expected in multi-process scenarios)\n at p66 (/$bunfs/root/src/entrypoints/cli.js:2769:2177)\n at YY8 (/$bunfs/root/src/entrypoints/cli.js:2769:1257)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-28T12:35:09.172Z"},{"error":"Error: 1: Command failed with ERR_STREAM_PREMATURE_CLOSE: code --force --install-extension anthropic.claude-code\nPremature close \n at eg1 (/$bunfs/root/src/entrypoints/cli.js:1717:4046)\n at async sg1 (/$bunfs/root/src/entrypoints/cli.js:1717:1435)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-28T12:35:11.286Z"},{"error":"Error: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CaWDisEdRkS7xPbcDRfBK"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:57439)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-28T13:07:11.524Z"},{"error":"Error: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CaXFCQNW4W1ERSFvy8pKy"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:57439)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:07:07.119Z"},{"error":"Error: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CaXFCSdgcn5MKCRdg9m7X"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:57439)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:07:07.600Z"},{"error":"CanceledError: canceled\n at W (/$bunfs/root/src/entrypoints/cli.js:120:7099)\n at abort (unknown)\n at KV1 (/$bunfs/root/src/entrypoints/cli.js:834:3782)\n at abort (unknown)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:4191:4888)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:122:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:33:42.318Z"},{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:34:10.432Z"},{"error":"Error: getTeammateModeFromSnapshot called before capture - this indicates an initialization bug\n at $GH (/$bunfs/root/src/entrypoints/cli.js:2876:1610)\n at WE5 (/$bunfs/root/src/entrypoints/cli.js:4453:372)\n at zQ (/$bunfs/root/src/entrypoints/cli.js:4453:494)\n at B23 (/$bunfs/root/src/entrypoints/cli.js:9106:19231)\n at tA (/$bunfs/root/src/entrypoints/cli.js:497:21131)\n at Mz (/$bunfs/root/src/entrypoints/cli.js:497:39898)\n at F4 (/$bunfs/root/src/entrypoints/cli.js:497:50707)\n at c7H (/$bunfs/root/src/entrypoints/cli.js:497:87769)\n at UJ6 (/$bunfs/root/src/entrypoints/cli.js:497:86724)\n at d7H (/$bunfs/root/src/entrypoints/cli.js:497:86544)","timestamp":"2026-04-29T05:36:19.919Z"},{"error":"Error: EISDIR: illegal operation on a directory, read '/Users/mikkel/Repos/bankstatemently/data/artifacts/a8391d6d-d4b5-4507-8549-e7ad00b9780a/74a662dae7b0733e131a8a27585848057ed7dcb8c8557aa45d774fa68837efbc/parsings/40d97c99d6f993445f58a3bcbdb3599fd785c85f12e100c03c386964d4a51df4'\n at oTH (/$bunfs/root/src/entrypoints/cli.js:1708:144)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:43:10.820Z"},{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:48:19.113Z"},{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04…

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/mikkel/.local/share/claude/versions/2.1.121 (expected in multi-process scenarios)\n    at p66 (/$bunfs/root/src/entrypoints/cli.js:2769:2177)\n    at YY8 (/$bunfs/root/src/entrypoints/cli.js:2769:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-28T12:35:09.172Z"},{"error":"Error: 1: Command failed with ERR_STREAM_PREMATURE_CLOSE: code --force --install-extension anthropic.claude-code\nPremature close \n    at eg1 (/$bunfs/root/src/entrypoints/cli.js:1717:4046)\n    at async sg1 (/$bunfs/root/src/entrypoints/cli.js:1717:1435)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-28T12:35:11.286Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaWDisEdRkS7xPbcDRfBK\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57439)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-28T13:07:11.524Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaXFCQNW4W1ERSFvy8pKy\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57439)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:07:07.119Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaXFCSdgcn5MKCRdg9m7X\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57439)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:07:07.600Z"},{"error":"CanceledError: canceled\n    at W (/$bunfs/root/src/entrypoints/cli.js:120:7099)\n    at abort (unknown)\n    at KV1 (/$bunfs/root/src/entrypoints/cli.js:834:3782)\n    at abort (unknown)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:4191:4888)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:122:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:33:42.318Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:34:10.432Z"},{"error":"Error: getTeammateModeFromSnapshot called before capture - this indicates an initialization bug\n    at $GH (/$bunfs/root/src/entrypoints/cli.js:2876:1610)\n    at WE5 (/$bunfs/root/src/entrypoints/cli.js:4453:372)\n    at zQ (/$bunfs/root/src/entrypoints/cli.js:4453:494)\n    at B23 (/$bunfs/root/src/entrypoints/cli.js:9106:19231)\n    at tA (/$bunfs/root/src/entrypoints/cli.js:497:21131)\n    at Mz (/$bunfs/root/src/entrypoints/cli.js:497:39898)\n    at F4 (/$bunfs/root/src/entrypoints/cli.js:497:50707)\n    at c7H (/$bunfs/root/src/entrypoints/cli.js:497:87769)\n    at UJ6 (/$bunfs/root/src/entrypoints/cli.js:497:86724)\n    at d7H (/$bunfs/root/src/entrypoints/cli.js:497:86544)","timestamp":"2026-04-29T05:36:19.919Z"},{"error":"Error: EISDIR: illegal operation on a directory, read '/Users/mikkel/Repos/bankstatemently/data/artifacts/a8391d6d-d4b5-4507-8549-e7ad00b9780a/74a662dae7b0733e131a8a27585848057ed7dcb8c8557aa45d774fa68837efbc/parsings/40d97c99d6f993445f58a3bcbdb3599fd785c85f12e100c03c386964d4a51df4'\n    at oTH (/$bunfs/root/src/entrypoints/cli.js:1708:144)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:43:10.820Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:48:19.113Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04
RAW_BUFFERClick to expand / collapse

Bug Description

  • Running an Opus orchestrator
  • It's spinning up a "general-purpose" agent, model undefined
  • I have barred it from spawning Opus agents in settings.json. Sonnet and Haiku only
  • Nevertheless, the subagent managed to use up 150K tokens, not get the job finished, and use up 70% off the 5-hour limit (on 5x Max plan)

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.121
  • Feedback ID: 56a9197f-5b2d-4999-a52e-f51ea757263f

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/mikkel/.local/share/claude/versions/2.1.121 (expected in multi-process scenarios)\n    at p66 (/$bunfs/root/src/entrypoints/cli.js:2769:2177)\n    at YY8 (/$bunfs/root/src/entrypoints/cli.js:2769:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-28T12:35:09.172Z"},{"error":"Error: 1: Command failed with ERR_STREAM_PREMATURE_CLOSE: code --force --install-extension anthropic.claude-code\nPremature close \n    at eg1 (/$bunfs/root/src/entrypoints/cli.js:1717:4046)\n    at async sg1 (/$bunfs/root/src/entrypoints/cli.js:1717:1435)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-28T12:35:11.286Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaWDisEdRkS7xPbcDRfBK\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57439)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-28T13:07:11.524Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaXFCQNW4W1ERSFvy8pKy\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57439)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:07:07.119Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaXFCSdgcn5MKCRdg9m7X\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57439)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:07:07.600Z"},{"error":"CanceledError: canceled\n    at W (/$bunfs/root/src/entrypoints/cli.js:120:7099)\n    at abort (unknown)\n    at KV1 (/$bunfs/root/src/entrypoints/cli.js:834:3782)\n    at abort (unknown)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:4191:4888)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:122:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:33:42.318Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:34:10.432Z"},{"error":"Error: getTeammateModeFromSnapshot called before capture - this indicates an initialization bug\n    at $GH (/$bunfs/root/src/entrypoints/cli.js:2876:1610)\n    at WE5 (/$bunfs/root/src/entrypoints/cli.js:4453:372)\n    at zQ (/$bunfs/root/src/entrypoints/cli.js:4453:494)\n    at B23 (/$bunfs/root/src/entrypoints/cli.js:9106:19231)\n    at tA (/$bunfs/root/src/entrypoints/cli.js:497:21131)\n    at Mz (/$bunfs/root/src/entrypoints/cli.js:497:39898)\n    at F4 (/$bunfs/root/src/entrypoints/cli.js:497:50707)\n    at c7H (/$bunfs/root/src/entrypoints/cli.js:497:87769)\n    at UJ6 (/$bunfs/root/src/entrypoints/cli.js:497:86724)\n    at d7H (/$bunfs/root/src/entrypoints/cli.js:497:86544)","timestamp":"2026-04-29T05:36:19.919Z"},{"error":"Error: EISDIR: illegal operation on a directory, read '/Users/mikkel/Repos/bankstatemently/data/artifacts/a8391d6d-d4b5-4507-8549-e7ad00b9780a/74a662dae7b0733e131a8a27585848057ed7dcb8c8557aa45d774fa68837efbc/parsings/40d97c99d6f993445f58a3bcbdb3599fd785c85f12e100c03c386964d4a51df4'\n    at oTH (/$bunfs/root/src/entrypoints/cli.js:1708:144)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:43:10.820Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:48:19.113Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04

Note: Content was truncated.

extent analysis

TL;DR

The issue seems to be related to rate limit errors and improper agent usage, so adjusting settings to adhere to rate limits and ensuring the correct agent type is used might mitigate the problem.

Guidance

  • Review the settings.json to ensure that the agent settings are correctly configured to only use Sonnet and Haiku agents as intended.
  • Investigate the rate limit errors (429 errors) and consider implementing a retry mechanism with exponential backoff to handle temporary rate limit issues.
  • Verify that the Opus orchestrator is correctly configured and not spawning unintended agents, which could be contributing to the rate limit issues and token usage.
  • Check the system resources and adjust the configuration to prevent the agent from using up too many resources (e.g., 70% of the 5-hour limit).

Example

No specific code example can be provided without more context on the configuration files or the exact commands used to run the Opus orchestrator.

Notes

The provided information lacks specific details on how the Opus orchestrator is configured and run, which makes it difficult to provide a precise solution. Additionally, the issue seems to involve multiple errors, including rate limit issues, agent configuration problems, and potential resource management concerns.

Recommendation

Apply a workaround by adjusting the agent settings and implementing a retry mechanism for rate limit errors, as the root cause seems to involve both configuration and potential resource management issues.

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

claude-code - 💡(How to fix) Fix [Bug] Unexpected high token consumption with multi-agent Opus orchestrator spawning Sonnet agents [1 comments, 2 participants]