AI
What does a PostToolUse hook actually do for a multi-file edit?
A captured `claude --print` session against the demo app, with a PostToolUse hook (matcher `Edit|Write`) that runs `npm run typecheck` after every edit. The prompt asked for a multi-file change (add `'parking-permit'` to `ServiceType`, update Finnish labels, update Record-typed consumers). Claude completed the work in eight Edits and also fixed a pre-existing `noUncheckedIndexedAccess` typecheck error that the hook flagged on the way through. The article shows the hook config, the actual fix Claude landed, and a real debugging surprise: the events.jsonl does not surface PostToolUse hook firings the same way SessionStart hooks do, which has consequences for how you verify these hooks are working.