aside_question subagent duplicates entire session, causing massive token drain

Resolved 💬 3 comments Opened Apr 9, 2026 by bencium Closed Apr 9, 2026

Bug Description

An internal Claude Code mechanism called aside_question creates subagents that duplicate the entire main session, effectively doubling token consumption without user awareness.

Evidence

Analyzed token usage across 55 projects, 298 sessions, 2.8B total tokens using a custom JSONL parser on ~/.claude/projects/*/ session logs.

The worst case: brandguideai session 9126fa38 (April 1, 2026)

  • Total session: 398M tokens
  • Main conversation: 828 user msgs, 1118 assistant msgs
  • aside_question subagent: 571 user msgs, 787 assistant msgs, 14 nested Agent spawns
  • Subagent alone consumed 220M tokens (55% of session total)
  • Both main session AND subagent started with the identical first prompt

Pattern across projects

Found 9 aside_question subagents across different projects:

| Project | Subagent Size | Tokens |
|---------|--------------|--------|
| brandguideai | 5.6 MB / 1,466 lines | ~220M |
| skool-copilot | 2.9 MB | ~60M |
| skool | 2.9 MB | ~6.7M |
| clipcannon-mac (x3) | ~1.3 MB each | ~13M each |
| hotel-voicedemo | 472 KB | smaller |
| gemma | 350 KB | smaller |
| BANYAN | 295 KB | smaller |

Trigger pattern

All affected sessions start with <local-command-caveat> — the user ran CLI commands (/clear, /model, etc.) before their first real prompt:

User msg #1: <local-command-caveat>Caveat: The messages below were generated by the user while running local commands...
User msg #2: <command-name>/clear</command-name>
User msg #3: <local-command-caveat>...
User msg #4: <command-name>/model</command-name>
User msg #5: <local-command-stdout>Set model to Sonnet 4.6</local-command-stdout>
User msg #6: [actual user prompt - this is what the aside_question subagent also starts with]

Compounding effect

The runaway aside_question subagent spawned 14 more agents inside itself (Explore, Plan, general-purpose), each inheriting the growing parent context. This creates exponential token multiplication.

Expected Behavior

aside_question should not duplicate the full session as a subagent. If it's a context continuation mechanism, it should not re-run the entire conversation.

Actual Behavior

The entire session runs twice — once as the main conversation, once inside an aside_question subagent, with the subagent also spawning nested agents.

Impact

  • 398M tokens consumed in a single session (the #1 most expensive session out of 298)
  • Users on Max plan hit rate limits faster than expected
  • No visibility to the user that a duplicate session is running

Environment

  • Claude Code CLI (latest as of April 2026)
  • macOS Darwin 25.4.0
  • Model: claude-opus-4-6 and claude-sonnet-4-6
  • Multiple projects affected

Reproduction

  1. Start a new Claude Code session
  2. Run /clear then /model to switch models before asking a question
  3. Ask a complex question that triggers subagent spawning
  4. Check ~/.claude/projects/<project>/<session>/subagents/ for agent-aside_question-*.jsonl files
  5. Compare the first real user prompt in the subagent vs the main session — they match

Related

Auto-compaction retries (acompact subagents) also consume large amounts of tokens when sessions are long — 4 retries x 80M tokens each in one observed case. These may share a root cause with the aside_question mechanism.

View original on GitHub ↗

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