Idea
Add a /careful skill that activates a PreToolUse hook intercepting destructive shell commands before they execute. Rather than hard-blocking, the hook returns {"permissionDecision":"ask","message":"..."} so Claude pauses and asks for confirmation — giving the user override capability while preventing accidental damage.
Goal
Catch common high-impact mistakes before they happen: force-pushing, dropping tables, recursively deleting files, pruning containers. Particularly valuable in terminal-heavy workflows or when working near production systems.
Commands to intercept
rm -r / rm -rf (with safe-exceptions for node_modules, dist, .next, coverage, tmp)
git push --force / git reset --hard / git checkout .
DROP TABLE / TRUNCATE
docker rm -f / docker system prune
kubectl delete
Implementation approach
- Add
skills/careful/SKILL.md — skill prompt that activates the hook when invoked via /careful
- Add
hooks/check-careful.sh — PreToolUse bash script that:
- Matches the incoming command against destructive patterns
- Checks a safe-exceptions list (build artifact dirs, etc.)
- Returns
{"permissionDecision":"ask","message":"Destructive pattern detected: <pattern name>. Confirm?"} on match
- Logs the pattern name (never the full command) to
~/.claude/sysops/usage.jsonl
- Register the hook in
settings/hooks.json scoped to the skill (not always-on like no-chaining)
- Update
install.sh to handle skill-scoped hook registration
Notes
- Warn-and-confirm (not deny) is the right UX here — the user should be able to override
- Log pattern names only, never command content, for privacy
- Complements the existing
no-chaining hook (different concern: safety vs. discipline)
Idea
Add a
/carefulskill that activates aPreToolUsehook intercepting destructive shell commands before they execute. Rather than hard-blocking, the hook returns{"permissionDecision":"ask","message":"..."}so Claude pauses and asks for confirmation — giving the user override capability while preventing accidental damage.Goal
Catch common high-impact mistakes before they happen: force-pushing, dropping tables, recursively deleting files, pruning containers. Particularly valuable in terminal-heavy workflows or when working near production systems.
Commands to intercept
rm -r/rm -rf(with safe-exceptions fornode_modules,dist,.next,coverage,tmp)git push --force/git reset --hard/git checkout .DROP TABLE/TRUNCATEdocker rm -f/docker system prunekubectl deleteImplementation approach
skills/careful/SKILL.md— skill prompt that activates the hook when invoked via/carefulhooks/check-careful.sh—PreToolUsebash script that:{"permissionDecision":"ask","message":"Destructive pattern detected: <pattern name>. Confirm?"}on match~/.claude/sysops/usage.jsonlsettings/hooks.jsonscoped to the skill (not always-on likeno-chaining)install.shto handle skill-scoped hook registrationNotes
no-chaininghook (different concern: safety vs. discipline)