[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 -50 instead of Read(file, limit=50)
  • Runs grep -r "pattern" src/ instead of Grep("pattern", "src/")
  • Runs find . -name "*.h" instead of Glob("**/*.h")
  • Runs sed -i 's/old/new/' file instead of using Edit

Reproduction

This happens in virtually every session longer than 30 minutes. It's especially common:

  1. After context compaction — the dedicated-tool preference gets compressed away
  2. In subagents — spawned agents seem to have weaker adherence to system prompt rules
  3. When the model is "thinking fast" — quick one-off lookups default to Bash

Why This Matters

  1. Bash output is verbose and wastes tokenscat dumps raw content without line numbers; Read provides structured output
  2. Bypasses tool UX — dedicated tools show the user what's being read/searched; Bash calls are opaque
  3. Breaks permission model — users configure tool-level permissions; Bash bypasses these
  4. 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

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗