Review Flow¶
This page walks through what happens when the agent makes a tool call, from the moment Claude Code fires a hook to the moment the reviewer's decision is enforced.
The hook pipeline¶
Zwischen installs hooks for all eight Claude Code hook events:
| Hook | When it fires |
|---|---|
SessionStart |
A new Claude Code session begins |
SubagentStart |
The agent spawns a subagent |
SubagentStop |
A subagent finishes |
PreToolUse |
Before a tool executes |
PostToolUse |
After a tool returns successfully |
PostToolUseFailure |
After a tool returns an error |
UserPromptSubmit |
When you send a message to the agent |
Stop |
When the agent tries to end its turn |
Each hook sends an event to the local daemon, which streams it to the Zwischen server for review.
Pre-execution review¶
Tools in the pre_review and write_review lists are reviewed before they execute. The flow:
- Agent calls a tool (e.g.,
Bashwith a shell command) PreToolUsehook fires- Client sends the tool name and input to the reviewer
- Reviewer evaluates and returns a determination
- If pass: the tool executes normally
- If block: the tool is denied, the agent sees a block message with the reason
For write_review tools (Edit, Write), the reviewer sees the proposed file diff and can reject it before the file is modified.
Post-execution review¶
Tools not in the pre-review lists are reviewed after execution. The PostToolUse hook streams the tool's result to the reviewer. The reviewer can still issue a block at this point — the tool already ran, but the agent will be stopped from taking further actions until the block is resolved.
Stop review¶
When the agent tries to end its turn, the Stop hook fires. The reviewer decides whether the work is actually done. If the reviewer determines the agent stopped too early, it issues a stop block — the agent is forced to continue working, with the reviewer's feedback injected into the session.
Visibility tiers¶
Not every tool call gets the same level of review. The tools configuration in your settings controls what the reviewer can see:
| Tier | What happens |
|---|---|
output_visible |
Reviewer sees the tool's full output |
pre_review |
Reviewed before execution; can be blocked |
write_review |
Like pre_review, but shows the proposed file diff |
whitelisted |
Passed through without blocking, but still streamed as context |
review_exempt |
Completely invisible to the reviewer |
Tools not in any list are streamed to the reviewer with their name and input parameters only — the output is not shown. See Tool Visibility for configuration details.
Event ordering¶
Events are processed in strict FIFO order. The reviewer sees them in the same order the agent produced them. This is enforced by a dedicated worker thread per reviewer session — there is no parallelism in the review pipeline for a given agent.