[BUG] Task tool subagents permanently return 'Rate limit reached' with 0 tokens consumed
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The Task tool (subagent spawning) permanently returns API Error: Rate limit reached with total_tokens: 0 and tool_uses: 0. This persists across multiple days despite having available usage/credits on the Anthropic account.
Key observations:
- Affects all subagent types (Explore, general-purpose, etc.)
- Affects all models (Opus, Sonnet, Haiku)
total_tokens: 0indicates the request is rejected before any tokens are processed- The main session (parent agent) works fine — only Task tool subagents are affected
- Has persisted for days, not minutes — this is not a transient rate limit
- Account has remaining usage/credits
Example output:
API Error: Rate limit reached
<usage>total_tokens: 0
tool_uses: 0
duration_ms: 296</usage>
This appears related to #25778 (misleading rate limit when safety filter triggers) and #25531 (false rate limit at context boundary), but differs in that:
- It only affects subagent spawning, not the main session
- It persists across completely new sessions and days of waiting
/cleardoes not resolve it
What Should Happen?
Task tool subagents should spawn normally when the account has available usage. If there's an actual error (safety filter, context issue, etc.), the error message should reflect the real cause, not a generic "rate limit reached."
Steps to Reproduce
- Use Claude Code with Task tool to spawn subagents
- At some point, all subagent calls start returning "Rate limit reached" with 0 tokens
- Wait days — error persists
- Start new sessions — error persists
- Try different models (Opus, Sonnet, Haiku) — all fail identically
Claude Model
Opus 4.6 (main session), tested subagents on Sonnet and Haiku as well
Is this a regression?
Yes — subagents worked previously
Claude Code Version
2.1.49 (Claude Code)
Platform
Windows
Operating System
Windows 10 Pro 10.0.19045
Terminal/Shell
Bash (Git Bash)
Additional Information
The 0 total_tokens strongly suggests this is not a real rate limit — a genuine rate limit would still count input tokens before rejecting. This looks like the API is returning a rate limit error code for a different underlying issue (possibly related to the safety filter masking described in #25778).
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗