Agent enters infinite "Puttering" loop after task completion — consuming tokens with no output
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?
Bug Report: Agent enters infinite "Puttering" loop after completing task — consuming tokens with no output
---
Summary
After completing a full agentic task (web searches + structured response), Claude Code entered an infinite internal loop showing only:
✻ Puttering… (27s · ↓ 783 tokens · still thinking)
This repeated 50+ times without any new output, user interaction, or task progress — burning tokens continuously until manually interrupted.
---
Steps to Reproduce
- Send a research-heavy prompt requesting multiple parallel web searches and a structured comparative response
- Agent completes all searches and generates the full final answer
- Agent does not terminate — instead enters a "Puttering" state loop
- Loop repeats indefinitely (observed 50+ iterations) with no output and no stop condition
---
Prompt sent (translated from Portuguese)
"I need ideas to invest up to R$50,000 in a self-scaling business in Brazil. The money will be paid in installments, so the business must cover payments and generate profit. Give me at least 5 real, logical ideas — no hallucination or dreaming. Use specialist skills and web search."
---
Observed Behavior
- Agent ran 6 web searches correctly
- Agent generated a complete, well-structured final answer (5 business ideas with comparative table)
- Instead of terminating, agent re-entered internal loop
- Terminal showed
✻ Puttering…with token counter incrementing on every cycle - No new output was produced
- Loop only stopped via manual interruption (Ctrl+C)
---
Expected Behavior
Agent should detect task completion after delivering the final response and terminate cleanly.
---
Environment
- OS: macOS (Apple Silicon M4 Pro)
- Claude Code version: 2.1.118 (Claude Code)
- Shell: zsh
- Task type: multi-step agentic with web search tools
---
Impact
This is not a minor UX issue. The infinite loop consumed a significant number of tokens after the task was already complete, resulting in real financial cost to the user with zero value delivered. This has occurred more than once.
Requesting:
- A fix for the missing termination condition after task completion
- Clarification on whether token consumption during "Puttering" loops qualifies for usage credit
---
Additional Notes
The agent's final output before the loop was complete and correct — this is purely a loop/termination control bug, not a generation quality issue.
What Should Happen?
After delivering the final response, the agent should detect task completion and terminate cleanly without re-entering any internal loop.
Error Messages/Logs
✻ Puttering… (27s · ↓ 783 tokens · still thinking)
Repeated dozens of times until manually interrupted with Ctrl+C.
Steps to Reproduce
- Send a research prompt requesting multiple parallel web searches and a structured response
- Agent runs all searches and delivers a complete final answer
- Agent does not terminate — enters "Puttering" loop instead
- Terminal shows: ✻ Puttering… (27s · ↓ 783 tokens · still thinking)
- Loop repeats dozens of times with no output until manually interrupted with Ctrl+C
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.118 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗