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.
More from coding & agent
- Qiaomu UI Learn ships as Antigravity plugin with 13,500+ real UI references for agent replication — vista8 · 2026-11-30
- DHH cracks Linux deep sleep on Zenbook A16: 0.16W overnight draw — cgarciae88 · 2026-11-30
- Sakana AI open-sources Agentic Scientist, pushing toward self-improving AI researchers — SakanaAILabs · 2026-11-30
- Blogger migrates Ghost blog to self-hosting in hours with Claude — kevinakwok · 2026-11-30
- Dev turns iPhone into an MCP server so local LLMs can read your phone data — Solid-Strawberry-333 · 2026-11-30
- Free interactive AI book Zero to Frontier adds Learn-in-Claude integration — RepulsiveScene8320 · 2026-11-30