Auto mode discourages Read/Edit/Write in favour of Bash (and TodoWrite is unavailable)
Environment
- Claude Code 2.1.260
- Windows 11, Git Bash as the Bash tool shell
~/.claude/settings.json→"permissions": { "defaultMode": "auto" }- Model: Opus 5
---
1. Auto mode steers the model away from Read/Edit/Write, and the result is worse than using them
When auto mode is active, this system-reminder is injected:
While auto mode is active: Do your work through the Bash tool wherever it can accomplish the job: read files withcat,head, orsed -n, search withgrepandfind, and make file changes withsed, heredocs, or short scripts, rather than using the dedicated Read, Edit, or Write tools. Fall back to a dedicated tool only when Bash genuinely cannot do the job.
For reads and searches this is mostly fine. For modifications it actively hurts, because sed/heredoc editing has none of the safety properties Edit has.
What that cost me in one real session (~15 multi-line edits across 6 JS/JSX files):
Editguarantees itsold_stringmatches exactly once or the call fails.sedhas no equivalent, so to avoid silently patching the wrong occurrence I wrote a ~20-line Node "exact replace" helper — a hand-rolled reimplementation of a tool that already exists.- The first run of that helper failed on every chunk: the repo is CRLF, my heredocs were LF. I had to rewrite the helper to normalize EOLs for matching and restore the original style on write.
Edithandles this natively. That's a wasted round-trip caused entirely by not using the built-in. - Each edit needed a literal-quoted heredoc pair (
NN.old/NN.new) staged on disk — ~25 temp files to accomplish what 15Editcalls would have done directly. More tokens, more moving parts, more places to get an escape wrong.
Editing through the shell also gives up things the harness provides for free:
Editrefuses to write a file that changed since it was read;sedwill happily clobber it.Readreturns line-numbered output that renders as clickablefile:linereferences;cat -ndoesn't.Grepresults integrate with the permission UI and file links; rawrg/grepoutput doesn't.- Backslash/quote escaping through heredocs and
sedis a genuine correctness hazard when the payload is regex-heavy source code — exactly the case where a silent mis-edit is most expensive.
Suggested change: scope the instruction to reads and searches, and leave modifications to Edit/Write. Something like "prefer Bash for reading and searching; use Edit/Write for file modifications." If the motivation is reducing permission prompts, that seems better solved in the permission layer (auto-allowing Read/Edit on in-project paths) than by steering the model onto a less safe path for the one operation where mistakes are hardest to undo.
---
2. TodoWrite is not available in this session
TodoWrite is absent from the tool list, and it is not resolvable as a deferred tool either:
ToolSearch("select:TodoWrite") → "No matching deferred tools found"
So there is no way to surface a plan for a multi-step task in the UI; progress has to be narrated in prose instead.
I can't tell from the client side whether this is intentional in auto mode, an interaction with the deferred-tool mechanism, or a bug — flagging it as observed rather than diagnosed. If it's intentional, it's a surprising place to remove it: auto mode is where longer unattended runs happen and where a visible checklist is most useful to the person watching.
Repro
- Set
"permissions": { "defaultMode": "auto" }in~/.claude/settings.json. - Start a session and give a multi-step coding task.
- Observe the auto-mode system-reminder, and that
TodoWriteis neither in the tool list nor findable viaToolSearch.
Showing cached comments. Read the full discussion on GitHub ↗
3 Comments
I've just experienced this as well. It's a real strange "feature" to have the agent prefer writing 50+ lines of python scripts to do a few string-replacement edits in a few files, especially when it needs three attempts because of various syntax errors in the heredoc'd script -- and probably has a much greater chance of making accidental changes than with an edit tool which can have built-in guardrails and provide tool result feedback on what changed, etc.
Reproduced independently on Linux (not Windows-specific): VS Code extension
anthropics.claude-code-2.1.270-linux-x64, project workspace withpermissions.defaultModenot even set toautoat the project level — auto mode was enabled globally.Same exact symptom:
TodoWriteabsent from the top-level tool list, andToolSearch("select:TodoWrite")returns "No matching deferred tools found".Ruled out before concluding it matches this issue:
disallowedToolsorpermissions.denyentry forTodoWritein projectsettings.json, projectsettings.local.json, or global~/.claude/settings.json./proc/<pid>/cmdlinethat the interactive session process itself was launched with no--disallowedToolsflag at all.claude-router,claude-mem) inspected directly in their cached source — neither disables or filtersTodoWritefrom the model-facing tool list. (claude-memdoes referenceTodoWritein aCLAUDE_MEM_SKIP_TOOLSdefault, but that only filters which tool calls it logs as memory observations, unrelated to tool registration.)claudeheadless processes did not resolve it.This points at the same root cause described here — Auto Mode itself removing
TodoWritefrom the registered/deferred tool set — rather than local config, a plugin, or a stale extension version.I noticed that something was blocking and overwriting that the todo write is available. I asked the AI about that issue and it found something which was causing the issue and after that it worked. But the other issue is confirmed.