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
- Agentic coding accessibility will reshape understanding of software complexity — pixlpa · 2026-08-24
- Devin Agent bypasses Slack block by finding emails in git logs — sandylikesfrogs · 2026-08-24
- Developer habits shift: Agents become collaborators from simple tools — latticecut · 2026-08-24
- Dev bottleneck shifts from writing to reading code: exe.dev co-founder — thursdai_pod · 2026-08-24
- The biggest AI mistake: trying to reinvent the wheel instead of using tools — Tired40s · 2026-08-24
- DeepPaperNote turns research papers into Obsidian notes — tom_doerr · 2026-08-24