[MODEL] Claude uses Bash (cat, grep, head) instead of dedicated tools despite system prompt prohibition
Resolved 💬 6 comments Opened Mar 27, 2026 by VoxCore84 Closed May 3, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This report does NOT contain sensitive information
Type of Behavior Issue
Claude ignored my instructions or configuration
What You Asked Claude to Do
Use dedicated tools (Read, Grep, Glob, Edit, Write) instead of Bash equivalents, as specified in the system prompt.
What Claude Actually Did
The system prompt contains explicit instructions:
Do NOT use the Bash to run commands when a relevant dedicated tool is provided. - To read files use Read instead of cat, head, tail, or sed - To edit files use Edit instead of sed or awk - To search for files use Glob instead of find or ls - To search the content of files, use Grep instead of grep or rg
Despite this, Claude Code routinely:
- Runs
cat file.cpp | head -50instead ofRead(file, limit=50) - Runs
grep -r "pattern" src/instead ofGrep("pattern", "src/") - Runs
find . -name "*.h"instead ofGlob("**/*.h") - Runs
sed -i 's/old/new/' fileinstead of using Edit
Reproduction
This happens in virtually every session longer than 30 minutes. It's especially common:
- After context compaction — the dedicated-tool preference gets compressed away
- In subagents — spawned agents seem to have weaker adherence to system prompt rules
- When the model is "thinking fast" — quick one-off lookups default to Bash
Why This Matters
- Bash output is verbose and wastes tokens —
catdumps raw content without line numbers; Read provides structured output - Bypasses tool UX — dedicated tools show the user what's being read/searched; Bash calls are opaque
- Breaks permission model — users configure tool-level permissions; Bash bypasses these
- The system prompt already prohibits this — the model is violating its own instructions
Evidence
Over 200+ sessions on a large C++ codebase (TrinityCore fork, ~2M LOC), this happens in roughly 40% of sessions. The CLAUDE.md reinforces the system prompt with additional rules, and we still see the model reach for cat and grep regularly.
Environment
- Claude Code v2.1.85
- Opus 4.6
- Windows 11 Pro
- Platform: CLI (bash shell)
Cross-References
- #32290 — Reads files but ignores actionable instructions
- #19471 — CLAUDE.md instructions ignored after compaction
- #32659 — Context amnesia in long sessions
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗