Answer: To configure a hook, pass it in the `hooks` field of your agent options (`ClaudeAgentOptions` in Python, the `options` object in TypeScript), using hook event names like `'PreToolUse'` as keys and arrays of matchers with callback functions as values. For tool calls, the `matcher` field matches against the tool name, such as `Bash`. Status: Confirmed Entry: tool/claude-code/agents-and-automation/configure-hooks Revision: 3 Digest: sha256:82ae7c5edcb54a6b (changes whenever the content changes) Timeline: Created: 2026-11-13T03:02:44Z Last changed: 2026-11-20T12:16:37Z (Example tool matcher: — → Bash) Last verified: 2026-11-20T12:16:37Z Next check: 2026-11-21T12:16:37Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Configuration field | hooks | [1] | 2026-11-20 Python options class | ClaudeAgentOptions | [1] | 2026-11-20 Hook event key example | PreToolUse | [1] | 2026-11-20 Matcher field | matcher | [1] | 2026-11-20 Tool hook match target | tool name | [1] | 2026-11-20 Example tool matcher | Bash | [1] | 2026-11-20 onFailure option | onFailure | [1] | 2026-11-20 Sources: [1] Anthropic. "Intercept and control agent behavior with hooks". https://code.claude.com/docs/en/agent-sdk/hooks.md Role: primary. Accessed: 2026-11-20T12:16:37Z Quote: "To configure a hook, pass it in the `hooks` field of your agent options" (Supports: Configuration field) Quote: "(`ClaudeAgentOptions` in Python, the `options` object in TypeScript)" (Supports: Python options class) Quote: "**Keys**: [hook event names](#available-hooks) such as `'PreToolUse'`, `'PostToolUse'`, and `'Stop'`" (Supports: Hook event key example) Quote: "| `matcher` | `string` | `undefined` | Pattern matched against the event's filter field" (Supports: Matcher field) Quote: "For tool hooks, that field is the tool name." (Supports: Tool hook match target) Quote: "With a `'Bash'` matcher, your callbacks run for Bash commands." (Supports: Example tool matcher) Quote: "| `onFailure` | `"continue" \| "block"` | `undefined` | What a failed callback does." (Supports: onFailure option) Published: 2026-11-20T03:48:55Z Snapshot SHA-256: 0b2c9a218508ae08aa03a1d9bfe5916d39a56028c80699d2264a63c27a851f84 (captured 2026-11-20T12:16:38Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:16:37Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:16:37Z Last attempt: 2026-11-20T12:16:37Z Notes and limitations: Extracted automatically from a single official source (section "Configure hooks"). Related: https://latestn.com/tool/claude-code/agents-and-automation/configure-tool-search How do I configure tool search in Claude Code? https://latestn.com/tool/claude-code/agents-and-automation/continue-conversations How do I continue a conversation when running Claude Code programmatically? https://latestn.com/tool/claude-code/agents-and-automation/control-turns-and-budget How do I control how many turns or budget a Claude Code agent loop runs? https://latestn.com/tool/claude-code/agents-and-automation/choose-hook-type-sdk When should I use which hook type in the Claude Code SDK? https://latestn.com/tool/claude-code/agents-and-automation/claude-write-save-workflow How do I have Claude write and save a workflow in Claude Code? https://latestn.com/tool/claude-code/agents-and-automation/claudesdkclient-interrupts How do I interrupt a running Claude Code session with ClaudeSDKClient in Python? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T12:16:37Z | changed | Example tool matcher: — → Bash | [1] 2026-11-20T12:16:37Z | changed | Tool hook match target: — → tool name | [1] 2026-11-20T12:16:37Z | changed | Example matcher value: Bash → — | [1] 2026-11-19T12:12:25Z | changed | onFailure option: — → onFailure | [1] 2026-11-19T12:12:25Z | changed | Example matcher value: — → Bash | [1] 2026-11-19T12:12:25Z | changed | Matcher field: — → matcher | [1] 2026-11-19T12:12:25Z | changed | onFailure block option: onFailure: "block" → — | [1] 2026-11-19T12:12:25Z | changed | Matcher for tool hooks: Bash → — | [1] 2026-11-13T03:02:44Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/agents-and-automation/configure-hooks/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/agents-and-automation/configure-hooks POST: https://latestn.com/dispute/tool/claude-code/agents-and-automation/configure-hooks with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/agents-and-automation/configure-hooks?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I configure hooks in Claude Code to intercept tool calls? Revision 3, last verified 2026-11-20T12:16:37Z. https://latestn.com/tool/claude-code/agents-and-automation/configure-hooks (accessed 2026-11-21T10:02:07Z). @misc{LatestN_tool_claude_code_agents_and_automation_configure_hooks_r3, title = {How do I configure hooks in Claude Code to intercept tool calls?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/configure-hooks}}, note = {Revision 3; digest sha256:82ae7c5edcb54a6b; last verified 2026-11-20T12:16:37Z; accessed 2026-11-21T10:02:07Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/agents-and-automation/configure-hooks