[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

  1. Asked to fix a statusline display issue (symbol rendering + missing fields)
  2. Claude spawned statusline-setup agent (1st time) → agent asked for clarification, did nothing
  3. Claude spawned statusline-setup agent (2nd time) → this agent spawned:
  • Another statusline-setup subagent (3rd level nesting)
  • A claude-code-guide subagent to ask about JSON schema
  • Used sleep 15 while waiting for background winget install
  • Repeatedly tried winget install stedolan.jq (wrong package name), then winget install jqlang.jq
  • Suggested user manually run install commands even though it could have done it directly
  1. Actual fix: copying jq.exe from WinGet cache to ~/bin/ — a single Bash command

Problems observed

  1. Nested subagents (3 levels deep): statusline-setup agent spawned more statusline-setup and claude-code-guide agents internally with no guard against recursion
  2. tool_uses count is unreliable: The agent reported tool_uses: 5 but actual log showed 14 tool calls (subagent-of-subagent calls not counted)
  3. total_tokens likely underreported: Does not include tokens from nested subagents
  4. Windows OS not considered: Agent kept pushing native install instructions instead of checking PATH and copying the existing binary
  5. No value delivered: After all that token consumption, the agent failed to solve the problem

Expected behavior

  • statusline-setup should 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.

View original on GitHub ↗

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