Claude Code binary hides a bashFirst prompt telling the model to edit files with sed

zommuter · ghdev · 2026-08-20

A Claude Code bug report reveals that in Auto mode the model prefers editing files via Python/sed/heredoc scripts instead of the dedicated Edit/Write tools. The reporter unpacked the CLI binary (/opt/claude-code/bin/claude-code) and found the hardcoded system prompt template: read with cat/head/sed, search with grep/find, make file changes with sed/heredocs or short scripts rather than dedicated tools, falling back only when bash genuinely can't do the job.\n\nThe gate is code-level: automode: bashFirst fires when the session has Bash plus Edit/Write and an internal gate d5o() returns true. There is no settings key or env var to disable it, and bypassPermissions has its own sibling injection, so bypass mode doesn't escape it either. Version 2.1.234, Linux.

Original post →

More from coding & agent

coding & agent channel →