r/ClaudeCode • • 4d ago

Bug / Issue Subagents keep claiming their context window is full after just 2–3 turns, burning through weekly usage limits

Subagents keep claiming their context window is full after just 2–3 turns, burning through usage limits

I've been using Claude Code for about a year and have never experienced anything like this until I switched the effort level to extra high.

Whenever I run a heavy research task with subagents, the following happens:

  • A research subagent runs for 2–3 turns, claims its context window is full, and stops.
  • The main agent spawns a fresh subagent to continue the research.
  • The new subagent does exactly the same thing after another 2–3 turns.
  • The main agent keeps spawning new subagents indefinitely, burning through my usage limits.

This happens consistently with heavy research tasks, regardless of the project or prompt.

The subagents kept ignoring ordinary skill instructions, so I eventually came up with the following rather absurd workaround in my skill document:

A Claude Code subagent may stop and say:

My context is nearly full. I'll stop here; a fresh agent can pick this up from my notes.

Order it firmly to continue. Claude Code summarizes old turns when the context fills, so the subagent can keep working. A mild request does not work.

This workaround gets the subagents to continue working. However, when I inspect the detailed session transcripts, I can still see the main agent and its subagents arguing back and forth for 2–3 turns before the subagents finally agree to resume their work.

Apparently, I'm now spending my usage allowance on agents arguing with each other about whether they should keep working.

Is anyone else experiencing this? Is this a known issue with extra high effort?

1 Upvotes

17 comments sorted by

•

u/AutoModerator 4d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

6

u/CorpT 4d ago

lol. i can only image how deranged your setup is.

1

u/jhnam88 4d ago

I love no setting, pure itself

3

u/ShivaFatalis 4d ago

Well surprise, surprise then...

1

u/tariqosmani 4d ago

Give the research subagent its own definition instead of letting it inherit the main session's settings. A file in .claude/agents/ with its own model and effort in the frontmatter lets the main session stay on extra high while research runs on high or medium.

Then make the respawn rule explicit for the main agent: if a subagent stops early, read its notes and either finish that step yourself or report back to me. Never spawn a replacement for the same task. That kills the loop even when a subagent still gives up.

And give each subagent a narrow question and a limit on what it returns, like "answer in under 300 words, write sources to notes/topic.md". A vague "research X" brief keeps reading until it feels full.

Does it happen with one subagent alone, or only when several run in parallel?

1

u/jhnam88 4d ago

Happened in every case

3

u/___zuki 4d ago

You’re probably forking from a large main session. Forked sub agents are garbage definitely disable that.

1

u/Reditoxaz 4d ago

there are rare cases when fork is ok though.

Fork uses original session cache for initialisation so you do not pay for cache miss but after this it follow sub agent rules with 5minute cache expiry

2

u/LakeResearchTeam 4d ago

That loop usually means a subagent is treating its own context budget as a hard stop, and each fresh subagent re-reads the same material and hits it again. Cheaper fixes than arguing with it: drop the effort level back to high or medium for research subagents, since extra high spends far more thinking tokens per turn. Have subagents write findings to a notes file as they go and return only a short summary, so the main agent's context stays small. Cap the fan-out in your instructions (for example at most 3 subagents per task, and no respawning without checking the notes file first). Also check /usage to see which sessions are eating your allowance, and consider a cheaper model for the simple search or summarize steps.

2

u/modern_medicine_isnt 4d ago

Did you ask claude what the heck was going on. I have found it to be pretty helpful at suggesting ways to optimizing itself.

2

u/Abhay06102003 4d ago

I'd check whether those subagents are starting with a genuinely fresh context or inheriting a substantial portion of the parent session.

Two or three turns can still consume a lot of context if each tool call returns large files or search results.

Comparing a narrowly scoped research agent against the same task with inherited context might help isolate the cause. Are your subagents mostly reading files, running searches, or executing commands?

1

u/ContextWizard 4d ago

Might want to ask if the agent is storing the context periodically and keeping the contextual window clean, or trying to store everything in one window before it finishes. You are likely getting increased window usage from using extra high and need to chunk the findings.

I also recommend benchmarking 1 agent vs your subagents to see if you are really getting gains from that.

1

u/MartinMystikJonas 4d ago

Well then something loaded in firdt few turn or their initial prompt consumes subagent context. Figure out what.

1

u/SirRobinBlibs 4d ago

The "context is full" line after two or three turns is often real token use, not a broken window. Extra-high effort spends a lot of thinking tokens, and a subagent that also inherits the parent's tools, MCP schemas, and a large research dump can fill its slice before it finishes the task.

I'd check the child's actual usage before respawning it. If the first child already wrote a useful note, start the next one with that note and a tighter output format, not with the same tool list and the same raw dump. A research subagent on a lower effort, with a cap on how many times it can restart the same question, is a better fix than letting it keep opening twins that immediately claim they're full.

1

u/CaramelEmotional3092 4d ago

I have never had this issue. I try to avoid the ultra high, I feel like its counterproductive at times, I would recommend sticking to high, or another agent.
I would do a clean handoff, typically at least 1 handoff per 4 hour session, if not more often. if I notice its not going well, handoff, clean start, all good.
The handoffs I have, I have advised claude that these are mostly only read for claude, so to keep these as short as possible. But with the sub agents, it may be worth them summarizing it.
Like if its scraping an entire website, a low effort agent could do that, save the text in a file, thats then analysed by a different agent.

1

u/awesomebirder 4d ago

one thing worth checking: what the main agent hands each new subagent. if every respawn gets the previous ones notes on top of the original brief, the handoff grows each time, so each new subagent starts fuller and gives up sooner. cap the handoff at around 30 lines and have findings go to a file the next one can grep instead of carrying them in context. also have each research subagent return a path and a 5 line summary instead of the full dump, otherwise the main session pays for that dump on every turn after