claude-code - 💡(How to fix) Fix [BUG] Regression in 2.1.158: claude spirals into redundant/invented tool calls during file reads (2.1.157 clean)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

Fix Action

Fix / Workaround

  1. Update Claude Code to 2.1.158.
  2. 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.
  3. Observe: duplicate batches of identical tool calls (same git show / Read repeated), and invented shell commands such as sleep 20; echo "burst_flush_$(date +%s)" issued to "wait for delayed results".
  4. Note that /clear does not resolve it (so it is not conversation-context related).
  5. Downgrade to 2.1.157 (npm install -g @anthropic-ai/[email protected]), restart, and repeat step 2 → behaviour is fully resolved; clean single-call tool use.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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 file Read 3–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.

Error Messages/Logs

Steps to Reproduce

  1. Update Claude Code to 2.1.158.
  2. 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.
  3. Observe: duplicate batches of identical tool calls (same git show / Read repeated), and invented shell commands such as sleep 20; echo "burst_flush_$(date +%s)" issued to "wait for delayed results".
  4. Note that /clear does not resolve it (so it is not conversation-context related).
  5. Downgrade to 2.1.157 (npm install -g @anthropic-ai/[email protected]), 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Regression in 2.1.158: claude spirals into redundant/invented tool calls during file reads (2.1.157 clean)