# --include-hook-events Flag

> It adds hook events to the output stream.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude --include-hook-events, Hook events in the stream

## Think of it like

It is like a list that shows when each helper starts and ends their part.

## Definition

--include-hook-events adds events about hooks to the output stream: when a hook starts, what it prints, and how it ends. Events from SessionStart and Setup hooks show up even without it. It needs --output-format stream-json. A program uses it to see what your hooks did during a run.

## Example

Emma's hook blocks some commands, and her CI run fails without saying why. With --include-hook-events, the stream shows the hook that said no.

## Example code

```bash
claude -p --output-format stream-json --verbose --include-hook-events "Run the tests"
```

See each hook start and finish.

## Why it matters

When a hook changes what Claude does, the stream is where a script can see it.

## Common mistake

Expecting a start event for each hook. Some never send one, even with this flag. Notification and SessionEnd are two.

## Three principles

- **Start, output, end.** For each hook.
- **Some always shown.** SessionStart, Setup.
- **Not every hook.** Sends a start event.

## Related terms

- [--output-format Flag](https://learn.benibix.com/term/ai/output-format-flag)
- [--include-partial-messages Flag](https://learn.benibix.com/term/ai/include-partial-messages-flag)

## Taught in

- [Print Mode Output Flags](https://learn.benibix.com/learn/ai-claude-code-commands/print-mode-output-flags): Claude Code Commands, 14/17

![A stream-json run prints one event per line. Each stream flag adds one more kind of line.](https://learn.benibix.com/diagrams/flag-stream.svg)

---

Source: https://learn.benibix.com/term/ai/include-hook-events-flag
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
