Search the documentation
23 pages for posttooluse.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
migration
Claude Developer Platform · in the page
managed-agents/migration
…| | `PreToolUse` / `PostToolUse` hooks | Your client already sees every `agent.custom_tool_use` event before responding; put the logic there. For buil…
How the agent loop works
Claude Code CLI · in the page
agent-sdk/agent-loop
…ecutes | Validate inputs, block dangerous commands | | `PostToolUse` | After a tool returns | Audit outputs, trigger side effects | | `UserPrompt…
Intercept and control agent behavior with hooks
Claude Code CLI · in the page
agent-sdk/hooks
…tool is about to be called (`PreToolUse`), a tool returned a result (`PostToolUse`), a subagent started or stopped, the agent is idle, or execution finished. See the [full list of events](#available-h…
Agent SDK reference - Python
Claude Code CLI · in the page
agent-sdk/python
…ent = Literal[ "PreToolUse", # Called before tool execution "PostToolUse", # Called after tool execution "PostToolUseFailure", # Called when a tool execution fails "UserPromptSubmit…
Agent SDK reference - TypeScript
Claude Code CLI · in the page
agent-sdk/typescript
…as this message, with each line prefixed by the hook's name, such as `PostToolUse:Bash says:`. Whether a hook's `systemMessage` arrives as this message depends on the event. Each [event's section](/do…
Claude Code changelog
Claude Code CLI · in the page
changelog
…et the session title in auto mode * Fixed focus mode showing "Ran N PostToolUse hooks" timing lines under each response </Update> <Update label="2.1.181" description="June 17, 2026"> * Added `/co…
Claude apps gateway configuration
Claude Code CLI · in the page
claude-apps-gateway-config
…must exist on every client OS in the policy. hooks: PostToolUse: - matcher: "Edit|Write" hooks: - { type: command, command: /usr/local/bin/a…
Explore the .claude directory
Claude Code CLI · in the page
claude-directory
…], "deny": [ "Bash(rm -rf *)" ] }, "hooks": { "PostToolUse": [{ "matcher": "Edit|Write", "hooks": [{ "type": "command", "command": "jq -r '.tool_inpu…
Explore the context window
Claude Code CLI · in the page
context-window
…tokens: 120, color: '#B8860B', vis: 'hidden', desc: 'A PostToolUse hook in `settings.json` runs prettier after every file edit and reports back via `hookSpecificOutput.additionalContext…
Extend Claude Code
Claude Code CLI · in the page
features-overview
…ggered by** | [Lifecycle events](/docs/en/hooks#hook-events) such as `PostToolUse` or `SessionStart` | You typing `/<name>`, or Claude matching the description to your task | | **Determinism** |…
Hooks reference
Claude Code CLI · in the page
hooks
…lure` * on every tool call inside the agentic loop: `PreToolUse` and `PostToolUse`, except [`EndConversation`](/docs/en/tools-reference#endconversation-tool-behavior) calls, which skip both <div styl…
Automate actions with hooks
Claude Code CLI · in the page
hooks-guide
…ks` object: ```json theme={null} { "hooks": { "PostToolUse": [ { "matcher": "Edit|Write", "hooks": [{ "type": "command", "command": "jq -r '.to…
Monitoring
Claude Code CLI · in the page
monitoring-usage
…session * `hook_event`: hook event type, such as `"PreToolUse"` or `"PostToolUse"` * `hook_type`: hook implementation type: `"command"`, `"prompt"`, `"mcp_tool"`, `"http"`, or `"agent"` * `hook_sourc…
Choose a permission mode
Claude Code CLI · in the page
permission-modes
…an't manipulate it directly. You can annotate a call's result with a [PostToolUse hook's `classifierContext` field](/docs/en/hooks#annotate-a-result-for-the-auto-mode-classifier), which the classifier…
Create and distribute a plugin marketplace
Claude Code CLI · in the page
plugin-marketplaces
…ty-reviewer.md", "./agents/compliance-checker.md"], "hooks": { "PostToolUse": [ { "matcher": "Write|Edit", "hooks": [ { "type": "command",…
Create plugins
Claude Code CLI · in the page
plugins
…event each hook matches, such as asking Claude to edit a file for a `PostToolUse` hook, and confirm its effect. Claude Code records which hooks matched, their exit codes, and their output in the [deb…
Plugins reference
Claude Code CLI · in the page
plugins-reference
…ns **Hook configuration**: ```json theme={null} { "hooks": { "PostToolUse": [ { "matcher": "Write|Edit", "hooks": [ { "type": "command",…
Catch security issues as Claude writes code
Claude Code CLI · in the page
security-guidance
…working-tree baseline that the end-of-turn review diffs against | | `PostToolUse` on `Edit`, `Write`, and `NotebookEdit` | Per-edit pattern match…
Customize sessions in self-hosted environments
Claude Code CLI · in the page
self-hosted-environments-configuration
…on, snapshot periodically from inside the session with a Claude Code `PostToolUse` hook instead. The runner sets: | Variable | Description…
Configure server-managed settings
Claude Code CLI · in the page
server-managed-settings
…ganization: ```json theme={null} { "hooks": { "PostToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "comman…
Create custom subagents
Claude Code CLI · in the page
sub-agents
…hat also fire inside subagents. Tool events such as `PreToolUse` and `PostToolUse` fire for the subagent's tool calls the same way they do in the main conversation, and `SubagentStart` and `SubagentSt…
Week 18 · April 27 – May 1, 2026
Claude Code CLI · in the page
whats-new/2026-w18
…an find a skill in a long list without scrolling</div> <div><code>PostToolUse</code> hooks can replace tool output for any tool via <code>hookSpecificOutput.updatedToolOutput</code>, not only MCP…
Week 20 · May 11–15, 2026
Claude Code CLI · in the page
whats-new/2026-w20
…iv> <div>New <code>continueOnBlock</code> config option for <code>PostToolUse</code> hooks feeds the hook's rejection reason back to Claude and continues the turn instead of ending it</div> <d…