[BUG] Auto mode tells the model to edit files via Bash, which silently disables checkpointing / `/rewind` (no Restore code on any prompt)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code (2.1.273)
What's Wrong?
When auto mode is active, Claude Code injects a system instruction that tells the model to do its work through the Bash tool wherever possible, including making file changes with sed, heredocs, or short scripts instead of the dedicated Edit / Write tools.
The model follows that instruction. But checkpointing only tracks edits made through Edit / Write / NotebookEdit (documented under "Bash command changes not tracked" on the Checkpointing page). The result is that in an auto-mode session, every checkpoint is created with an empty trackedFileBackups, and /rewind offers no Restore code option on any entry, even though the session modified dozens of source files.
Concretely, in one session of 124 user prompts:
| Metric | Value |
|---|---|
| Bash tool calls | 96 |
| Edit / Write / NotebookEdit calls | 0 |
| file-history-snapshot entries | 14 |
| Snapshots with non-empty trackedFileBackups | 0 |
All code changes were made via python3 - <<'PY' ... PY heredoc scripts. In a sibling session that happened to make 3 Write calls, only the two files touched by those 3 calls were backed up under ~/.claude/file-history/<session>/; the ~40 other files changed via Bash in the same session were not.
So the two features actively contradict each other: auto mode steers the model toward the one editing path that checkpointing cannot see, silently disabling rewind for the whole session. The user has no indication this is happening until they try to rewind.
What Should Happen?
Either of:
- Edits made in auto mode should remain rewindable. For example, the auto-mode Bash-preference instruction should exclude file modification (keep
cat/grep/findvia Bash, but still requireEdit/Writefor changes), or - Checkpointing should snapshot files written by Bash (e.g. by diffing the working tree before/after each Bash call, or at least for files inside the project directory).
At minimum, the /rewind menu or the auto-mode entry point should warn that rewind will not cover edits made this way.
Error Messages/Logs
No error. /rewind simply lists every prompt with no "Restore code" / "Restore code and conversation" options. Each file-history-snapshot line in the session .jsonl looks like:
{"type":"file-history-snapshot","snapshot":{"trackedFileBackups":{}, ...}}
The auto-mode instruction that triggers this contains the text:
make file changes with sed, heredocs, or short scripts, rather than using the dedicated Read, Edit, or Write tools
Steps to Reproduce
- Start
claudein any git repo and enable auto mode. - Ask Claude to make several code changes across 3–4 separate prompts (e.g. "rename function X to Y", "add a field to this type", etc.).
- Observe in the transcript that the changes are applied via Bash (
sed -i,python3 - <<'PY',cat > file <<'EOF'), not viaEdit/Write. - Run
/rewind(or press Esc twice). - Every entry offers only Restore conversation / Summarize / Never mind; no code restore is available.
- Compare with the same steps in normal (non-auto) mode:
Edit/Writeare used and Restore code appears.
Claude Model
Other (Fable 5.1, claude-fable-5-1[1m])
Is this a regression?
I don't know
Claude Code Version
2.1.273
Platform
macOS (Darwin 25.6.0), CLI entrypoint, running inside a git worktree