claude-code - 💡(How to fix) Fix [Bug] Subagent inherits parent's context window size instead of model default [2 comments, 3 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#54947Fetched 2026-05-01 05:50:17
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/nick/.local/share/claude/versions/2.1.123 (expected in multi-process scenarios)\n at x86 (/$bunfs/root/src/entrypoints/cli.js:2769:2177)\n at Jw8 (/$bunfs/root/src/entrypoints/cli.js:2769:1257)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T12:09:26.217Z"},{"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-29T19:45:46.035Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/nick/repos/ese-plugin/.claude/worktrees/agent-a0500bf37a55c0e10.\n at call (/$bunfs/root/src/entrypoints/cli.js:4865:7658)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T20:07:18.217Z"},{"error":"MaxFileReadTokenExceededError: File content (81716 tokens) exceeds maximum allowed tokens (25000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n at Km7 (/$bunfs/root/src/entrypoints/cli.js:4852:12789)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T20:17:39.948Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/nick/repos/ese-plugin/.claude/worktrees/agent-af14f717a472a736f.\n at call (/$bunfs/root/src/entrypoints/cli.js:4865:7658)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T20:18:12.014Z"},{"error":"Error: Failed to delete keychain entry: security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n at USq (/$bunfs/root/src/entrypoints/cli.js:256:287818)\n at async I99 (/$bunfs/root/src/entrypoints/cli.js:409:898)\n at async Si6 (/$bunfs/root/src/entrypoints/cli.js:409:796)\n at async K$_ (/$bunfs/root/src/entrypoints/cli.js:2745:2257)\n at async a0H (/$bunfs/root/src/entrypoints/cli.js:2770:6041)\n at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2794:3410)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T20:20:07.865Z"},{"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_011CaYrtjV9Nmdkfb48zGMed"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:57915)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T22:35:48.547Z"},{"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_011CaYrtnqYv23efVJJjuMoM"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:57915)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T22:35:49.630Z"},{"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_011CaYrtuTfiQnC8EjkEjjPb"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:57915)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T22:35:50.836Z"},{"error":"Error: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},\…

Fix Action

Fix / Workaround

Bug Description Looking at the error path more carefully: the dispatcher (my session) is on opus-4-7[1m], and the dispatch system appears to inherit the 1M
context budget into the subagent regardless of the requested model name. Sonnet doesn't natively carry 1M, so when asked to run with 1M context it routes through the extra-usage flag.

I don't have a knob from inside the dispatch to say "spawn this subagent with standard context, not the parent's." The model parameter selects model family, not context size.

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/nick/.local/share/claude/versions/2.1.123 (expected in multi-process scenarios)\n    at x86 (/$bunfs/root/src/entrypoints/cli.js:2769:2177)\n    at Jw8 (/$bunfs/root/src/entrypoints/cli.js:2769:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T12:09:26.217Z"},{"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-29T19:45:46.035Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/nick/repos/ese-plugin/.claude/worktrees/agent-a0500bf37a55c0e10.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4865:7658)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T20:07:18.217Z"},{"error":"MaxFileReadTokenExceededError: File content (81716 tokens) exceeds maximum allowed tokens (25000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at Km7 (/$bunfs/root/src/entrypoints/cli.js:4852:12789)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T20:17:39.948Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/nick/repos/ese-plugin/.claude/worktrees/agent-af14f717a472a736f.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4865:7658)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T20:18:12.014Z"},{"error":"Error: Failed to delete keychain entry: security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n    at USq (/$bunfs/root/src/entrypoints/cli.js:256:287818)\n    at async I99 (/$bunfs/root/src/entrypoints/cli.js:409:898)\n    at async Si6 (/$bunfs/root/src/entrypoints/cli.js:409:796)\n    at async K$_ (/$bunfs/root/src/entrypoints/cli.js:2745:2257)\n    at async a0H (/$bunfs/root/src/entrypoints/cli.js:2770:6041)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2794:3410)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T20:20:07.865Z"},{"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_011CaYrtjV9Nmdkfb48zGMed\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57915)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T22:35:48.547Z"},{"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_011CaYrtnqYv23efVJJjuMoM\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57915)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T22:35:49.630Z"},{"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_011CaYrtuTfiQnC8EjkEjjPb\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57915)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T22:35:50.836Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\…
RAW_BUFFERClick to expand / collapse

Bug Description Looking at the error path more carefully: the dispatcher (my session) is on opus-4-7[1m], and the dispatch system appears to inherit the 1M
context budget into the subagent regardless of the requested model name. Sonnet doesn't natively carry 1M, so when asked to run with 1M context it routes through the extra-usage flag.

I don't have a knob from inside the dispatch to say "spawn this subagent with standard context, not the parent's." The model parameter selects model family, not context size.

Environment Info

  • Platform: darwin
  • Terminal: kitty
  • Version: 2.1.123
  • Feedback ID: b905b3a7-c7e9-4f69-b102-0a33ec0c4adf

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/nick/.local/share/claude/versions/2.1.123 (expected in multi-process scenarios)\n    at x86 (/$bunfs/root/src/entrypoints/cli.js:2769:2177)\n    at Jw8 (/$bunfs/root/src/entrypoints/cli.js:2769:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T12:09:26.217Z"},{"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-29T19:45:46.035Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/nick/repos/ese-plugin/.claude/worktrees/agent-a0500bf37a55c0e10.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4865:7658)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T20:07:18.217Z"},{"error":"MaxFileReadTokenExceededError: File content (81716 tokens) exceeds maximum allowed tokens (25000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at Km7 (/$bunfs/root/src/entrypoints/cli.js:4852:12789)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T20:17:39.948Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/nick/repos/ese-plugin/.claude/worktrees/agent-af14f717a472a736f.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4865:7658)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T20:18:12.014Z"},{"error":"Error: Failed to delete keychain entry: security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n    at USq (/$bunfs/root/src/entrypoints/cli.js:256:287818)\n    at async I99 (/$bunfs/root/src/entrypoints/cli.js:409:898)\n    at async Si6 (/$bunfs/root/src/entrypoints/cli.js:409:796)\n    at async K$_ (/$bunfs/root/src/entrypoints/cli.js:2745:2257)\n    at async a0H (/$bunfs/root/src/entrypoints/cli.js:2770:6041)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2794:3410)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T20:20:07.865Z"},{"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_011CaYrtjV9Nmdkfb48zGMed\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57915)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T22:35:48.547Z"},{"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_011CaYrtnqYv23efVJJjuMoM\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57915)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T22:35:49.630Z"},{"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_011CaYrtuTfiQnC8EjkEjjPb\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57915)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T22:35:50.836Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\…

Note: Content was truncated.

extent analysis

TL;DR

The issue is likely due to the dispatcher inheriting the 1M context budget and routing through the extra-usage flag, causing errors when running with models that don't support 1M context.

Guidance

  • Review the model parameters to ensure they match the intended context size, as the current setup may be causing the dispatcher to use the wrong context.
  • Check the documentation for the extra-usage flag to understand its implications and potential workarounds.
  • Consider implementing a mechanism to specify the context size for subagents, rather than relying on the parent's context budget.
  • Investigate the rate limit errors (429) and adjust the request frequency or implement retry logic to mitigate these errors.

Example

No code example is provided due to the lack of specific implementation details in the issue.

Notes

The issue description is truncated, which may limit the accuracy of the analysis. Additionally, the errors listed appear to be unrelated to the initial bug description, which may indicate a more complex issue.

Recommendation

Apply a workaround to adjust the request frequency or implement retry logic to mitigate the rate limit errors, as the root cause of the context budget issue is not immediately clear.

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] Subagent inherits parent's context window size instead of model default [2 comments, 3 participants]