Bypass-permissions mode steers file edits to Bash sed/heredocs, silently removing all edit diffs

Status Open
Reported on v2.1.251
Maintainer reply None cached
Activity 0 comments · opened Aug 29, 2026

Summary

In bypass-permissions mode, the injected system prompt instructs the model to perform file reads and edits through the Bash tool (cat, sed -n, sed, heredocs) "rather than using the dedicated Read, Edit, or Write tools".

Because the edit diff is rendered by the Edit/Write tool cards, the practical effect is that all diffs for file changes silently disappear in bypass mode. The user gets no visual record of what was changed to which file — changes arrive as opaque shell commands.

Environment

  • Claude Code 2.1.251 (also present: 2.1.248, 2.1.250)
  • macOS (Darwin 25.3.0)
  • ~/.claude/settings.json contains "skipDangerousModePermissionPrompt": true
  • No hooks configured

The instruction in question

The session system prompt contains, under a "While bypass permissions mode is active" block:

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.

Steps to reproduce

  1. Run Claude Code with bypass permissions active.
  2. Ask for a small edit to any file.
  3. Observe: the change is applied via a Bash sed/heredoc command. No diff is rendered.

Switching to acceptEdits restores Edit/Write usage and the diffs return.

Expected

Either:

  • edits remain visible as diffs regardless of permission mode, or
  • the trade-off is documented and there is a setting to opt out (e.g. keep Edit/Write in bypass mode).

Actual

Diffs vanish with no setting, flag, or changelog entry explaining it. From a user's perspective this reads as a regression that appeared after an update, with no discoverable cause — I spent a while searching docs, settings reference, and the changelog for a showDiff/verbose-style toggle before locating the cause in the system prompt itself.

Notes

  • Nothing in the CHANGELOG between 2.1.240 and 2.1.251 mentions this change to edit rendering.
  • The settings reference documents no toggle for it. diffTool and PostToolUse hooks are both ineffective here, because they key off Edit/Write tool calls that no longer happen.
  • Workaround that does work: a user-level ~/.claude/CLAUDE.md instruction to always use Read/Edit/Write for files. But this is a prompt overriding a prompt, not a guaranteed setting.

Suggested fix

Add a setting (e.g. preferBashForFileOps: false, or a showEditDiffs-style toggle) so users who want auditability can keep Edit/Write in bypass mode, and mention the behaviour in the docs for bypass permissions.

View original on GitHub ↗