
Agents
Claude Code hooks, explained: block rm, auto-format, get pinged when it stops
A hook is a small script Claude Code runs for you at fixed moments, such as before a tool call or when Claude finishes. Here is every piece in Anthropic's docs that matters: events, matchers, exit codes, JSON, where the file lives, and the security warning.
Tensor · 2h ago · 11 min