PostToolUse
A post-execution hook event in Claude Code Hooks that triggers local scripts after the model completes a tool call, commonly used for automatic formatting and syntax checking.
Timeline (last 90 days)
The PostToolUse event is automatically triggered after the model finishes writing or modifying a file each time, and is commonly used for automatic formatting or syntax checking.
In log scenarios, a common practice is to configure a PostToolUse-type hook that first runs a filtering script after a test or build command finishes (such as grep to keep only lines starting with ERROR or FAIL, or tail -n 50 to truncate), and then feeds the processed result into the context.
claude-code-setup suggested a PostToolUse hook for this project: after each edit to files under src/, automatically run npx jest --findRelatedTests to run only the related tests.
The Claude Agent SDK's PreToolUse and PostToolUse hooks, combined with matchers such as Write|Edit, can block, modify, or log tool calls.
PostToolUse triggers after a tool has successfully executed, and Stop triggers when a full round of conversation has completely ended.
All Facts (4)
The PostToolUse event is automatically triggered after the model finishes writing or modifying a file each time, and is commonly used for automatic formatting or syntax checking.
50%UnverifiedIn log scenarios, a common practice is to configure a PostToolUse-type hook that first runs a filtering script after a test or build command finishes (such as grep to keep only lines starting with ERROR or FAIL, or tail -n 50 to truncate), and then feeds the processed result into the context.
50%UnverifiedThe Claude Agent SDK's PreToolUse and PostToolUse hooks, combined with matchers such as Write|Edit, can block, modify, or log tool calls.
50%UnverifiedPostToolUse triggers after a tool has successfully executed, and Stop triggers when a full round of conversation has completely ended.
50%