[BUG] Regression in 2.1.158: claude spirals into redundant/invented tool calls during file reads (2.1.157 clean)
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?
After Claude Code auto-updated from 2.1.157 to 2.1.158, the assistant began malfunctioning during ordinary multi-file reading/review work. It:
- Issued large duplicate batches of tool calls — e.g. the same
git show <hash>8 times, the same fileRead3–4 times in a single turn. - Invented nonsensical shell commands to "wait for delayed results", e.g.
sleep 20; echo "burst_flush_$(date +%s)". - Appeared to misread normal harness feedback —
"Wasted call — file unchanged"notices and bad-offset read warnings — as a tool-result delivery malfunction, then "compensated" with more probes and re-reads, forming a self-reinforcing loop.
Net effect: reading a handful of files took many minutes and wasted large amounts of tokens on redundant calls. The model was Opus 4.8 throughout; only the CLI version changed.
What Should Happen?
The assistant should make single, deliberate tool calls — read each file once, trust the returned result, and not re-issue duplicate calls. Normal harness feedback (e.g. "Wasted call — file unchanged", bad-offset warnings) should be interpreted correctly as feedback on a specific call, not as a tool-result delivery failure.
This is exactly how it behaves on 2.1.157: clean, fast, single-call file reads with no redundant batches or invented "wait/probe" commands.
Downgrading back to 2.1.157 fixed the issue - simply run npm install -g @anthropic-ai/claude-code@2.1.157 in the terminal to go back to the prior version
Error Messages/Logs
Steps to Reproduce
- Update Claude Code to 2.1.158.
- Start a session (model: Opus 4.8) and ask it to do ordinary multi-file work — e.g. read and cross-reference several files in a docs/codebase review.
- Observe: duplicate batches of identical tool calls (same
git show/Readrepeated), and invented shell commands such assleep 20; echo "burst_flush_$(date +%s)"issued to "wait for delayed results". - Note that
/cleardoes not resolve it (so it is not conversation-context related). - Downgrade to 2.1.157 (
npm install -g @anthropic-ai/claude-code@2.1.157), restart, and repeat step 2 → behaviour is fully resolved; clean single-call tool use.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.158 (not working) 2.1.157 (works fine)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗