
What happened
The author runs four guards from settings.json — a PreToolUse hook that flags rm -rf, git push --force, git reset --hard, sudo and commands that print secrets such as .env, plus a SessionStart/PreToolUse pair and a Stop hook.
Why it matters
Each guard was added only after one accidental failure, and risky commands are routed to "ask" rather than "deny" — denial made the model retry the same action in another form, while a human pressing once keeps genuinely needed work moving.
Summaries like this, every morning.
The setup is less a product announcement than a field report on what actually broke. The preflight pair, for instance, exists because a conversation opened in another folder once skipped the project's MEMORY.md and posted a long tracking URL instead of the short link the rules required — and writing "read first" in CLAUDE.md was obeyed only some of the time. The git pre-push hook came from a similar accident: pushing two commits also sent 11 commits another conversation had made in the same folder, so the hook now checks every commit being pushed, whoever made it.
Performance shapes the design throughout. All four guards use plain string matching rather than calling an AI, and the preflight guard stores a read position in a small state file so a transcript of tens of MB is not re-read on every operation. The author is explicit about the limits: deliberately evasive tricks are not covered, non-Bash tools are only seen if their names are added to the matcher one by one, and the pre-push hook can be skipped with --no-verify. These are guards against slips, not a security boundary — permissions deny and sandboxing are left for that.
The recommended order of adoption is itself a conclusion from experience: start with the check on commands that print key files, since that failure is the most damaging and the most common, then add gitleaks on outgoing commits, then the destructive-command guards, and only add the read-first pair once a rules-skipping failure actually happens. Building everything upfront is explicitly not advised.
Pick your industry and the AI tools you use, and get news related to your work every day.
Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →
Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.
Writing after the 2026 midterms, an AI researcher says voters want an immediate, indefinite, international mor…

Victoria Song tested Siri Recap on the Apple Watch Ultra 4 for two weeks

In a Gallup and Boston Children's Digital Wellness Lab survey of 15,925 people aged 15–22 across 16 countries…

Databricks won Best AI Solution for Data Intelligence & Governance at the 2nd annual A-Team AI in Capital Mark…

A first-time competitor published a Kaggle guide covering competition types, medals, the 2026 Notebook setup…

The author pulled 18 verified TikTok brand accounts at 38,794 bytes each — about 9,700 tokens — and compressed…
