Pattern

Lifecycle hooks

Run your own commands at defined points in Claude Code's lifecycle — before and after tool calls, on session and turn boundaries, on prompt submission — so policies and side effects execute deterministically rather than depending on the model choosing to perform them.

Classification Handlers fired deterministically on agent lifecycle events.

Full entry

The complete treatment — problem, how it works, when to use it, sources, and examples — lives in the volume below.

Browse the full pattern index or the catalog.

Search the catalog