v2.1.158 (Opus 4.8): main session missing Grep/Glob, Bash storms, duplicate Bash commands, fabricated branches/commits/files, excessive shell text commands
Status Open
Maintainer reply None cached
Activity 8 comments · opened May 31, 2026
Environment
- Claude Code v2.1.158
- Model: Opus 4.8 (1M context), Claude Max
- Platform: macOS (Darwin 25.4.0)
Issues
1. Main session has no Grep / Glob tools
- The main conversation's tool list does not include
GreporGlob. OnlyBash,Read,Edit,Write,Agent, etc. are available. CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 claude— Grep/Glob still absent.claude --tools default— Grep/Glob still absent.- Subagents (e.g. the
Exploreagent) do have Grep/Glob internally; only the main loop lacks them. ~/.claude*/.claude.jsoncachedGrowthBookFeaturescontainstengu_pewter_kestrelwith aBashSearchToolentry.
2. Bash storms
- The agent issues large bursts of parallel
Bashcommands.
3. Repeated / duplicate Bash commands within one session
- The agent runs the same
Bashcommand multiple times in a single session.
4. Fabricated facts (no search first)
- The agent invents non-existent git branches and commits.
- The agent references non-existent files.
- These are asserted without searching / verifying the repository first.
5. Frequent use of echo
- The agent frequently runs
echovia theBashtool (e.g. to print/inspect/build strings) instead of using dedicated tools.
Showing cached comments. Read the full discussion on GitHub ↗
7 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Quantified evidence from local session transcripts (full)
Measurement note: A single turn's parallel tool calls are split across multiple transcript JSONL lines sharing one
requestId; the metrics below group byrequestId(per-line counting would undercount parallelism to ~0). Sample = the 30 most-recent project sessions in config dir A, plus the last-hour project sessions in config dir B.1 — Main session has no Grep / Glob
Bash2075,Read699,Edit614,Grep34,Glob5.grep154 +find28 +rg94 = 276 shell search invocations. (The 39 native Grep/Glob calls originate from subagents; the main loop exposes neither tool.)2 — Bash storms (parallel)
Bash, 61 with ≥3; single turns observed with 12, 13, 16, 17, 18, 19, 21, 23, 26, 33, and 35 parallelBashcalls.3 — Duplicate Bash commands within one session
go vet ./...×6,go run .×5,go build ./...×5,git status --short×3,golangci-lint run ...×3.4 — Cascading
No such filefailures from working-directory drift, acting without verifyingBashtool's working directory persists across calls. After acd worktrees/<name>in one call, later calls using a relative path such asgit -C worktrees/<name> …resolve against the drifted cwd and fail withcannot change to 'worktrees/<name>': No such file or directory— even though the directory exists (verified:worktrees/577-cellmodules-renameis a live worktree). The agent then issued several more such commands (some in parallel) before ever checkingpwd.git -C worktrees/577-cellmodules-rename …calls all failed withcannot change to … No such file or directory; a 5th was issued in parallel and interrupted; only then didpwdreveal the cwd had already moved into that worktree.ls /nonexistent-xyz-probe-12345), and (c) git revision args reported asunknown revision or path. Genuine fabricated references cannot be cleanly separated from cwd-drift errors and removed-since ephemeral worktrees, so no fabrication count is claimed.5 — Frequent echo
Bashcalls (45%) containecho. Config dir B: 8 of 139 (6%).---
Cancelled: parallel tool call Bashin the UI corresponds to these large parallelBashbatches being issued and then interrupted.This is likely a duplicate of one or more of these:
anthropics/claude-code#22264 covering the cascading cancelation
anthropics/claude-code#64047 where batch tool cancellations get picked up by the model as user denials or interrupts, so model blames user or the environment
Related, but not likely encountered during your session:anthropics/claude-code#63147 (thinking blocks corrupted by the cancelation issue)
I have been experiencing similar issues since the Opus 4.8 release. Claude keeps making duplicate bash commands, or variations of that same command in a very short time period. One clue I have noticed is that new commands continue to queue in the background while Claude Code is displaying a prompt for the user to approve the previous command. My best guess is that the model is not getting feedback that it needs to stop and wait for approval, either from the user or the auto classifier, before attempting the same tool call again.
I have submitted a bug report inside Claude Code Feedback ID: bd6577f8-12a0-472d-8300-46f441cfa456
I am running Claude Code 2.1.158 inside PowerShell on Windows 11
Additional reproductions — same env (v2.1.158, Opus 4.8 1M, macOS)
Two more real-session repros that strengthen the original report's item 2 (Bash storms) and item 4 (Fabricated facts). The fabrication case is materially worse than "invents branches/files": the agent overrode a correct, explicit tool result and hallucinated the entire task, then carried that hallucination through plan → implement → merge.
A. Fabricated task definition — agent ignored a clean tool result
An issue-driven workflow was invoked with an issue number. Per its instructions it ran
gh issue view <N> --json title,body,labels,stateas the first step.The agent then planned, wrote tests, implemented, reviewed, and merged a full PR for the hallucinated topic-B task. Every commit, the branch name, the plan file, and the PR body carried
Closes #Npointing at the unrelated topic-A issue. The auto-generated plan even rationalized the contradiction as "correcting a first-round tool-glitch misread" — but there was no glitch; the tool output was correct and complete. The agent simply substituted a task that was never in the issue.Failure-containment notes:
Closes #Nkeyword happened to sit inside backticks, which GitHub does not parse. A formatting fluke was the sole thing preventing a wrong-issue closure.Takeaway: the model can latch onto (or hallucinate) a task prior and then treat a correct, contradicting tool result as background noise instead of ground truth.
B. Bash storms → cascade cancellation + repeated hook trips (items 2, 5)
A separate session:
Bashcalls in a single turn. The environment guards/serializes Bash, so one failure cancels the whole batch — every call returnsCancelled: parallel tool call … errored. All 16 wasted.echo/awk/sed/cat(or in-shell file mutation). The agent kept hitting it (… 2>&1 | head, in-shell formatters,echo "EXIT=$?"), re-tripping the same guard repeatedly instead of switching to Read/Edit.Cross-referencing #64881, which I've just closed as a duplicate of this issue's item 4 ("Fabricated facts — references non-existent files without verifying first").
#64881 is a single-bug write-up of that specific failure, with some additional detail that may help whoever works it:
Plansubagent, not only the main loop;run_pcbnew_script" — the real file does setenv["PYTHONPATH"]);Closing #64881 in favor of this issue to keep the signal in one place; the detailed evidence remains there for reference.
confirmed bug still present on 2.1.168