For AI agents: the complete documentation index is available at https://scriptedalchemy.github.io/agent-bundle/zh/llms.txt, the full documentation bundle is available at https://scriptedalchemy.github.io/agent-bundle/zh/llms-full.txt, and this page is available as Markdown at https://scriptedalchemy.github.io/agent-bundle/zh/reference/events.md.
跳至主要内容
  • 简体中文
  • 事件与钩子矩阵

    生成页面

    本页在文档构建时由固定版本的宿主能力表 amp-0.0.0-20260907001852-gf348fed.json、claude-2.1.260.json、codex-0.147.0.json、cursor-2026-08-28.json、portable-1.0.0.json 渲染而成。这些 JSON 文件是每个目标适配器编译时依赖的唯一事实来源;请修改它们而不是本页。表格内容保留英文原文。

    src/events/** 下的事件路由与配置声明的 hooks 都基于同一组按宿主固定的表编译。规范事件会降级为此处列出的宿主原生事件。不具备该事件的宿主没有可降级的目标,因此仍然选中该宿主的路由或 hook 会让构建失败(<target>.hook.event.*,显式配置 hook 目标则为 AB4204):请通过路由的 config.targets 或 hook 的 targets 排除该宿主。未显式声明 targets 的配置 hook 只继承所选宿主中支持 hook 的那些,因此不受支持的宿主会在那里被跳过且不产生诊断。每个不可用单元格都记录其原因,而非推断。Amp 事件单元格来自固定版本 PluginAPI 的契约核对;现场派发仍为 runtime-unverified。

    规范事件路由

    行是 src/events/<family>/*.tsx 路由可以声明的规范事件族;列是固定宿主。单元格给出该路由降级到的原生事件。

    规范事件amp 0.0.1788739286-gf348feclaude 2.1.260codex 0.147.0cursor 2026-08-28portable 1.0.0
    agent/idleunavailableTeammateIdleunavailableunavailableunavailable
    agent/startunavailableSubagentStartSubagentStartsubagentStart (cloud: supported; desktop: supported)unavailable
    agent/stopunavailableSubagentStopSubagentStopsubagentStop (cloud: supported; desktop: supported)unavailable
    compact/afterunavailablePostCompactPostCompactunavailableunavailable
    compact/beforeunavailablePreCompactPreCompactpreCompact (cloud: supported; desktop: supported)unavailable
    config/changeunavailableConfigChangeunavailableunavailableunavailable
    file/changeunavailableFileChangedunavailableunavailableunavailable
    model-switch/afterunavailablePostModelSwitchunavailableunavailableunavailable
    model-switch/beforeunavailablePreModelSwitchunavailableunavailableunavailable
    permission/deniedunavailablePermissionDeniedunavailableunavailableunavailable
    permission/requestunavailablePermissionRequestPermissionRequestunavailableunavailable
    prompt/submitagent.startUserPromptSubmitUserPromptSubmitbeforeSubmitPrompt (cloud: supported; desktop: supported)unavailable
    session/endunavailableSessionEndSessionEndsessionEnd (cloud: unavailable; desktop: supported)unavailable
    session/startsession.startSessionStartSessionStartsessionStart (cloud: unavailable; desktop: supported)unavailable
    stopagent.endStopStopstop (cloud: supported; desktop: supported)unavailable
    stop/failureunavailableStopFailureunavailableunavailableunavailable
    task/completeunavailableTaskCompletedunavailableunavailableunavailable
    task/createunavailableTaskCreatedunavailableunavailableunavailable
    tool/aftertool.resultPostToolUsePostToolUsepostToolUse (cloud: supported; desktop: supported)unavailable
    tool/beforetool.callPreToolUsePreToolUsepreToolUse (cloud: supported; desktop: supported)unavailable
    tool/failureunavailablePostToolUseFailureunavailablepostToolUseFailure (cloud: supported; desktop: supported)unavailable
    workspace/openunavailableunavailableunavailableworkspaceOpen (cloud: unavailable; desktop: supported)unavailable

    路由不可用的原因

    amp 0.0.1788739286-gf348fe

    • agent/idle — PluginEventMap declares no idle event.
    • agent/start — Amp agent.start is a user turn, not a subagent-start event.
    • agent/stop — PluginEventMap declares no subagent-stop event.
    • compact/after — PluginEventMap declares no compaction event.
    • compact/before — PluginEventMap declares no compaction event.
    • config/change — PluginEventMap declares no configuration-change event.
    • file/change — PluginEventMap declares no file-change event.
    • model-switch/after — PluginEventMap declares no model-switch event.
    • model-switch/before — PluginEventMap declares no model-switch event.
    • permission/denied — PluginEventMap declares no separate permission-denied event.
    • permission/request — Permission control is part of tool.call; no separate permission event is declared.
    • session/end — Amp explicitly documents that no session.end event exists.
    • stop/failure — PluginEventMap declares no separate failed-stop event.
    • task/complete — PluginEventMap declares no task lifecycle event.
    • task/create — PluginEventMap declares no task lifecycle event.
    • tool/failure — Failures are a tool.result status, not a separate PluginEventMap event.
    • workspace/open — PluginEventMap declares no workspace-open event.

    claude 2.1.260

    • workspace/open — The pinned Claude Code 2.1.260 hooks contract has no workspace-open event.

    codex 0.147.0

    • agent/idle — retrieved 2026-09-02: the complete rust-v0.147.0 generated hook schema directory contains no teammate-idle event.
    • config/change — retrieved 2026-09-02: the complete rust-v0.147.0 generated hook schema directory contains no config-change event.
    • file/change — retrieved 2026-09-02: the complete rust-v0.147.0 generated hook schema directory contains no file-changed event.
    • model-switch/after — 2026-09-03: the complete rust-v0.147.0 generated hook schema directory contains no post-model-switch event, and https://learn.chatgpt.com/docs/hooks (retrieved 2026-09-02) documents no model-switch hook.
    • model-switch/before — 2026-09-03: the complete rust-v0.147.0 generated hook schema directory contains no pre-model-switch event, and https://learn.chatgpt.com/docs/hooks (retrieved 2026-09-02) documents no model-switch hook.
    • permission/denied — retrieved 2026-09-02: the complete rust-v0.147.0 generated hook schema directory contains no permission-denied event.
    • stop/failure — retrieved 2026-09-02: the complete rust-v0.147.0 generated hook schema directory contains no stop-failure event.
    • task/complete — retrieved 2026-09-02: the complete rust-v0.147.0 generated hook schema directory contains no task-completed event.
    • task/create — retrieved 2026-09-02: the complete rust-v0.147.0 generated hook schema directory contains no task-created event.
    • tool/failure — retrieved 2026-09-02: the complete rust-v0.147.0 generated hook schema directory and native event inventory contain no tool-failure event.
    • workspace/open — The pinned Codex 0.147.0 hooks contract has no workspace-open event.

    cursor 2026-08-28

    • agent/idle — retrieved 2026-09-02: the complete https://cursor.com/docs/hooks event inventory documents no teammate-idle event.
    • compact/after — retrieved 2026-09-02: the complete https://cursor.com/docs/hooks event inventory documents no postCompact event.
    • config/change — retrieved 2026-09-02: the complete https://cursor.com/docs/hooks event inventory documents no configChange event.
    • file/change — retrieved 2026-09-02: Cursor documents afterFileEdit as an agent-edit tool variant that overlaps canonical tool/after per the #258 selector rule, not a disk-watch FileChanged equivalent; no dedicated family is inferred without fixture evidence of loss.
    • model-switch/after — 2026-09-03: https://cursor.com/docs/hooks (retrieved 2026-09-02) documents no hook that runs after the session model changes; the model reaches Cursor hooks only as the model input field of session-scoped events.
    • model-switch/before — 2026-09-03: https://cursor.com/docs/hooks (retrieved 2026-09-02) documents no hook that runs before a model switch and no output that could block one.
    • permission/denied — retrieved 2026-09-02: the complete https://cursor.com/docs/hooks event inventory documents no permission-denied event.
    • permission/request — retrieved 2026-09-02: https://cursor.com/docs/hooks documents no standalone permission-request event; pre-tool permission control is beforeShellExecution/beforeMCPExecution and is not inferred as this family per #258.
    • stop/failure — retrieved 2026-09-02: the complete https://cursor.com/docs/hooks event inventory documents no stop-failure event.
    • task/complete — retrieved 2026-09-02: the complete https://cursor.com/docs/hooks event inventory documents no taskCompleted event.
    • task/create — retrieved 2026-09-02: the complete https://cursor.com/docs/hooks event inventory documents no taskCreated event.
    • session/end (cloud) — retrieved 2026-09-02: https://cursor.com/docs/hooks states cloud agents have no editor-lifetime session boundary, so sessionEnd is unavailable there.
    • session/start (cloud) — retrieved 2026-09-02: https://cursor.com/docs/hooks defers cloud sessionStart while cloud agents can begin in a read-only environment where hooks do not load, so it would fire too late; Self-Hosted Machines workers fire it when a session claims the worker.
    • workspace/open (cloud) — retrieved 2026-09-02: https://cursor.com/docs/hooks states workspaceOpen is an IDE lifecycle hook that does not apply to cloud agents.

    portable 1.0.0

    • agent/idle — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native TeammateIdle equivalent (https://agent-plugins.org/).
    • agent/start — Agent Plugins 1.0.0 does not define hooks.
    • agent/stop — Agent Plugins 1.0.0 does not define hooks.
    • compact/after — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native PostCompact equivalent (https://agent-plugins.org/).
    • compact/before — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native PreCompact/preCompact equivalent (https://agent-plugins.org/).
    • config/change — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native ConfigChange equivalent (https://agent-plugins.org/).
    • file/change — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native FileChanged equivalent (https://agent-plugins.org/).
    • model-switch/after — 2026-09-03: Agent Plugins 1.0.0 defines no hooks and therefore no native PostModelSwitch equivalent (https://agent-plugins.org/).
    • model-switch/before — 2026-09-03: Agent Plugins 1.0.0 defines no hooks and therefore no native PreModelSwitch equivalent (https://agent-plugins.org/).
    • permission/denied — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native PermissionDenied equivalent (https://agent-plugins.org/).
    • permission/request — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native PermissionRequest equivalent (https://agent-plugins.org/).
    • prompt/submit — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native UserPromptSubmit/beforeSubmitPrompt equivalent (https://agent-plugins.org/).
    • session/end — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native SessionEnd/sessionEnd equivalent (https://agent-plugins.org/).
    • session/start — Agent Plugins 1.0.0 does not define hooks.
    • stop — Agent Plugins 1.0.0 does not define hooks.
    • stop/failure — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native StopFailure equivalent (https://agent-plugins.org/).
    • task/complete — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native TaskCompleted equivalent (https://agent-plugins.org/).
    • task/create — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native TaskCreated equivalent (https://agent-plugins.org/).
    • tool/after — Agent Plugins 1.0.0 does not define hooks.
    • tool/before — Agent Plugins 1.0.0 does not define hooks.
    • tool/failure — 2026-09-02: Agent Plugins 1.0.0 defines no hooks and therefore no native PostToolUseFailure/postToolUseFailure equivalent (https://agent-plugins.org/).
    • workspace/open — Agent Plugins 1.0.0 does not define hooks.

    规范载荷字段

    事件路由收到的 canonical.payload(AgentEventRouteProps<E>):每个事件族一张表,每个规范字段一行,每个支持该事件族的宿主一列。单元格给出该字段读取自的宿主键——字段以 { value, nativeKey } 的形式到达,nativeKey 恰为该键——— 表示宿主从不发送该字段,因此它在那里是 undefined,而非被伪造。标有 → json-string 的键是框架会解析的 JSON 编码字符串(不是合法 JSON 时保留为字符串);→ positive-count 表示把计数读作布尔值。没有任何两个宿主共有的字段留在 native 上。

    agent/idle

    载荷字段claude 2.1.260
    agentIdagent_id
    agentTypeagent_type
    cwdcwd
    permissionModepermission_mode
    sessionIdsession_id
    teamNameteam_name
    teammateNameteammate_name
    transcriptPathtranscript_path

    agent/start

    载荷字段claude 2.1.260codex 0.147.0cursor 2026-08-28
    agentIdagent_idagent_idsubagent_id
    agentTypeagent_typeagent_typesubagent_type
    cwdcwdcwd—
    model—modelmodel
    permissionModepermission_modepermission_mode—
    sessionIdsession_idsession_idconversation_id
    transcriptPathtranscript_pathtranscript_pathtranscript_path

    agent/stop

    载荷字段claude 2.1.260codex 0.147.0cursor 2026-08-28
    agentIdagent_idagent_idsubagent_id
    agentTranscriptPathagent_transcript_pathagent_transcript_pathagent_transcript_path
    agentTypeagent_typeagent_typesubagent_type
    cwdcwdcwd—
    lastAssistantMessagelast_assistant_messagelast_assistant_message—
    model—modelmodel
    permissionModepermission_modepermission_mode—
    reentrystop_hook_activestop_hook_activeloop_count → positive-count
    sessionIdsession_idsession_idconversation_id
    transcriptPathtranscript_pathtranscript_pathtranscript_path

    compact/after

    载荷字段claude 2.1.260codex 0.147.0
    agentIdagent_idagent_id
    agentTypeagent_typeagent_type
    cwdcwdcwd
    permissionModepermission_modepermission_mode
    sessionIdsession_idsession_id
    transcriptPathtranscript_pathtranscript_path
    triggertriggertrigger

    compact/before

    载荷字段claude 2.1.260codex 0.147.0cursor 2026-08-28
    agentIdagent_idagent_id—
    agentTypeagent_typeagent_type—
    cwdcwdcwd—
    model—modelmodel
    permissionModepermission_modepermission_mode—
    sessionIdsession_idsession_idconversation_id
    transcriptPathtranscript_pathtranscript_pathtranscript_path
    triggertriggertriggertrigger

    config/change

    载荷字段claude 2.1.260
    agentIdagent_id
    agentTypeagent_type
    cwdcwd
    filePathfile_path
    permissionModepermission_mode
    sessionIdsession_id
    sourcesource
    transcriptPathtranscript_path

    file/change

    载荷字段claude 2.1.260
    agentIdagent_id
    agentTypeagent_type
    cwdcwd
    filePathfile_path
    permissionModepermission_mode
    sessionIdsession_id
    transcriptPathtranscript_path

    model-switch/after

    载荷字段claude 2.1.260
    agentIdagent_id
    agentTypeagent_type
    cwdcwd
    fromModelfrom_model
    permissionModepermission_mode
    requestedModelrequested_model
    sessionIdsession_id
    sourcesource
    toModelto_model
    transcriptPathtranscript_path

    model-switch/before

    载荷字段claude 2.1.260
    agentIdagent_id
    agentTypeagent_type
    cwdcwd
    fromModelfrom_model
    permissionModepermission_mode
    requestedModelrequested_model
    sessionIdsession_id
    sourcesource
    toModelto_model
    transcriptPathtranscript_path

    permission/denied

    载荷字段claude 2.1.260
    agentIdagent_id
    agentTypeagent_type
    cwdcwd
    permissionModepermission_mode
    sessionIdsession_id
    toolInputtool_input
    toolNametool_name
    transcriptPathtranscript_path

    permission/request

    载荷字段claude 2.1.260codex 0.147.0
    agentIdagent_idagent_id
    agentTypeagent_typeagent_type
    cwdcwdcwd
    permissionModepermission_modepermission_mode
    sessionIdsession_idsession_id
    toolInputtool_inputtool_input
    toolNametool_nametool_name
    transcriptPathtranscript_pathtranscript_path

    prompt/submit

    载荷字段amp 0.0.1788739286-gf348feclaude 2.1.260codex 0.147.0cursor 2026-08-28
    agentId—agent_idagent_id—
    agentType—agent_typeagent_type—
    cwd—cwdcwd—
    model——modelmodel
    permissionMode—permission_modepermission_mode—
    promptpromptpromptpromptprompt
    sessionIdsession_idsession_idsession_idconversation_id
    transcriptPath—transcript_pathtranscript_pathtranscript_path

    session/end

    载荷字段claude 2.1.260codex 0.147.0cursor 2026-08-28
    agentIdagent_idagent_id—
    agentTypeagent_typeagent_type—
    cwdcwdcwd—
    model—modelmodel
    permissionModepermission_modepermission_mode—
    reasonreasonreasonreason
    sessionIdsession_idsession_idconversation_id
    transcriptPathtranscript_pathtranscript_pathtranscript_path

    session/start

    载荷字段amp 0.0.1788739286-gf348feclaude 2.1.260codex 0.147.0cursor 2026-08-28
    agentId—agent_idagent_id—
    agentType—agent_typeagent_type—
    cwd—cwdcwd—
    model—modelmodelmodel
    permissionMode—permission_modepermission_mode—
    sessionIdsession_idsession_idsession_idconversation_id
    source—sourcesource—
    transcriptPath—transcript_pathtranscript_pathtranscript_path

    stop

    载荷字段amp 0.0.1788739286-gf348feclaude 2.1.260codex 0.147.0cursor 2026-08-28
    agentId—agent_idagent_id—
    agentType—agent_typeagent_type—
    cwd—cwdcwd—
    lastAssistantMessage—last_assistant_messagelast_assistant_message—
    model——modelmodel
    permissionMode—permission_modepermission_mode—
    reentry—stop_hook_activestop_hook_activeloop_count → positive-count
    sessionIdsession_idsession_idsession_idconversation_id
    transcriptPath—transcript_pathtranscript_pathtranscript_path

    stop/failure

    载荷字段claude 2.1.260
    agentIdagent_id
    agentTypeagent_type
    cwdcwd
    errorerror
    lastAssistantMessagelast_assistant_message
    permissionModepermission_mode
    reentrystop_hook_active
    sessionIdsession_id
    transcriptPathtranscript_path

    task/complete

    载荷字段claude 2.1.260
    agentIdagent_id
    agentTypeagent_type
    cwdcwd
    permissionModepermission_mode
    sessionIdsession_id
    taskDescriptiontask_description
    taskIdtask_id
    taskSubjecttask_subject
    teamNameteam_name
    teammateNameteammate_name
    transcriptPathtranscript_path

    task/create

    载荷字段claude 2.1.260
    agentIdagent_id
    agentTypeagent_type
    cwdcwd
    permissionModepermission_mode
    sessionIdsession_id
    taskDescriptiontask_description
    taskIdtask_id
    taskSubjecttask_subject
    teamNameteam_name
    teammateNameteammate_name
    transcriptPathtranscript_path

    tool/after

    载荷字段amp 0.0.1788739286-gf348feclaude 2.1.260codex 0.147.0cursor 2026-08-28
    agentId—agent_idagent_id—
    agentType—agent_typeagent_type—
    cwd—cwdcwdcwd
    model——modelmodel
    permissionMode—permission_modepermission_mode—
    sessionIdsession_idsession_idsession_idconversation_id
    toolInputtool_inputtool_inputtool_inputtool_input
    toolNametool_nametool_nametool_nametool_name
    toolResponsetool_responsetool_responsetool_responsetool_output → json-string
    toolUseIdtool_use_idtool_use_idtool_use_idtool_use_id
    transcriptPath—transcript_pathtranscript_pathtranscript_path

    tool/before

    载荷字段amp 0.0.1788739286-gf348feclaude 2.1.260codex 0.147.0cursor 2026-08-28
    agentId—agent_idagent_id—
    agentType—agent_typeagent_type—
    cwd—cwdcwdcwd
    model——modelmodel
    permissionMode—permission_modepermission_mode—
    sessionIdsession_idsession_idsession_idconversation_id
    toolInputtool_inputtool_inputtool_inputtool_input
    toolNametool_nametool_nametool_nametool_name
    toolUseIdtool_use_idtool_use_idtool_use_idtool_use_id
    transcriptPath—transcript_pathtranscript_pathtranscript_path

    tool/failure

    载荷字段claude 2.1.260cursor 2026-08-28
    cwdcwdcwd
    errorerrorerror_message
    isInterruptis_interruptis_interrupt
    sessionIdsession_idconversation_id
    toolInputtool_inputtool_input
    toolNametool_nametool_name
    toolUseIdtool_use_idtool_use_id
    transcriptPathtranscript_pathtranscript_path

    workspace/open

    载荷字段cursor 2026-08-28
    workspaceRootsworkspace_roots

    配置声明的钩子事件

    agent-bundle.config.ts 的 hooks 块以这些规范名称为键;每个键映射到目标注册的原生事件。

    配置键claude 2.1.260codex 0.147.0cursor 2026-08-28
    afterToolPostToolUsePostToolUsepostToolUse
    agentStartSubagentStartSubagentStartsubagentStart
    agentStopSubagentStopSubagentStopsubagentStop
    beforeToolPreToolUsePreToolUsepreToolUse
    sessionStartSessionStartSessionStartsessionStart
    stopStopStopstop

    规范工具选择器

    限定 tools 的钩子或事件路由使用这些规范选择器;每个适配器发出下表中的原生匹配器。目标无法映射的选择器会产生针对该目标的诊断,而不是空匹配器。

    选择器claude 2.1.260codex 0.147.0cursor 2026-08-28
    agent——^Task$
    file.read^Read$—^Read$
    file.write^(?:Write|Edit)$^(?:apply_patch|Edit|Write)$^Write$
    mcp^mcp__^mcp__^MCP:
    shell^Bash$^Bash$^Shell$

    推迟的宿主原生事件

    各宿主公布但尚无规范路由族的原生事件,以及推迟它们的记录原因。

    claude 2.1.260

    宿主原生事件状态原因
    ConfigChange-policy_settingsunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: ConfigChange block decisions cannot stop policy_settings changes; recorded so the config/change family's deny channel is not overstated.
    CwdChangedunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: host environment callback outside the canonical application-event vocabulary (#258 defer list).
    DirectoryAddedunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: host workspace-registration callback outside the canonical application-event vocabulary (#258 defer list).
    Elicitationunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: MCP protocol callback outside the canonical application-event vocabulary (#258 defer list).
    ElicitationResultunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: MCP protocol callback outside the canonical application-event vocabulary (#258 defer list).
    InstructionsLoadedunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: host context-load callback outside the canonical application-event vocabulary (#258 defer list).
    MessageDisplayunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: UI display callback outside the canonical application-event vocabulary (#258 defer list).
    Notificationunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: delivery-channel surface tracked by #99 delivery evidence, not an application event route (#258 defer list).
    PostToolBatchunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: batch-scheduling callback outside the canonical application-event vocabulary (#258 defer list).
    Setupunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: one-time init/maintenance callback outside the canonical application-event vocabulary (#258 defer list).
    UserPromptExpansionunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: command-expansion callback outside the canonical application-event vocabulary (#258 defer list).
    WorktreeCreateunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: worktree-provisioning callback outside the canonical application-event vocabulary (#258 defer list).
    WorktreeRemoveunavailableretrieved 2026-09-02 from https://code.claude.com/docs/en/hooks: worktree-provisioning callback outside the canonical application-event vocabulary (#258 defer list).

    codex 0.147.0

    宿主原生事件状态原因
    Interruptunavailableretrieved 2026-09-02: https://learn.chatgpt.com/docs/hooks now documents Interrupt (main-thread turn interruption; matcher ignored; one-second default and three-second maximum timeout; systemMessage-only output), but the pinned rust-v0.147.0 generated hook schema directory has no interrupt.command.{input,output}.schema.json (those files exist only on main), and Agent Bundle has no canonical interrupt event route (#97 owns route expansion). Deferred until the Codex pin moves to a release that ships the generated Interrupt schemas; authored native Interrupt hooks fail closed with codex.native-hooks.event.deferred.

    cursor 2026-08-28

    宿主原生事件状态原因
    afterAgentResponseunavailableretrieved 2026-09-02 from https://cursor.com/docs/hooks: native/deferred until a canonical consumer is accepted (#258 defer list). Input is { text } with no output fields; matcher value AgentResponse; runs in cloud agents.
    afterAgentThoughtunavailableretrieved 2026-09-02 from https://cursor.com/docs/hooks: native/deferred until a canonical consumer is accepted (#258 defer list). Input is { text, duration_ms? } with no output fields; matcher value AgentThought; runs in cloud agents.
    afterFileEditunavailableretrieved 2026-09-02 from https://cursor.com/docs/hooks: agent-edit variant overlapping canonical tool/after per the #258 selector rule (postToolUse with the ^Write$ matcher fires for the same edit); a dedicated family requires a canonical-vocabulary decision because the native input { file_path, edits[{ old_string, new_string }] } carries per-edit diffs the generic tool_output string does not, and no output fields are documented. Matcher is the tool type (TabWrite, Write); runs in cloud agents.
    afterMCPExecutionunavailableretrieved 2026-09-02 from https://cursor.com/docs/hooks: native variant of canonical tool/after with mcp selector per the #258 selector rule (postToolUse with the ^MCP: matcher). Native input adds mcp_server_name, mcp_server_url, result_json, and duration with no output fields; deferred while cloud agents cannot run it.
    afterShellExecutionunavailableretrieved 2026-09-02 from https://cursor.com/docs/hooks: native variant of canonical tool/after with shell selector per the #258 selector rule (postToolUse with the ^Shell$ matcher). Native input is { command, output, duration, sandbox } with raw terminal output rather than the JSON-stringified tool_output, and no output fields; matcher is the full command string; runs in cloud agents.
    afterTabFileEditunavailableretrieved 2026-09-02 from https://cursor.com/docs/hooks: Tab-surface callback, native/deferred until a canonical consumer is accepted (#258 defer list). Only Tab triggers it, edits carry range/old_line/new_line, no output fields, and Tab hooks do not run in cloud agents.
    beforeMCPExecutionunavailableretrieved 2026-09-02 from https://cursor.com/docs/hooks: native variant of canonical tool/before with mcp selector per the #258 selector rule (preToolUse with the ^MCP: matcher). Native input adds mcp_server_name plus url/mcp_server_url (HTTP) or command (stdio) and its output admits permission ask, which the Cursor projection does not emit for preToolUse because Cursor documents it as unenforced there (#461); deferred while cloud agents cannot run it.
    beforeReadFileunavailableretrieved 2026-09-02 from https://cursor.com/docs/hooks: native variant of canonical tool/before with file.read selector per the #258 selector rule (preToolUse with the ^Read$ matcher). Native input adds content and attachments and its output is { permission allow|deny, user_message }; failClosed is documented for it; matcher is the tool type (TabRead, Read); runs in cloud agents.
    beforeShellExecutionunavailableretrieved 2026-09-02 from https://cursor.com/docs/hooks: native variant of canonical tool/before with shell selector per the #258 selector rule (preToolUse with the ^Shell$ matcher). Native input is { command, cwd, sandbox } and its output admits permission ask, which the Cursor projection does not emit for preToolUse because Cursor documents it as unenforced there (#461); matcher is the full command string; runs in cloud agents.
    beforeTabFileReadunavailableretrieved 2026-09-02 from https://cursor.com/docs/hooks: Tab-surface callback, native/deferred until a canonical consumer is accepted (#258 defer list). Only Tab triggers it, there is no attachments field, output is { permission allow|deny }, and Tab hooks do not run in cloud agents.