Hooksdoc/{zh,en}/design/plugins/hooks.md

Hooks: Protocol, Order and Merge

Status: 2026-11-16. Built: everything in sections 1–7 (pkg/plugin/hooks.go, hookpoints.go, rewrite.go; internal/bundle/hooks.go, hookroles.go, hookpoints.go, shared.go; internal/ho

Status: 2026-11-16. Built: everything in sections 1–7 (pkg/plugin/hooks.go, hookpoints.go, rewrite.go; internal/bundle/hooks.go, hookroles.go, hookpoints.go, shared.go; internal/host/engine/hookpoint.go, hooks.go, guards.go, rewrite.go, steps.go, observe.go; internal/host/observed; tests TestHooksMergeAndAsk, TestHooksRunAtOnceAndDedup, TestContextAndStopEvents, TestReviewAndPreCompact, TestFailureAndObserveHooks, TestP2Hooks, TestRewriteFromUpdatedInput, TestHookEventNeedsItsRole, TestHookBudget, TestOperatorLayerGatesFirst, TestGatesRunInParallel, TestHookPluginsRunInUsesOrder, TestRewriteChain, TestRewriteVoidsAnEarlierApproval, TestToolNarrowingAndModelGuards, TestObserverReceivesCommittedFacts, TestStepCheck, TestCommandHooks). Section 8 compares other agents; section 9 lists what is not supported; section 10 maps DSH plugins. This is the reference a plugin author reads to know what a hook receives, what it may answer, and in what order hooks run. The wider extension surface is in extension points; the plugin forms are in the plugin design. The design behind order, layers and the newer hook points is the hook model.

1. Two Kinds of Hook Points

KindDeclared byImplemented asContract
Code rolesroles: in plugin.yamlGo interfaces (builtin plugins) or JSON-RPC methods (process plugins, any language)pkg/plugin/roles.go, pkg/plugin/extensions.go, pkg/plugin/rpc/methods.go
Command hookshooks: in a manifest plugin's plugin.yamlA command that reads JSON on stdin and answers on stdout, in Claude Code's protocolpkg/plugin/hooks.go; run by internal/bundle/hooks.go, mapped to roles in internal/bundle/hookroles.go

The code roles that act as hooks:

RoleMethod (JSON-RPC)WhenPower
guardguard/checkBefore each tool callDeny, or ask for a person's approval
guardguard/check_inputBefore a runtime sees the inputRefuse the run
guardguard/check_resultAfter each tool resultWithhold the result or add a note
guardguard/check_completionOn a final answer (of the agent or a sub-agent), one cut off at the continuation limit or stopped by the provider's filter included (2026-12-05): those can be withheld, not sent back for more workAsk for more work
guard (optional Rewriter)guard/rewriteBefore the gate phase of each tool callReplace the arguments (needs grants: [rewrite], ADR 0005) or refuse the call
guard (optional ToolNarrower)guard/filter_toolsWhen a run lists its toolsRemove tools from the run (never add)
guard (optional ModelGuard)guard/before_model, guard/after_modelAround each model callRefuse the call; rewrite its messages or the response text (rewrite grant)
guard (optional StepGuard)guard/check_stepAfter a settled batch of tool calls, before the next model call; a runtime asks through host/check_stepAdd context, or stop the run
contextcontext/getOnce at run startAdd reference items
reviewerreviewer/reviewOn a call that needs approval, with grants: [review]Approve, deny or escalate to a person
observerobserver/observe, observer/before_compactAfter a fact is committed (section 7); before a session compactionRead; name facts a summary must keep
compactorcompactor/compactWhen a session is compactedWrite the summary
context_processorprocessor/processWhen history is assembledReturn typed edits

A command hook is a code role without code: each event fills exactly one role, and the bundle adapter implements that role's method by running the commands.

2. Events and the Roles They Fill

EventWire name (hook_event_name)RoleRunsMatcher subject
pre_toolPreToolUseguardBefore each tool call, after the agent's own rulesTool name
post_toolPostToolUseguardAfter each tool result, before the model sees itTool name
user_inputUserPromptSubmitguardBefore the runtime sees the input—
stopStopguardOn the agent's final answer—
subagent_stopSubagentStopguardOn a delegated sub-agent's final answer—
session_startSessionStartcontextAt the start of the first run of a session—
pre_compactPreCompactobserverBefore a session compaction (automatic or /compact)—
permission_requestPermissionRequestreviewerWhen a call needs approval, before a person is askedTool name
post_tool_failurePostToolUseFailureguardAfter a failed tool call, instead of post_toolTool name
session_endSessionEndobserverAfter a session closed (fact session.closed)—
post_compactPostCompactobserverAfter a session compaction (fact compaction.done)—
notificationNotificationobserverWhen a question is shown to a person (fact question.asked)—
tool_selectionBeforeToolSelectionguardWhen a run lists its tools—
before_modelBeforeModelguardBefore each model call of the run, including summaries—
after_modelAfterModelguardAfter each settled model response—
after_tool_batchPostToolBatchguardAfter a batch of tool calls is settled, before the next model call—

Wire names follow Claude Code, except BeforeToolSelection, BeforeModel and AfterModel, which follow Gemini CLI. The importer converts Claude Code's PreToolUse, PostToolUse, PostToolUseFailure, UserPromptSubmit, Stop, SubagentStop, SessionStart, SessionEnd, PreCompact, PostCompact, Notification and PermissionRequest.

Validation. The manifest must declare the role each of its hook events fills; otherwise loading fails with manifest <name>: <event> hooks need the <role> role. Every hook needs a known event and a command, match must compile, and on_error is deny or ignore. The importer adds the roles of the events it converts.

3. Declaration

yaml
1name: release-policy
2execution: manifest
3roles: [guard, context, reviewer]
4hooks:
5  - {event: pre_tool, match: "bash|write", command: [python3, "${PLUGIN_ROOT}/pre.py"], timeout: 30s}
6  - {event: session_start, command: [python3, "${PLUGIN_ROOT}/brief.py"]}
7  - {event: permission_request, match: deploy, command: [python3, "${PLUGIN_ROOT}/approve.py"], on_error: ignore}
FieldMeaning
eventOne of section 2
matchFor pre_tool, post_tool, post_tool_failure, permission_request. Empty or * matches every tool; anything else is a regular expression over the whole name, case-insensitive (bash|write). Other events ignore it
commandArgument list, run without a shell; ${PLUGIN_ROOT}, ${PLUGIN_DATA} and ${option.KEY} are expanded
timeoutGo duration; default 10s
on_errordeny (default) or ignore, see section 6

Tool names are the names the model sees: builtin tools by their name (bash, read), MCP tools as <instance>__<tool>. A Claude Code matcher such as mcp__memory__.* does not match them and must be rewritten for the instance id.

Environment. The working directory is the instance's data directory (PLUGIN_DATA), so what a command writes where it runs, a log or a rule file, is no change to the approved plugin files (Feishu #243); a leading ./ in the command names the plugin's own file. The command receives PLUGIN_ROOT, PLUGIN_DATA, CLAUDE_PLUGIN_ROOT, CLAUDE_PLUGIN_DATA, CLAUDE_PROJECT_DIR (the plugin directory), CLAUDE_PLUGIN_OPTION_<KEY> for each option, and the small environment allowlist MCP servers get. policy.mcp_commands limits which executables may run.

4. Payloads and Answers

Every payload carries:

FieldValue
hook_event_nameThe wire name
session_idThe run's session (ss_…); the run id when the run has no session
run_idThe run
transcript_pathAlways "": the session log is not a file a script can read
cwdThe working directory: the instance's data directory
permission_modeAlways "default"

A hook answers in one of three ways:

AnswerMeaning
Exit 0, empty stdout or non-JSON stdoutNo opinion
Exit 0, JSON on stdoutRead as below
Exit 2Block; stderr is the reason (blocked by a <event> hook when empty)
Any other exit, a timeout, or stdout starting with { that is not valid JSONFailure (section 6)

JSON fields read: decision: "block" with reason; hookSpecificOutput.permissionDecision deny / ask / allow with permissionDecisionReason; hookSpecificOutput.additionalContext; for permission_request, hookSpecificOutput.decision.behavior allow / deny with message; hookSpecificOutput.updatedInput (pre_tool), allowedTools (tool_selection), updatedMessages (before_model) and updatedResponse (after_model). Within one plugin the last rewrite in manifest order wins. Other fields are ignored.

4.1 Per event

EventOwn payload fieldsBlock / denyAskAllowadditionalContext
pre_tooltool_name, tool_input, tool_use_idThe call is refused; the reason goes to the modelThe call needs a person's approval; the reason goes to the approverNo opinion (cannot relax another decision); updatedInput replaces the arguments with the rewrite grantNote on this call's result
post_toolas pre_tool, plus tool_response: {content, is_error}The reason is added as a note (the result is not withheld)——Note on the result
user_inputpromptThe run is refused (input.denied)Refused too: there is no call to approve—Context item of this run (needs the context role): reference, or instruction from the operator layer
stopprompt, last_assistant_message, stop_hook_active (true from round 2)The reason is fed back and the agent works moreTreated as block——
subagent_stopas stop, plus agent_type (the sub-agent's name)As stop, for the sub-agentTreated as block——
session_startsource: startup (first session or after a pause) or clear (after /new)———Context item of this run: reference, or instruction from the operator layer
pre_compacttrigger: auto or manual; custom_instructions: ""Not possible: compaction always proceeds——Each line is a fact the summary must keep
permission_requesttool_name, tool_input, tool_use_idDenied, as by a reviewer—Approved, as by a reviewer—
post_tool_failuretool_name, tool_input, tool_use_id, error (the failed result's text)The reason is added as a note——Note on the result
session_endreason: idle, reset or another close reasonAnswers are ignored——Ignored
post_compacttrigger: autoAnswers are ignored——Ignored
notificationmessage (the question's prompt; empty unless the instance has grants: [conversation], P11), notification_type: permission_prompt (approval) or elicitation_dialogAnswers are ignored——Ignored
tool_selectiontools: the names the run would see——allowedTools lists what this plugin allows; tools outside every list are removed—
before_modelpurpose, messages (the request)The model call is refused (model.denied_by_policy)Treated as blockupdatedMessages replaces the messages, with the rewrite grant—
after_modelpurpose, response: {content, tool_calls, stop_reason} (tool_calls are names)The response is refused (model.denied_by_policy)Treated as blockupdatedResponse replaces the text, with the rewrite grant—
after_tool_batchtool_calls: [{tool_name, tool_use_id, is_error}], agent_type for a sub-agentThe run stops with the reasonTreated as block—Shown to the model before its next call

Feedback from stop and subagent_stop is limited to two rounds per answer (MaxChecks, plugins/agent/loop.go). When a pre_tool hook rewrites the arguments, the same hooks run again in the gate phase on the final arguments; when nothing changed, the gate reuses the first run.

4.2 Examples

json
1// pre_tool, stdin
2{"hook_event_name":"PreToolUse","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","tool_name":"bash","tool_input":{"command":"kubectl apply -f prod.yaml"},"tool_use_id":"tc_3b8e01d2aa"}
3// stdout: ask a person
4{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"ask","permissionDecisionReason":"applies to production","additionalContext":"prod changes need a ticket id"}}
json
1// post_tool, stdin
2{"hook_event_name":"PostToolUse","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","tool_name":"read","tool_input":{"path":"go.mod"},"tool_use_id":"tc_51aa0c9e12","tool_response":{"content":"module example.com/app","is_error":false}}
3// stdout
4{"hookSpecificOutput":{"hookEventName":"PostToolUse","additionalContext":"go.mod is generated; edit tools.go instead"}}
json
1// user_input, stdin
2{"hook_event_name":"UserPromptSubmit","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","prompt":"deploy v2.3 to prod"}
3// stdout: refuse
4{"decision":"block","reason":"deploys are frozen until Monday"}
json
1// stop, stdin
2{"hook_event_name":"Stop","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","prompt":"summarize the incident","last_assistant_message":"The outage was caused by…","stop_hook_active":false}
3// stdout: ask for more work
4{"decision":"block","reason":"add a line with the incident ticket"}
json
1// subagent_stop, stdin
2{"hook_event_name":"SubagentStop","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","prompt":"find the failing test","last_assistant_message":"TestLogin fails","stop_hook_active":false,"agent_type":"explorer"}
3// stdout: accept
4{}
json
1// session_start, stdin
2{"hook_event_name":"SessionStart","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","source":"startup"}
3// stdout
4{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":"On-call this week: Li Wei"}}
json
1// pre_compact, stdin
2{"hook_event_name":"PreCompact","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","trigger":"manual","custom_instructions":""}
3// stdout: two facts to keep
4{"hookSpecificOutput":{"hookEventName":"PreCompact","additionalContext":"Release branch is release/2.3\nTicket OPS-4411 is open"}}
json
1// permission_request, stdin
2{"hook_event_name":"PermissionRequest","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","tool_name":"deploy","tool_input":{"env":"staging"},"tool_use_id":"tc_9d02e7b4c1"}
3// stdout: approve
4{"hookSpecificOutput":{"hookEventName":"PermissionRequest","decision":{"behavior":"allow"}}}
json
1// pre_tool, stdin (rewrite)
2{"hook_event_name":"PreToolUse","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","tool_name":"write","tool_input":{"path":"/etc/hosts","content":"x"},"tool_use_id":"tc_77e0a1c2b9"}
3// stdout: rewrite (needs grants: [rewrite])
4{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow","updatedInput":{"path":"workspace/hosts","content":"x"}}}
json
1// post_tool_failure, stdin
2{"hook_event_name":"PostToolUseFailure","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","tool_name":"bash","tool_input":{"command":"go test ./..."},"tool_use_id":"tc_2c90d1e4f0","error":"exit status 1"}
3// stdout
4{"hookSpecificOutput":{"hookEventName":"PostToolUseFailure","additionalContext":"run make generate before the tests"}}
json
1// session_end, stdin
2{"hook_event_name":"SessionEnd","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","reason":"idle"}
3// stdout: ignored
4{}
json
1// post_compact, stdin
2{"hook_event_name":"PostCompact","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","trigger":"auto"}
3// stdout: ignored
4{}
json
1// notification, stdin
2{"hook_event_name":"Notification","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","message":"Allow deploy with {\"env\":\"prod\"}?","notification_type":"permission_prompt"}
3// stdout: ignored
4{}
json
1// tool_selection, stdin
2{"hook_event_name":"BeforeToolSelection","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","tools":["read","grep","bash","write"]}
3// stdout: no shell or writes here
4{"hookSpecificOutput":{"hookEventName":"BeforeToolSelection","allowedTools":["read","grep"]}}
json
1// before_model, stdin
2{"hook_event_name":"BeforeModel","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","purpose":"","messages":[{"role":"user","content":"my token is sk-123"}]}
3// stdout: redact (needs grants: [rewrite])
4{"hookSpecificOutput":{"hookEventName":"BeforeModel","updatedMessages":[{"role":"user","content":"my token is [redacted]"}]}}
json
1// after_model, stdin
2{"hook_event_name":"AfterModel","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","purpose":"","response":{"content":"Done.","tool_calls":null,"stop_reason":"end_turn"}}
3// stdout: rewrite the text (needs grants: [rewrite])
4{"hookSpecificOutput":{"hookEventName":"AfterModel","updatedResponse":"Done. (reviewed)"}}
json
1// after_tool_batch, stdin
2{"hook_event_name":"PostToolBatch","session_id":"ss_7f2a","run_id":"rn_91c4","transcript_path":"","cwd":"/plugins/release-policy","permission_mode":"default","tool_calls":[{"tool_name":"write","tool_use_id":"tc_5a1f9e0b37","is_error":false}]}
3// stdout: context for the next model call; {"decision":"block","reason":"…"} would stop the run
4{"hookSpecificOutput":{"hookEventName":"PostToolBatch","additionalContext":"run the tests before the next edit"}}

5. Order and Merge (normative)

Within one instance. All hooks of the event whose matcher matches run at once, on the same input; none is skipped because another blocked. Identical hooks (same event, matcher, expanded command and options) run once, also across instances asked for the same input (internal/bundle/shared.go). Their answers merge in manifest order:

  • ◆Verdicts: deny (block) > ask > allow > no opinion. The strictest wins.
  • ◆Reasons: those of the strictest verdict are kept, in order, joined with "; ".
  • ◆additionalContext: every hook's, in hook order, joined with newlines.

Across instances: two layers (hook model section 3). First the operator layer, the instances in policy.hooks of the Host configuration, which every runtime asks whether or not it uses them; then the runtime layer, the instances in the runtime's uses (for tool calls, those of every instance in the call chain), each once. policy.hooks_only: true asks the operator layer only. Inside a layer every instance is asked at once; answers are combined in declared order (policy.hooks order, then uses order). For gates (guard, input guard, reviewer) a layer that denies ends the point: the next layer is not asked. Context from the operator layer reaches the model as instructions (<orq:operator>); context from the runtime layer stays reference material (<orq:reference>).

PointMerge
Guards (check)Any deny denies; every ask is collected and the call needs approval by the strictest approver; nothing relaxes a deny
Result guardsAny withhold withholds; notes are appended in order
Input guardsAny deny or ask refuses the run
Completion guardsAll feedback is collected
Reviewers (granted only)Any deny denies; approval needs every reviewer to approve; anything else goes to a person
Context providersItems in uses order
CompactorsTried in the configured order; the first success wins
Context processorsApplied in uses order
Observers, before_compactIndependent; facts to keep are collected
Rewriters (guard/rewrite)A chain, not parallel: the runtime layer in uses order (every instance in the call chain), then the operator layer last, each on the previous arguments; only instances with grants: [rewrite] change them; then the final arguments are schema-checked, gated and approved (ADR 0005)
Tool filters (guard/filter_tools)The run keeps the tools every filter allows (intersection); a filter cannot add
Model guards (guard/before_model, after_model)A chain like rewriters; any deny refuses the call; rewrites need the grant
Step guards (guard/check_step)Context collected in declared order; any stop stops the run

No priority field. Because every merge is strictest-wins or collect-all, order never changes a verdict; it only orders notes and context, and authority comes from the layer. Claude Code, Codex, Kimi and Crush also run matching hooks in parallel; nine of ten reviewed agents have no priority field (review).

6. Timeouts and Failure

Timeouts. Each hook has its own timeout (default 10 s). The Host bounds each instance's role call by the larger of its own default and that instance's longest hook timeout for the event plus one second (hookBudget, internal/host/engine/guards.go), so a declared timeout always holds; hooks run at once, so the longest one counts. policy.hook_budget (default 60 s) caps a whole hook point.

Role callHost default
context/get (session_start)5 s
guard/check (pre_tool)5 s
guard/check_input, check_result, check_completion10 s
reviewer/review (permission_request)30 s
observer/before_compact (pre_compact)30 s
guard/rewrite (pre_tool rewrites)5 s
guard/filter_tools, before_model, after_model, check_step10 s
observer/observe (session_end, post_compact, notification)2 min

Failure. A hook that cannot start, exits with a code other than 0 or 2, times out, or prints invalid JSON has failed:

  • ◆on_error: deny (default): it counts as a block whose reason names the hook (the pre_tool hook 2 of release-policy could not run). Native hooks fail closed.
  • ◆on_error: ignore: it has no opinion; the failure is logged (hook.failed).

Hooks imported from Claude Code or Codex packages get ignore, matching those tools, where a failing hook does not block.

A role call that fails as a whole follows the role's rule: guards deny, input guards refuse, result guards withhold, completion checks are skipped, reviewers escalate, context is omitted, observers are retried; rewriters and model guards refuse the call (fail closed); tool filters and step guards are skipped and logged. Inside a plugin, a failing after_tool_batch hook with on_error: deny counts as a block, so it stops the run.

7. Where Hook Output Goes

OutputReachesHeld where
pre_tool blockThe model, as the refused call's result—
pre_tool context (not blocked)Note on that call's resultBundle memory keyed by run and call, until the result; at most 256 held
post_tool context and block reasonNote on the result—
user_input contextContext item of that run: <orq:reference>, or <orq:operator> from the operator layerBundle memory keyed by run, read by context/get; never read if the plugin lacks the context role
session_start contextContext item of the session's first run, as for user_input—
stop / subagent_stop blockFeedback that asks for more work—
pre_compact context linesFacts the summary must keep—
permission_request verdictThe approval—
pre_tool updatedInput (rewrite grant)The arguments the call runs with; the model's result ends with a note naming who changed themThe ledger keeps the model's arguments; the final ones go to the log (tool.rewritten)
post_tool_failure context and block reasonNote on the failed result—
session_end, post_compact, notification answersNowhere: these hooks observe—
tool_selection allowedToolsThe run's tool list; a removed tool is refused if called (Tool … is not available in this task.)Host memory of the run
before_model / after_model blockThe model call fails with model.denied_by_policy, which fails the run—
before_model updatedMessages, after_model updatedResponseThe request sent, or the response the runtime gets—
after_tool_batch contextBefore the next model call: <orq:reminder kind="step">, or <orq:operator> from the operator layerThe run's checkpoint
after_tool_batch blockThe run ends with Stopped by the operator's policy: <reason>—

Observed facts. session_end, post_compact and notification run from the observer pipeline. The Host appends each committed fact to the observed_events log in the transaction that commits it (internal/host/observed): run.finished, session.opened, session.closed, tool.finished, question.asked, question.settled, compaction.done, delivery.sent, delivery.failed (pkg/plugin/decisions.go). Each observer reads the log from its own durable cursor (observer_cursors.seq), so it gets every fact at least once and in order; a new observer starts at the end of the log. An observer sees the facts of the runtimes that use it; one in policy.hooks sees every runtime's. Either way only the facts of runs its scope (and works_with, owner) covers, as for its other calls; user.forgotten, of no run, reaches it regardless (Feishu #383). A session.closed fact names the person its session.opened named, so a scope that covers one covers the other (Feishu #400). Observers ignore types they do not use.

8. Compared With Other Agents

Claude CodeCodexDSH (hooks-claude-code over hook-protocol)Orquelo
Events30PreToolUse, PostToolUse, UserPromptSubmit, Stop, PermissionRequest and others (codex-source review)7: SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SubagentStart, SubagentStop16 (section 2)
Handler typescommand, http, prompt, agent, mcp_toolcommand; executor hooks call MCP toolscommand onlycommand only
OrderParallel, identical handlers deduplicatedNot reviewedSerial, config orderParallel within a plugin and within a layer; operator layer, then runtime layer; identical hooks run once; rewrites chain
MergeDeny winsNot revieweddeny > ask > allow; context in order; first continue:false stickydeny > ask > allow; context in order
FailureNon-blocking (exit ≠ 2)Not reviewedNon-blockingPer hook: deny (default) or ignore; imported hooks ignore
Default timeout600 sNot reviewed600 s10 s, Host bound grows with it
Argument rewriteupdatedInputPreToolUse can change argumentsParsed, not honoredupdatedInput from pre_tool, only for instances with grants: [rewrite]; a deterministic chain, then schema check, gates and approval on the final arguments (ADR 0005)
ShellYesYesVia its shell executorNo; commands needing one are refused at import

Sources: the compatibility and Codex reviews; the DSH hook-protocol and hooks-claude-code READMEs read from deepseek-ai/deepseek-harness master on 2026-11-16.

9. Not Supported

ItemWhy
updatedMCPToolOutputNot read. updatedToolOutput is built: a post_tool or post_tool_failure hook of an instance with grants: [rewrite] replaces the result's text (a string, or an object with content); rewrites chain, the runtime layer first and the operator last, before result guards; a failing rewriter withholds the result; the model is told who changed it (guard/rewrite_result, ADR 0005)
http, prompt, agent, mcp_tool hook typesAn HTTP or model-backed check is a process plugin with the guard or reviewer role; the importer leaves these out with a note
continue: false, stopReason, systemMessage, suppressOutputNo run-level halt from a hook; cancelling a run is a person's or operator's action
PreCompact vetoVetoing compaction ends in context overflow; a hook only names facts to keep
Blocking from session_end, post_compact or notificationThey run after the fact is committed, from the observer pipeline; their answers are ignored
Other Claude Code events (Setup, InstructionsLoaded, UserPromptExpansion, MessageDisplay, PostToolBatch, PermissionDenied, TaskCreated, TaskCompleted, StopFailure, TeammateIdle, ConfigChange, CwdChanged, FileChanged, WorktreeCreate, WorktreeRemove, Elicitation, ElicitationResult, SubagentStart)Left out by the importer with a note (after_tool_batch is native only: its wire name matches PostToolBatch, but the importer does not map it). Committed facts reach observer plugins through the observed facts (section 7)
A readable transcripttranscript_path is empty; a hook that needs history is a process plugin calling host/session_entries

10. DSH Plugins Mapped to v2

DSH pluginWhat it doesv2 routeStatus
hooks-claude-code, hooks-codex, hook-protocolRun existing hooks.json command hooksImport the package (orquelo plugin install); hooks become command hooks of a manifest pluginBuilt
mcp-client, mcp-managerConnect MCP servers, manage themmcp_servers of a manifest plugin; orquelo plugins -c shows each server's statusBuilt
mcp-resourcesMCP resourcesResources and promptsPartly built (B8; internal/bundle/resources.go, prompts.go)
skill, skill-filesystem, skill-officeSkills from directories; office document skillsskills: of a manifest plugin (Agent Skills layout); office skills install as skills, their tools come from localenv or a tool pluginBuilt (skills); office tools not provided
guard/repeat-tool-reminderRemind on repeated tool callsLoop guard inside the agent (plugins/agent/loopguard)Built
guard/timeout-policyTime limits per toolcall_timeout of an instance; run timeouts of the HostBuilt
browser-use-*Browser control through MCP or native driversThe agent-browser CLI and its own guide, driven through the shell; the agent-browser plugin declares it (P87 S6). An MCP server such as @playwright/mcp also runs as a manifest plugin; exclusive use of one browser by one run is B17Built; exclusivity not built
computer-use-*, cua-*Desktop controlA tool plugin with platforms: [darwin]Not built
subagent, tool-subagent-oarDelegate to child agentsdelegate tool with subagents in the agent config (P8)Built (config-defined); plugin-supplied agents not built (B13)
plugin-market-bundleInstall from plugin indexesorquelo plugin install from a catalog name, a directory, git+URL#commit or an https archive with sha256Built; no index or marketplace
web-fetch-http, tool-webBounded HTTP fetch toolwebfetch builtin plugin (host allowlist, named connections)Built
session-persistence-jsonlSession log storageThe Host's session store (P49); not a plugin roleBuilt (in the Host)
todo, plan, goalTask lists and planstodo builtin tool of the agenttodo built; plan and goal not built
schedule, jobs, workflowTimed runs, background jobs, workflowsLong tools with Pending polling; background shell jobs in localenv; a scheduler or workflow is a trigger or runtime pluginJobs built; schedule and workflow not built