| title | description | category | tags | last_updated | difficulty | estimated_time | author | status | audience | prerequisites | related_docs | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Claude Code Tools by Hook Event Type |
Comprehensive mapping of Claude Code tools to their interceptable hook events, organized by hook type for quick reference |
reference |
|
2025-01-18 |
intermediate |
15 minutes |
Claude Code Team |
published |
|
|
|
This document maps every official Claude Code tool to the hook events that can intercept or observe them. It's organized by hook type so you can quickly see which tools will trigger each hook.
Source of truth for the tool list: Settings → Tools available to Claude.
Hooks behavior and matchers: Hooks reference.
- PreToolUse — Tools intercepted before execution
- PostToolUse — Tools observed after success
- Notification — Tools that emit permission prompts
- SubagentStop — Tools that end subagents
- Hooks that don't target tools
- Notes on MCP tools & matching
- Appendix: Full tool roster & permissions
PreToolUse runs after Claude forms the tool parameters but before the tool is executed.
It can block, ask, or allow a call via hook output, and supports tool-name matchers.
Interceptable tools:
- Bash
- Edit
- Glob
- Grep
- LS
- MultiEdit
- NotebookEdit
- NotebookRead
- Read
- Task
- TodoWrite
- WebFetch
- WebSearch
- Write
Also matches any MCP-provided tool (see Notes).
PostToolUse fires immediately after a tool completes successfully.
It receives the tool’s input and output to validate, log, or provide feedback to Claude.
Observable tools: (same coverage as PreToolUse)
- Bash
- Edit
- Glob
- Grep
- LS
- MultiEdit
- NotebookEdit
- NotebookRead
- Read
- Task
- TodoWrite
- WebFetch
- WebSearch
- Write
Also matches any MCP-provided tool (see Notes).
Notification hooks run when Claude Code needs your permission to use a tool (and on some idle cases).
These tools are marked Permission Required = Yes in the official table and therefore can trigger a permission Notification on first use or when rules require it:
- Bash — Yes
- Edit — Yes
- MultiEdit — Yes
- NotebookEdit — Yes
- WebFetch — Yes
- WebSearch — Yes
- Write — Yes
Tools with Permission Required = No (e.g., Read, LS, Grep, Glob, NotebookRead, Task, TodoWrite) generally do not prompt for permission by default, though your permissions rules can still force confirmations.
SubagentStop runs when a sub-agent finishes. Today, subagents are created via:
- Task — Runs a sub-agent to handle complex, multi‑step tasks.
When that subagent completes, SubagentStop fires (independent of any Pre/PostToolUse hooks around the Task call).
The following hooks do not match tool names and therefore don’t have a tool list:
- UserPromptSubmit — Fires when the user submits a prompt (pre‑processing).
- Stop — Fires when the main agent finishes its reply (not user‑interrupt).
- PreCompact — Fires right before conversation compaction (
manual/auto). - SessionStart — Fires at session start or resume.
- MCP tools appear with the naming pattern:
mcp__<server>__<tool>(e.g.,mcp__filesystem__read_file,mcp__github__search_repositories). - PreToolUse/PostToolUse support
matcherpatterns: exact names (Write), regex (Edit|Write|Notebook.*), or wildcard (*). - To target MCP tools, match their
mcp__…names (e.g.,mcp__.*__write.*to catch writes from any MCP server).
| Tool | Description | Permission Required |
|---|---|---|
| Bash | Executes shell commands in your environment | Yes |
| Edit | Makes targeted edits to specific files | Yes |
| Glob | Finds files based on pattern matching | No |
| Grep | Searches for patterns in file contents | No |
| LS | Lists files and directories | No |
| MultiEdit | Performs multiple edits on a single file atomically | Yes |
| NotebookEdit | Modifies Jupyter notebook cells | Yes |
| NotebookRead | Reads and displays Jupyter notebook contents | No |
| Read | Reads the contents of files | No |
| Task | Runs a sub-agent to handle complex multi-step tasks | No |
| TodoWrite | Creates and manages structured task lists | No |
| WebFetch | Fetches content from a specified URL | Yes |
| WebSearch | Performs web searches with domain filtering | Yes |
| Write | Creates or overwrites files | Yes |
-
Tools list & permissions — Claude Code → Settings → Tools available to Claude
https://docs.anthropic.com/en/docs/claude-code/settings#tools-available-to-claude -
Hook events & matchers — Claude Code → Hooks reference
https://docs.anthropic.com/en/docs/claude-code/hooks