Claude Code Hooks vs MCP: When to Use Each
Claude Code hooks vs MCP is a design choice you face as soon as you want to connect Claude Code to another system. Both extend the agent. They differ in who is in control. A hook is run by the harness at a fixed point in the session, whether or not the model wants it. An MCP tool is run when the model decides to call it. Pick the wrong one and you get either a rule the model can ignore or a rigid script where judgment was needed. This article compares them from Anthropic's documentation and shows how one product, Forkit, uses both.
What Claude Code hooks are
Hooks are commands (or HTTP calls, or MCP tool calls) that Claude Code runs when a lifecycle event fires. The docs list more than thirty events. The ones used most:
SessionStartandSessionEnd: a session begins or ends.UserPromptSubmit: a prompt is submitted, before Claude processes it.PreToolUse: before a tool call executes. It can block the call.PermissionRequest: when a tool call needs a permission decision.PostToolUse: after a tool call succeeds.Stop: when Claude finishes responding. A hook can make it continue.Notification,SubagentStart,SubagentStop,PreCompactand others.
A hook receives JSON describing the event and can return JSON that changes what happens. A PreToolUse hook can return a permission decision of allow, deny, ask or defer, with a reason. A PermissionRequest hook can allow or deny. A Stop hook can return decision: "block" with a reason, and Claude carries on. Several events accept additionalContext, text that is added to what the model sees.
The docs give a default timeout of 600 seconds for command hooks, shorter on a few events.
The property that matters: the model does not choose whether a hook runs.
What MCP is
The Model Context Protocol lets Claude Code connect to servers that offer tools. An MCP server lists tools with names, descriptions and parameter schemas. Claude reads the descriptions and decides when to call one. Tool calls go through the same permission system as built-in tools, and they pass through PreToolUse and PostToolUse hooks like any other tool.
The property that matters: the model chooses whether and when to call a tool, and with what arguments.
Claude Code hooks vs MCP compared
| Hooks | MCP tools | |
|---|---|---|
| Who triggers | The harness, on an event | The model, when it judges it useful |
| Guaranteed to run | Yes, if configured | No |
| Can block an action | Yes (PreToolUse, PermissionRequest) |
No; a tool only does what it is called for |
| Can add context for the model | Yes, on several events | Yes, as a tool result |
| Needs the model's cooperation | No | Yes |
| Costs tokens | Only for context it adds | Tool definitions and results |
| Arguments | Fixed event payload | Whatever the model writes |
| Good for | Policy, capture, enforcement | Capabilities that need judgment |
| Works for other agents | Hook systems differ per agent | Any MCP client |
When hooks are the better choice
Use a hook when something must happen every time, or must never happen:
- Enforcement. Block edits to protected files, refuse a command pattern. The docs note that a blocking hook takes precedence over allow rules.
- Passive capture. Recording which commands ran and which files changed. If you ask the model to report its own activity through a tool, it will sometimes forget, and its report is a summary. A
PostToolUsehook sees every call. - Routing permission prompts. Only a
PermissionRequesthook sits at the point where the prompt would appear. - Injecting information at the right moment. A message that arrived while the agent was working can be added after its next tool call.
- Keeping the agent going. A
Stophook can hand the agent a reply and continue the turn.
When MCP is the better choice
Use an MCP tool when the action depends on the model's judgment:
- Asking a question. Only the model knows when it is unsure and what the options are.
- Fetching what it needs. Reading a task list, looking up a thread, searching.
- Deliberate coordination. Claiming a task, sending a handoff with a written summary, requesting review.
- Portability. An MCP server works with any client that speaks the protocol. Hooks are specific to each agent.
The two failure modes
Policy as a tool. "Before running migrations, call check_permission." The model will usually comply. Usually is not a policy. Anything the model can skip, it will eventually skip, and a prompt injection can talk it out of calling the tool at all.
Judgment as a hook. A hook that tries to decide, from a fixed payload, whether the agent's plan is sensible. Hooks see events, not reasoning. They are good at "is this command on the list" and poor at "is this the right approach".
A quick test: if the sentence starts with "always" or "never", it is a hook. If it starts with "when it makes sense", it is a tool.
How Forkit uses both
Forkit's Claude Code integration is a set of hooks plus an MCP server, and the split follows the rule above.
Through hooks (things that must not depend on the model):
PermissionRequestsends the request to Forkit and waits for a rule, an orchestrator or a person.PostToolUsereports each shell command and each edited file path. This is passive capture: one session becomes one thread without the agent doing anything.PreToolUsechecks file claims before an edit and denies an edit under another agent's exclusive claim.UserPromptSubmit,Stop,SessionStartandSessionEndreport the turn's state, and deliver a person's reply or another agent's message as added context.
Through MCP (things only the model can decide):
- Ask a question with up to five one-click answers and wait with
wait_for_reply. - Post a one-line status, request a review, send a typed message, claim paths.
- Find ready tasks, claim one, wait for the next.
The identity of the caller comes from the API key in both paths, never from tool arguments, so the model cannot claim to be someone else.
A privacy setting covers the capture side: full mode sends prompts, commands and the final reply; minimal mode sends only file paths, states and git refs; off sends nothing.
Agents without hooks
Not every agent has a hook system. For those, Forkit offers forkit run -- <command>, which wraps any CLI and reports the session, and forkit ask -- <command>, which asks permission and returns an exit code. Agents connected only this way cannot receive messages mid-run, which shows what hooks buy you: a way in, not only a way out.
Codex has its own hooks with similar events. See the Codex hooks guide. For the hook that matters most to approvals, see what the PermissionRequest hook does, and for the protocol side, what is an MCP server.
Where Forkit fits
Forkit is a worked example of using hooks for what must always happen and MCP for what the agent decides. npx forkit-cli init installs both. It is free to try. More at forkit-mcp.com.
Sources
Read on 16 Nov 2026: