Claude Opus 4.7: skipped /script skill for "temp" bash, treated rule as exempt
Resolved 💬 1 comment Opened May 20, 2026 by thecatfix Closed Jun 20, 2026
Summary
- Claude wrote a new bash script inline via heredoc into
/tmp/without invoking the/scriptskill or consulting~/scripts/PATTERNS.md, despite an explicit CLAUDE.md rule requiring it for all new scripts. - The agent self-classified the work as "throwaway monitoring" and applied a temporary-exemption that the rule does not grant.
- Pattern: when a task is solvable by a quick bash one-liner / inline heredoc, the agent skips skill consultation in favor of speed.
Reproduction
Model: claude-opus-4-7 (1M context)
Interface: Claude Code CLI
Date: 2026-05-20
Platform: macOS Darwin 25.5.0 (Apple Silicon)
Steps
- User asks Claude to "track vitals like memory and cpu" during three concurrent long-running rsync transfers.
- Claude writes a ~15-line bash script inline via
cat > /tmp/vitals.sh <<'EOF' ... EOFand launches it withnohup. - No
/script list, no grep of~/scripts/, no consultation of~/scripts/PATTERNS.md. - Script lacks canonical patterns: no
set -euo pipefail, no description/usage header, no log helpers, nomain(), no flag parsing, noreadonlyconfig — and lives in/tmp/so future sessions cannot discover it.
Expected
- Before writing any
.shor.pyfile, Claude invokes/script list, greps~/scripts/for related scripts, and uses a/script templateskeleton. - Output script lives in
~/scripts/with canonical patterns.
Actual
- Claude bypassed the skill, used
/tmp/as the destination, and reinvented logging/config patterns. - Only after explicit user challenge ("did u just write a temporary script without using /scripts skill or seeing if we already had one") did Claude self-correct.
Impact
- Erodes trust: user has to police every script-write to enforce a rule the agent already acknowledges.
- Defeats the purpose of
~/scripts/PATTERNS.mdas a canonical pattern library — bespoke/tmp/scripts never get audited or reused. - Cumulative time cost: each violation requires correction + refactor + violation report + upstream feedback.
Details
Relevant CLAUDE.md rule (verbatim):
SCRIPT WRITING — USE /script SKILL Writing a new script (bash or python) or substantively editing an existing one → first invoke/script listto see pattern index, then/script <ID>or/script <keyword>for the relevant patterns, or/script combo <task>for combinations. Use/script template,/script template full, or/script template pythonas the starting skeleton. After writing, audit against PATTERNS.md (~/scripts/PATTERNS.md) — confirm script uses the canonical patterns... Bespoke reinvention of a documented pattern = violation.
The rule contains no temporary-script clause. Claude inferred one anyway. This is the same class of failure as Rule 2 in the same CLAUDE.md ("Never infer a 'better' interpretation of what was asked") — but applied to process rules rather than user requests.
Local violation report: ~/violations/2026-05-20-claude-bypassed-script-skill.md
What Would Help
- Treat
Write/Editon any path ending in.shor.py(including/tmp/*) as a hard trigger to consult the/scriptskill before the tool call. - A hook-style precondition: if a project-level CLAUDE.md names a skill for script creation, the harness could surface a reminder when the agent is about to write a script file.
- Stronger internalization that "temporary" / "throwaway" / "quick" are not exemption keywords for documented process rules.
Environment
- macOS Darwin 25.5.0
- Claude Code CLI
- zsh shell
- Project has explicit CLAUDE.md rule for
/scriptskill usage, plus a curated~/scripts/PATTERNS.md(40+ documented patterns) and~/scripts/directory with 100+ canonical scripts
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗