
What happened
A Zenn walkthrough lays out three ready-to-copy Hooks — PostToolUse runs a formatter after every Edit or Write, PreToolUse blocks dangerous commands, and Stop runs tests — configured in .claude/settings.json.
Why it matters
Hooks are a mechanism, not an instruction, so they fire every time the matcher matches; formatting and blocking no longer depend on the model reading context correctly.
Summaries like this, every morning.
The piece draws its main distinction between Hooks and CLAUDE.md. CLAUDE.md is read as context, so a formatting or safety instruction may be missed depending on the situation. A hook, by contrast, runs whenever its matcher matches, which is why the author routes formatting and blocking there and leaves judgment-heavy working policy to CLAUDE.md.
Scope is set by where the JSON lives. ~/.claude/settings.json applies to all projects on one machine, .claude/settings.json is per project and can be committed so a team shares the same rules, and .claude/settings.local.json is per project but personal and gitignored. Cloud sessions do not read the local file, so anything meant for cloud or team use belongs on the project side. Hooks defined in settings files also fire inside subagents.
The recipes come with limits. A PostToolUse failure cannot undo the tool call that already ran. Blocking too broadly in PreToolUse stops ordinary work, so the author starts narrow. Stop hooks have a runtime cap, so heavy processing may be cut off. The advice is to add hooks one at a time, keep team rules in committed project settings, and review with the /hooks command.
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.
Wells Fargo is adding Section 15 to its Online Access Agreement, effective with an updated agreement rolling o…

Visa expanded its Agentic Ready program — part of Visa Intelligent Commerce — to merchants, PSPs, acquirers an…

A homelabber detailed a second-gen Optane build with two added RTX 3090s that runs the 2.8-trillion-parameter…

A Chinese-nexus actor's Cairn AI agents autonomously discovered a zero-day vulnerability, according to Amazon…

ServiceNow's Brazil release for SPM and CWM includes MCP for SPM, a prebuilt Model Context Protocol server let…

Uber’s 4 Claude Code defaults to rein in costs, VentureBeat reports
