You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AI assistant gets stuck in search/read loops with high token usage and no timeout #9923
The AI assistant repeatedly uses search_files and read_file tools in loops, consuming high token usage without making progress on the task, and doesn't timeout properly. Expected behavior is for the AI to complete tasks efficiently without getting stuck in repetitive tool usage.
Steps to reproduce
Start a task that involves reading a large HTML file (like GoblinAnimationCompleter.html)
Have the AI search for specific functions or code patterns
The AI begins repeatedly reading the same file sections and searching for the same patterns without making progress
Token usage increases significantly (up to 100% context usage observed)
The AI does not timeout or break out of the loop
Provider/Model
xai / grok-code-fast-1
System Information
Visual Studio Code: 1.112.0, Node.js: v22.22.0, Architecture: x64
Thanks for reporting this. PR #9933 was just merged — it adds detection for repeated identical tool calls, which should catch the search/read loop pattern you described. Expect the fix in the next release. Feel free to reopen if you still see it after updating.
Activity
linear commentedon Mar 22, 2026
CLINE-1581
feat: add doom loop detection for repeated identical tool calls
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection
feat: add repeated tool call loop detection (#9933)
ClineXDiego commentedon Mar 24, 2026
Thanks for reporting this. PR #9933 was just merged — it adds detection for repeated identical tool calls, which should catch the search/read loop pattern you described. Expect the fix in the next release. Feel free to reopen if you still see it after updating.
feat: add repeated tool call loop detection (cline#9933)