Claude Code hooks are shell commands that the tool runs for you at defined points in a session. Because the tool runs them, not the model, they are a dependable way to make something happen every time.
Typical events
- Before a tool is used, where a hook can inspect and block the call.
- After a tool is used, for example to run a formatter on an edited file.
- When the session starts.
- When the agent finishes a response.
Good uses
- Format or lint files after an edit.
- Block commands that touch protected paths.
- Remind the agent to save a checkpoint after a commit.
- Log what happened for audit.
Risks
- A hook runs with your rights. Read a hook before you install it.
- A slow hook slows every session.
- A hook that fails silently gives a false sense of safety.
In this product
The setup command for Contextingo installs a hook that reminds Claude Code to save knowledge as it works, and to leave a checkpoint after a commit or push that has none. Configuration details are in the Claude Code documentation.
See also a handover that survives the chat.