[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_
9 Comments
<img width="1600" height="1200" alt="Image" src="https://github.com/user-attachments/assets/1ea66386-c282-4acf-8af6-f31f947db9f7" />
<img width="1600" height="1200" alt="Image" src="https://github.com/user-attachments/assets/3d5ce935-a329-42bb-9cf8-9fad0854bfef" />
I can confirm. All day I've had issues where multiple tools calls and reads get duplicated and the model spirals
Same behavior on 2.1.158, Windows 11 (10.0.26200), Opus 4.8 — so not macOS-specific. Running in the VS Code integrated terminal, PowerShell 7.
During an ordinary multi-file edit task the model:
expr 6 \* 7,echo alive,Write-Output "hello-probe-9921"; 2+2, base64+SHA256 of a file, andgh auth statusthree times right after aghcall had already returned valid output;git show,cat, andGet-Contentin one turn.No tool was actually failing — every redundant probe returned the expected result. Matches your "self-reinforcing loop of probes/re-reads" description. Notably the model acknowledged the pattern when challenged, then reproduced it on the very next batch (overlaps with #64065).
I'm also seeing similar on 2.1.158, Windows 11 and Opus 4.8 with Thinking turned
First time seeing it, this is what Claude said about it, it apologized for the tool spam
<img width="470" height="248" alt="Image" src="https://github.com/user-attachments/assets/c2b8df7f-61b2-4759-9fe9-c340710c8ff1" />
<img width="492" height="215" alt="Image" src="https://github.com/user-attachments/assets/929d358f-8b11-4798-b443-3fca7f32d7b3" />
<img width="484" height="230" alt="Image" src="https://github.com/user-attachments/assets/87344dea-f2e0-48f6-80e0-0417f9097731" />
Here's a clean writeup you can paste into /bug or an issue:
Title: Opus 4.8 fires redundant duplicate tool calls as a false "parallelism" hedge
Summary: When asked to inspect a single 47-line file, the model issued ~11 tool calls in one turn ... the same file read via Read (×3 with overlapping offsets), Bash cat, Bash sed, Bash wc, PowerShell Get-Content, plus a Grep and two literal "test" echo commands. One Read would have sufficed.
Impact: Wasted input+output tokens; duplicated content persists in context and is re-processed each subsequent turn until summarization.
Expected: Single tool call for a single-file lookup. Parallel calls should be reserved for genuinely independent work, not multiple tools fetching identical content.
Suspected cause: Misapplied "batch independent calls" guidance ... treated redundant fallbacks as parallelism.
Repro: Ask the model to read one small file and report on it; observe whether it batches multiple equivalent read strategies.
<img width="1940" height="2143" alt="Image" src="https://github.com/user-attachments/assets/891c1c69-e24b-47ff-bf02-a267af5ce02d" />
It's getting worse. I was finally able to work around the still unfixed bug that hides thinking permanently, and seeing truely bizzare behavior where 4.8 completely looses it an hallucinates tool outputs that don't match at all. Also confirmed in the transcripts jsonls. It claims that a file doesn't exist right after reading it, hallucinates about strange json output in a simple file listing tool call, etc... 80% of 4.8 sessions (running in claude code web) fail for one reason or another and are useless. I switched back to 4.7 with exact same setup scripts, files and env, and they almost always proceed simply and correctly. There is something very deeply broken.
Confirming this on Linux + adding the root cause from the bundled binary
Hitting the identical regression on 2.1.158 (native install, Linux, Opus 4.8). Same signature: the model treats the
"Wasted call — file unchanged"notice as a delivery failure and spirals into re-reads /sleep;echo"flush" probes. I traced the mechanism in the v2.1.158 executable; sharing in case it shortcuts the fix.The dedup decision (de-minified from the Read handler):
So the sentinel is emitted purely from
readFileState(path + exactoffset/limit+ unchanged mtime). It never checks whether the referenced earliertool_resultis still in the visible context.Key point — this is broader than the closed #60722: that report pinned it to manual revert/rewind and was closed
NOT_PLANNED. But the same stranding happens on ordinary auto-compaction — no revert involved. Once compaction summarizes away the original Read'stool_result, any later same-range Read of an unchanged file returns the sentinel with nothing behind it, and the model is left with a dangling "refer to the earlier result" pointer. In a long session this is routine, which is why 2.1.158 feels like "Claude can't read files." It affects any file re-read across a compaction boundary, not just one.Two fix angles:
tengu_read_dedup_killswitchgate already exists (default off) — flipping it disables the dedup entirely.file_unchangedif the priortool_resultis still present in the post-compaction context; otherwise fall through and re-emit the content. (Equivalently, evictreadFileStateentries when their backing turns are compacted/reverted.)Workarounds that do unblock a stranded session (consistent with the condition above): change the file's mtime (
touch), Read a different line range, or re-read viacat.@venpopov - not sure if it is the same fix for you but i found it wasn't the model (4.8 vs. 4.7) but instead the version (2.1.158 vs. 2.1.157) - after i went back to 157 it was fixed, maybe worth a try...?
I have ran by now about 10 4.7s and 4.8s at the same time against the exact same environment. For me it is specifically 4.8. Can't change the version the cloud harness.it is 2.1.158, but 4.7 has no problem at all.
bug appears to be resolved in 2.1.159 version
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.