Auto mode discourages Read/Edit/Write in favour of Bash (and TodoWrite is unavailable)

Status Open
Reported on v2.1.260
Maintainer reply None cached
Activity 8 comments · opened Sep 4, 2026

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 with cat, head, or sed -n, search with grep and find, and make file changes with sed, 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):

  1. Edit guarantees its old_string matches exactly once or the call fails. sed has 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.
  2. 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. Edit handles this natively. That's a wasted round-trip caused entirely by not using the built-in.
  3. Each edit needed a literal-quoted heredoc pair (NN.old / NN.new) staged on disk — ~25 temp files to accomplish what 15 Edit calls 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:

  • Edit refuses to write a file that changed since it was read; sed will happily clobber it.
  • Read returns line-numbered output that renders as clickable file:line references; cat -n doesn't.
  • Grep results integrate with the permission UI and file links; raw rg/grep output doesn't.
  • Backslash/quote escaping through heredocs and sed is 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

  1. Set "permissions": { "defaultMode": "auto" } in ~/.claude/settings.json.
  2. Start a session and give a multi-step coding task.
  3. Observe the auto-mode system-reminder, and that TodoWrite is neither in the tool list nor findable via ToolSearch.

View original on GitHub ↗

3 Comments

steinnes · 1 month ago

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.

leonsas-www · 1 month ago

Reproduced independently on Linux (not Windows-specific): VS Code extension anthropics.claude-code-2.1.270-linux-x64, project workspace with permissions.defaultMode not even set to auto at the project level — auto mode was enabled globally.

Same exact symptom: TodoWrite absent from the top-level tool list, and ToolSearch("select:TodoWrite") returns "No matching deferred tools found".

Ruled out before concluding it matches this issue:

  • No disallowedTools or permissions.deny entry for TodoWrite in project settings.json, project settings.local.json, or global ~/.claude/settings.json.
  • Confirmed via /proc/<pid>/cmdline that the interactive session process itself was launched with no --disallowedTools flag at all.
  • Two enabled plugins (claude-router, claude-mem) inspected directly in their cached source — neither disables or filters TodoWrite from the model-facing tool list. (claude-mem does reference TodoWrite in a CLAUDE_MEM_SKIP_TOOLS default, but that only filters which tool calls it logs as memory observations, unrelated to tool registration.)
  • Restarting VS Code / updating the extension (2.1.269 → 2.1.270) did not resolve it.
  • Killing stray background claude headless processes did not resolve it.

This points at the same root cause described here — Auto Mode itself removing TodoWrite from the registered/deferred tool set — rather than local config, a plugin, or a stale extension version.

PierrunoYT · 1 month ago
Reproduced independently on Linux (not Windows-specific): VS Code extension anthropics.claude-code-2.1.270-linux-x64, project workspace with permissions.defaultMode not even set to auto at the project level — auto mode was enabled globally. Same exact symptom: TodoWrite absent from the top-level tool list, and ToolSearch("select:TodoWrite") returns "No matching deferred tools found". Ruled out before concluding it matches this issue: - No disallowedTools or permissions.deny entry for TodoWrite in project settings.json, project settings.local.json, or global ~/.claude/settings.json. - Confirmed via /proc/<pid>/cmdline that the interactive session process itself was launched with no --disallowedTools flag at all. - Two enabled plugins (claude-router, claude-mem) inspected directly in their cached source — neither disables or filters TodoWrite from the model-facing tool list. (claude-mem does reference TodoWrite in a CLAUDE_MEM_SKIP_TOOLS default, but that only filters which tool calls it logs as memory observations, unrelated to tool registration.) - Restarting VS Code / updating the extension (2.1.269 → 2.1.270) did not resolve it. - Killing stray background claude headless processes did not resolve it. This points at the same root cause described here — Auto Mode itself removing TodoWrite from 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.

Showing cached comments. Read the full discussion on GitHub ↗