[BUG] Auto mode instructs Bash reads (cat/sed -n) while Edit requires a Read-tool read, so every auto-mode edit fails once by design
Summary
In auto mode the harness's own system instruction tells the model to read files with cat/head/sed -n instead of the Read tool. The Edit tool's read-before-edit guard only counts the Read tool. Obeying the first rule guarantees the second one rejects the edit, so every auto-mode edit of a file the model has not Read-tooled costs two extra round-trips (the error, then a Read, then the retry).
This is distinct from #53525 (files written by Bash) and #76361 (read-state resets): here the two rules contradict each other by design, so the failure is not a state bug but an instruction conflict.
Reproduction
- Start a session in auto mode (the mode whose system text says: "Do your work through the Bash tool wherever it can accomplish the job: read files with cat, head, or sed -n ... rather than using the dedicated Read, Edit, or Write tools").
- Ask for a one-line change in any existing file. The model reads it with
cat(as instructed). - The model calls Edit on that file.
- Edit returns
File has not been read yet. Read it first before writing to it. - The model calls Read, then Edit again; the edit succeeds.
Measured
Corpus grep over every Claude Code transcript on one Linux box (retained window about 60 days): the string File has not been read yet appears 363 times across 80 transcripts. Every occurrence in a sample of 64 deep-read sessions followed a Bash read that the auto-mode instruction asked for.
Expected
Either of these removes the contradiction:
- A Bash read of a path (
cat,head,sed -n,tail) marks that path as read for the Edit guard, or - the auto-mode instruction stops asking the model to bypass the Read tool for files it is about to edit.
Environment
Claude Code 2.1.259, Linux (Arch), CLI in tmux. No plugins touch the Edit or Read tools.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗