Quiet-guardrails: Claude Code manual mode, minus the nagging A new PreToolUse hook called Quiet-guardrails blocks Claude Code's shell-habit commands with exit 2 and a one-line stderr correction, prompting the model to rewrite them into plain forms the user's allowlist already trusts, so no approval prompt appears. The hook also forces a confirmation on git operations Claude Code auto-approves, including git add, git reset and git branch -D, and logs every use of its escape hatch. The tool's author states it is not a security boundary and does not defend against an adversarial or prompt-injected agent, working alongside Claude Code's own allowlist and sandbox rather than replacing them. manual mode, minus the nagging — deterministic guardrails that quiet the safe prompts in Claude Code and keep you in control. A single PreToolUse hook + a curated allowlist that make Claude Code stop asking about safe work and start self-correcting its own bad habits — while still forcing a confirmation on the few things that genuinely deserve one. It's a deliberate alternative to auto mode. Where auto mode asks an LLM classifier to judge each action probabilistic, opaque, per-call , this takes the opposite bet: make the model's default behavior correct and frictionless, deterministically , and keep you in control of exactly what runs unattended. What it is — and isn't. This corrects a cooperative model's habits to cut prompts and forces a confirmation on a few risky git ops Claude Code waves through . It is not a security boundary and does not defend against an adversarial or prompt-injected agent — a determined one can slip any string heuristic. It works alongside Claude Code's own allowlist and sandbox, not as a replacement for either: the sandbox is your wall against a hostile process; this is habit-correction for a well-behaved one. Most Claude Code prompt fatigue isn't from dangerous commands — it's from safe ones dressed in shell habits: a grep piped into wc , a cmd 2 &1 | tail , a cd repo && git status , an npx jest instead of npm test . Each is harmless, none matches an allowlist, so each prompts. People get tired of approving them and flip on a blanket "just allow everything" mode — trading away all oversight to escape the noise. This hook attacks the root instead. When the model reaches for one of those shapes, the hook blocks it with exit 2 and a one-line correction on stderr "run it bare — the harness already returns stdout, stderr, and the exit code" . The model reads that, rewrites the command into the plain form, and retries. You never see a prompt, because the command that finally runs is the one your allowlist already trusts. The model also, over a session, stops producing the bad shapes at all. A few principles fall out of that: - Sanity prompts tokens. Pick the correct, reviewable command first; avoid a needless prompt second; save keystrokes/tokens last. The recurring failure is inverting it — a "clever" one-liner that saves a token but prompts and mutates blind. - A block should mean "rewrite," not "bypass." So the escape hatch below is never mentioned in a rule's message . When you're blocked, the only thing on screen is how to do it right — reaching for the override is a conscious act, not the reflex. - Force the prompts that should exist. Claude Code read-only- misclassifies some git subcommands — git add , git reset , git branch -D — so they auto-approve with no prompt. The guard overrides that and forces a confirmation. The index and your uncommitted work are yours. - Success is silent, so measure it. Every use of the escape hatch is appended to a log, so "no prompts" can't quietly hide overuse. Self-corrects exit 2 → the model rewrites, no prompt : | Shape | Correction | |---|---| | grep / find piped or in $ ... | run the search bare, act on the result in a separate call … \| wc -l counts are exempt | | cat , leading head / tail on a file | use the Read tool | | cmd \| tail , cmd 2 &1 , echo $? , cmd /tmp/… | run it bare — the harness returns full stdout/stderr + exit status | | for / while loop | separate/parallel tool calls | | cd repo && git … | standalone cd , then plain git | | git -C