#hooks
9 articles
-
Claude Code on Windows, native or WSL, and what trips people up
Native Windows and WSL 2 compared on the point that decides it — sandboxing — plus install steps, whether you need Git for Windows, and the hooks and encoding gotchas.
-
Review debt in the AI era cannot be repaid by reading more
AI writes faster than anyone can read, and review debt accumulates. The case for repaying it by shrinking the unit, letting machines fail it, and constraining in advance.
-
Get a desktop notification when Claude Code finishes, with a Stop hook
Fire a notification the moment Claude finishes responding: commands for macOS, Linux and Windows, how Stop differs from Notification, and the exit-code trap to avoid.
-
Claude Code hook input and output, the JSON on stdin and what exit codes 0, 2 and everything else do
Command hooks read JSON from stdin and answer with an exit code. The fields every event includes, the extras per event, jq examples, what exit 2 does per event, and JSON output.
-
Tests are the only fixed point left when the implementation is disposable
When an AI can rewrite the implementation at will, where does the spec live? Grounded in the docs that say instructions carry no enforcement, and in what a hook can block.
-
Run lint after every edit in Claude Code: a PostToolUse hook on Edit|Write|MultiEdit
A PostToolUse hook with matcher "Edit|Write|MultiEdit" runs Prettier, ESLint or ruff after every edit. Read the path from tool_input.file_path and feed failures back to Claude.
-
Block rm -rf with a Claude Code PreToolUse hook, and know its limits
Two ways to deny a dangerous rm before it runs: exit code 2 and permissionDecision. Why a hook deny works even in bypassPermissions, and where string matching stops being enough.
-
Every value you can put in a Claude Code hook matcher, by event
What a hook matcher compares against depends on the event. The exact-match, regex and wildcard rules, the events that silently ignore a matcher, and how to target MCP tools.
-
Log which CLAUDE.md files Claude Code loads, and when, with the InstructionsLoaded hook
Use the InstructionsLoaded hook to record every CLAUDE.md and .claude/rules/ file as it enters context: matcher values, input JSON fields, a logging example, and its limits.