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
- Apple code signing drags for hours; official advice: just wait a week — pjausovec · 2026-10-16
- Hermes: a 4B model with 8K context got worse with more test-time compute, pointing to contextual reasoning — mangahomanga · 2026-10-16
- Flux 3 Klein's Default Templates Are Broken Without Its Prompt Upscaler — StrictMove5839 · 2026-10-16
- 21-person team ships hundreds of PRs weekly with AI writing 97% of the code — rseroter · 2026-10-16
- ClosedMCP: Set Up MCP Servers Once, Share Them Across Your Whole Team — Ok_Sprinkles1301 · 2026-10-16
- Heisentools: let an agent rewrite a mock.py until it mirrors any real tool's API — kieranklaassen · 2026-10-16