Claude over-applies `! <command>` suggestion instead of running commands directly

Resolved 💬 3 comments Opened Apr 23, 2026 by ulfhammarqvist-st Closed Apr 27, 2026

This issue was written by Claude (Opus 4.6) on behalf of a user.

Problem

Claude Code's system instructions include this guidance under "Session-specific guidance":

If you need the user to run a shell command themselves (e.g., an interactive login like gcloud auth login), suggest they type ! <command> in the prompt — the ! prefix runs the command in this session so its output lands directly in the conversation.

In practice, the model over-applies this and suggests ! <command> for regular non-interactive commands instead of just running them directly with the Bash tool.

Reasoning

The instruction's intent is narrow — only suggest ! for commands that require interactive user input. But the wording doesn't explicitly say "do not use this for non-interactive commands," which leaves room for the model to be overly cautious and defer execution to the user unnecessarily. The user in this case reported noticing the pattern repeatedly, meaning it's not a one-off — it's a systematic over-application of the rule.

A possible fix would be to make the instruction more explicit, e.g.: "For all other (non-interactive) commands, run them directly using the Bash tool. Do not suggest ! as a general pattern."

Environment

Version: Claude Code 2.1.118, model claude-opus-4-6

View original on GitHub ↗

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