Notes on building software.

A personal blog of technical articles about software development.

What Hooks Are and Why They're Deterministic

September 8, 2026· 2 min read·claude-codehooksautomation

Hooks are shell commands Claude Code runs at set points in a session, giving you rules that always fire instead of hoping the model remembers.

The Hook Lifecycle: Events You Can Tap Into

September 8, 2026· 2 min read·claude-codehooksconfiguration

A tour of every hook event Claude Code fires, from tool calls to session start, so you know where to attach your automation.

Your First PreToolUse Hook

September 8, 2026· 2 min read·claude-codehooksautomation

Build a simple PreToolUse hook that logs every Bash command Claude is about to run, and learn how event data arrives on stdin.

Formatting Code Automatically with a PostToolUse Hook

September 8, 2026· 2 min read·claude-codehooksautomation

Wire up a PostToolUse hook so every file Claude edits gets formatted right away, keeping your diffs clean without asking.

Blocking Dangerous Commands with Hooks

September 8, 2026· 2 min read·claude-codehooksautomation

Use a PreToolUse hook and exit code 2 to stop Claude from running commands you never want it to touch.

Hook Matchers and the if Condition

September 8, 2026· 2 min read·claude-codehooksconfiguration

Matchers decide which tool triggers a hook; learn the patterns and how to add your own conditions inside the command.