[BUG] - Endless loop and excessive tool calls by sub agents contributing to massive spike in token consumption (Max plan user)
Resolved 💬 4 comments Opened Mar 28, 2026 by Mar5929 Closed May 7, 2026
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?
Claude code is using sub agents without me asking it to and on a very simple repository of around 500 lines of code it is using sub agents to explore the repo and they are caught in recursive loops. They are also using an astounding 106 tool calls on an insanely basic prompt to just explore the 500 line repository. The sub agent never comes back with a report of its findings either. See the screenshot.
What Should Happen?
Sub agents should not be using 106 tool calls to explore a 500 line repository and should not be timing out. This is a simple task.
Error Messages/Logs
Steps to Reproduce
- Be on max 5x plan, latest Claude code cli version
- Provide your GitHub repo URL
- Ask Claude to explore the repo and get an understanding by using sub agents.
- explore sub agents will use excessive tool calls and not come back with a report to the main agent.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.86
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗