[Bug] statusline-setup agent causes excessive token usage via nested subagents on Windows
Resolved 💬 7 comments Opened Apr 3, 2026 by eelcat Closed May 13, 2026
Summary
Using the statusline-setup agent for a simple file edit task caused 30% of the 5h rate limit to be consumed on a single session. The root cause was uncontrolled nested subagent spawning.
Environment
- OS: Windows 11 (Git Bash)
- Plan: Pro
- Claude Code version: latest
What happened
- Asked to fix a statusline display issue (symbol rendering + missing fields)
- Claude spawned
statusline-setupagent (1st time) → agent asked for clarification, did nothing - Claude spawned
statusline-setupagent (2nd time) → this agent spawned:
- Another
statusline-setupsubagent (3rd level nesting) - A
claude-code-guidesubagent to ask about JSON schema - Used
sleep 15while waiting for background winget install - Repeatedly tried
winget install stedolan.jq(wrong package name), thenwinget install jqlang.jq - Suggested user manually run install commands even though it could have done it directly
- Actual fix: copying
jq.exefrom WinGet cache to~/bin/— a single Bash command
Problems observed
- Nested subagents (3 levels deep):
statusline-setupagent spawned morestatusline-setupandclaude-code-guideagents internally with no guard against recursion tool_usescount is unreliable: The agent reportedtool_uses: 5but actual log showed 14 tool calls (subagent-of-subagent calls not counted)total_tokenslikely underreported: Does not include tokens from nested subagents- Windows OS not considered: Agent kept pushing native install instructions instead of checking PATH and copying the existing binary
- No value delivered: After all that token consumption, the agent failed to solve the problem
Expected behavior
statusline-setupshould not spawn further subagents- Simple file edit tasks should not use subagents at all
- Token usage reported by subagents should include all nested consumption
- Agents should handle Windows environment differences
Impact
~30% of Pro plan 5h token limit consumed for a task that required one cp command.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗