Hooks - Anthropic
Introduction
Claude Code hooks are user-defined shell commands that execute at various points
in Claude Code’s lifecycle. Hooks provide deterministic control over Claude
Code’s behavior, ensuring certain actions always happen rather than relying on
the LLM to choose to run them.
Example use cases include:
Notifications: Customize how you get notified when Claude Code is awaiting
your input or permission to run something.
Automatic formatting: Run prettier on .ts files, gofmt on .go files,
etc. a...
Read more at docs.anthropic.com