> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Lifecycle hooks

> React to Python run, model, step, tool, and checkpoint events.

Pass `on_event` to update product timelines, audit records, or an existing telemetry system:

```python theme={null}
def on_event(event):
    logger.info("%s %s", event.type, event.run_id)
```

Events cover run state, model calls, steps, checkpoints, tool execution and progress, human waits, cancellation, and failures. Keep the callback fast and queue slow work externally.

## Related

* [Streaming](./agent-sdk-streaming)
* [DevTools](./agent-sdk-devtools)
