Skip to content

Hook and tool names ​

The tool names, hook events, environment variables, and contract details each harness uses, generated from the shipped catalogs in pkg/harness-compilation/toolpolicy and pkg/harness-compilation/hookpolicy. Regenerate with make catalog-docs; make catalog-check fails when this page is stale.

Shared tool concepts ​

ConceptMeaning
access.requestAsk the user for filesystem access.
ask.userAsk the user a question.
file.deleteDelete a file.
file.editModify an existing file in place, including patch application.
file.listList a directory.
file.readRead file contents.
file.writeCreate or overwrite a whole file.
mcp.callCall a tool on an MCP server.
mcp.readRead an MCP resource.
mcp.serversList configured MCP servers.
mcp.toolsList tools on MCP servers.
notebook.editModify notebook cells.
notebook.readRead notebook cells.
plan.enterEnter plan mode.
plan.exitLeave plan mode.
search.globFind files by path pattern.
search.grepSearch file contents.
shellRun a shell command.
shell.powershellRun a PowerShell command.
shell.sessionPoll, feed, or stop an already running shell session.
skillLoad a skill.
subagentStart a subagent.
subagent.readRead a running subagent's output.
todoMaintain the agent's task list.
web.fetchFetch a URL.
web.searchRun a web search.

Canonical hook events ​

Canonical eventMeaning
NotificationWhen the harness sends a user notification.
PermissionRequestWhen a tool call needs a permission decision.
PostCompactAfter context compaction.
PostToolUseAfter a tool call succeeds.
PostToolUseFailureAfter a tool call fails.
PreCompactBefore context compaction.
PreToolUseBefore a tool call runs; can block it.
SessionEndWhen a session ends.
SessionStartWhen a session starts or resumes.
StopWhen the main agent is about to finish its turn; can request continuation.
SubagentStartWhen a subagent starts.
SubagentStopWhen a subagent finishes.
UserPromptSubmitAfter the user submits a prompt, before the model sees it.

Tool names by harness ​

claude ​

Surfaces: hook_matcher, subagent_tools, skill_allowed_tools. MCP naming: mcp__{server}__{tool}; match-all mcp__.*; server scoped: true.

ToolConceptsAliasesSurfaces
AgentsubagentTaskall
AskUserQuestionask.user-all
Bashshell-all
Editfile.editMultiEditall
EnterPlanModeplan.enter-all
ExitPlanModeplan.exit-all
Globsearch.glob-all
Grepsearch.grep-all
NotebookEditnotebook.edit-all
PowerShellshell.powershell-all
Readfile.read-all
Skillskill-all
TodoWritetodo-all
WebFetchweb.fetch-all
WebSearchweb.search-all
Writefile.write-all

codex ​

Surfaces: hook_matcher. MCP naming: mcp__{server}__{tool}; match-all mcp__.*; server scoped: true.

ToolConceptsAliasesSurfaces
Bashshell-all
apply_patchfile.write, file.editEdit, Writeall
spawn_agentsubagentAgentall
update_plantodo-all

cursor ​

Surfaces: hook_matcher. MCP naming: MCP:{tool}; match-all MCP:.*; server scoped: false.

ToolConceptsAliasesSurfaces
Deletefile.delete-all
Grepsearch.grep-all
Readfile.read-all
Shellshell-all
Tasksubagent-all
WebFetchweb.fetch-all
WebSearchweb.search-all
Writefile.write, file.edit-all

devin ​

Surfaces: hook_matcher, subagent_tools, skill_allowed_tools. MCP naming: mcp__{server}__{tool}; match-all mcp__.*; server scoped: true.

ToolConceptsAliasesSurfaces
apply_patchfile.write, file.edit-hook_matcher
editfile.edit-all
execshell-all
exit_plan_modeplan.exit-hook_matcher
get_outputshell.session-hook_matcher
globsearch.glob-all
grepsearch.grep-all
kill_shellshell.session-hook_matcher
mcp_call_toolmcp.call-hook_matcher
mcp_list_serversmcp.servers-hook_matcher
mcp_list_toolsmcp.tools-hook_matcher
mcp_read_resourcemcp.read-hook_matcher
notebook_editnotebook.edit-hook_matcher
notebook_readnotebook.read-hook_matcher
readfile.read-all
read_subagentsubagent.read-hook_matcher
request_scopeaccess.request-hook_matcher
run_subagentsubagent-hook_matcher
skillskill-hook_matcher
todo_writetodo-hook_matcher
webfetchweb.fetch-hook_matcher
writefile.write-hook_matcher
write_to_processshell.session-hook_matcher

factory ​

Surfaces: hook_matcher, subagent_tools. MCP naming: mcp__{server}__{tool}; match-all mcp__.*; server scoped: true.

ToolConceptsAliasesSurfaces
ApplyPatchfile.write, file.edit-all
Createfile.write-all
Editfile.edit-all
Executeshell-all
FetchUrlweb.fetch-all
Globsearch.glob-all
Grepsearch.grep-all
LSfile.list-all
Readfile.read-all
Skillskill-hook_matcher
Tasksubagent-hook_matcher
TodoWritetodo-hook_matcher
WebSearchweb.search-all

gemini ​

Surfaces: hook_matcher, subagent_tools. MCP naming: mcp_{server}_{tool}; match-all mcp_.*; server scoped: true.

ToolConceptsAliasesSurfaces
activate_skillskill-all
ask_userask.user-all
enter_plan_modeplan.enter-all
exit_plan_modeplan.exit-all
globsearch.glob-all
google_web_searchweb.search-all
grep_searchsearch.grepsearch_file_contentall
list_directoryfile.list-all
read_filefile.read-all
read_many_filesfile.read-all
replacefile.edit-all
run_shell_commandshell-all
web_fetchweb.fetch-all
write_filefile.write-all
write_todostodo-all

opencode ​

Surfaces: hook_matcher. MCP naming: ``; match-all mcp_.*; server scoped: false.

ToolConceptsAliasesSurfaces
apply_patchfile.write, file.edit-all
bashshellBashall
editfile.editEditall
globsearch.globGloball
grepsearch.grepGrepall
questionask.user-all
readfile.readReadall
skillskillSkillall
tasksubagentTaskall
todowritetodoTodoWriteall
webfetchweb.fetchWebFetchall
websearchweb.searchWebSearchall
writefile.writeWriteall

windsurf ​

Surfaces: none. MCP naming: ``; match-all *; server scoped: false.

No tool-name vocabulary: tool selection is encoded in the hook event.

Hook contracts by harness ​

claude ​

Timeout unit: seconds. Matcher syntax: exact-or-regex (exact |/, lists). Repository base: env project_dir.

Variable conceptNamesEvents
env_fileCLAUDE_ENV_FILESessionStart, Setup, CwdChanged, FileChanged
project_dirCLAUDE_PROJECT_DIRall
remoteCLAUDE_CODE_REMOTEall
plugin_data (plugin only)CLAUDE_PLUGIN_DATAall
plugin_root (plugin only)CLAUDE_PLUGIN_ROOTall
EventCanonicalMatcherTypesTimeout bounds
ConfigChange(native only)lifecyclecommand, http, mcp_tool-
CwdChanged(native only)nonecommand, http, mcp_tool-
DirectoryAdded(native only)lifecyclecommand, http, mcp_tool-
Elicitation(native only)lifecyclecommand, http, mcp_tool-
ElicitationResult(native only)lifecyclecommand, http, mcp_tool-
FileChanged(native only)lifecyclecommand, http, mcp_tool-
InstructionsLoaded(native only)lifecyclecommand, http, mcp_tool-
MessageDisplay(native only)nonecommand, http, mcp_tool-
NotificationNotificationlifecyclecommand, http, mcp_tool-
PermissionDenied(native only)toolcommand, http, mcp_tool, prompt, agent-
PermissionRequestPermissionRequesttoolcommand, http, mcp_tool, prompt-
PostCompactPostCompactlifecyclecommand, http, mcp_tool-
PostModelSwitch(native only)lifecyclecommand, http, mcp_tool-
PostToolBatch(native only)nonecommand, http, mcp_tool, prompt, agent-
PostToolUsePostToolUsetoolcommand, http, mcp_tool, prompt, agent-
PostToolUseFailurePostToolUseFailuretoolcommand, http, mcp_tool, prompt, agent-
PreCompactPreCompactlifecyclecommand, http, mcp_tool-
PreModelSwitch(native only)lifecyclecommand, http, mcp_tool-
PreToolUsePreToolUsetoolcommand, http, mcp_tool, prompt, agent-
SessionEndSessionEndlifecyclecommand, http, mcp_tool-
SessionStartSessionStartlifecyclecommand, mcp_tool-
Setup(native only)lifecyclecommand-
StopStopnonecommand, http, mcp_tool, prompt, agent-
StopFailure(native only)lifecyclecommand, http, mcp_tool-
SubagentStartSubagentStartlifecyclecommand, http, mcp_tool-
SubagentStopSubagentStoplifecyclecommand, http, mcp_tool, prompt, agent-
TaskCompleted(native only)nonecommand, http, mcp_tool, prompt, agent-
TaskCreated(native only)nonecommand, http, mcp_tool, prompt, agent-
TeammateIdle(native only)nonecommand, http, mcp_tool, prompt, agent-
UserPromptExpansion(native only)lifecyclecommand, http, mcp_tool, prompt, agent-
UserPromptSubmitUserPromptSubmitnonecommand, http, mcp_tool, prompt, agent-
WorktreeCreate(native only)nonecommand, http, mcp_tool-
WorktreeRemove(native only)nonecommand, http, mcp_tool-

codex ​

Timeout unit: seconds. Matcher syntax: regex (output anchored). Repository base: shell "$(git rev-parse --show-toplevel)".

Variable conceptNamesEvents
plugin_data (plugin only)PLUGIN_DATA, CLAUDE_PLUGIN_DATAall
plugin_root (plugin only)PLUGIN_ROOT, CLAUDE_PLUGIN_ROOTall
EventCanonicalMatcherTypesTimeout bounds
Interrupt(native only)nonecommand, mcp_tool1-3
PermissionRequest(native only)toolcommand, mcp_tool-
PostCompact(native only)lifecyclecommand, mcp_tool-
PostToolUsePostToolUsetoolcommand, mcp_tool-
PreCompact(native only)lifecyclecommand, mcp_tool-
PreToolUsePreToolUsetoolcommand, mcp_tool-
SessionEnd(native only)lifecyclecommand1-3
SessionStartSessionStartlifecyclecommand, mcp_tool-
StopStopnonecommand, mcp_tool-
SubagentStart(native only)lifecyclecommand, mcp_tool-
SubagentStop(native only)lifecyclecommand, mcp_tool-
UserPromptSubmitUserPromptSubmitnonecommand, mcp_tool-

cursor ​

Timeout unit: seconds. Matcher syntax: regex. Repository base: env project_dir. Also loads hooks of: claude.

Variable conceptNamesEvents
project_dirCURSOR_PROJECT_DIR, CLAUDE_PROJECT_DIRall
remoteCURSOR_CODE_REMOTEall
transcript_pathCURSOR_TRANSCRIPT_PATHall
user_emailCURSOR_USER_EMAILall
versionCURSOR_VERSIONall
plugin_root (plugin only)CURSOR_PLUGIN_ROOTall
EventCanonicalMatcherTypesTimeout bounds
afterAgentResponse(native only)lifecyclecommand, prompt-
afterAgentThought(native only)lifecyclecommand, prompt-
afterFileEdit(native only)toolcommand, prompt-
afterMCPExecution(native only)nonecommand, prompt-
afterShellExecution(native only)command_textcommand, prompt-
afterTabFileEdit(native only)lifecyclecommand, prompt-
beforeMCPExecution(native only)nonecommand, prompt-
beforeReadFile(native only)toolcommand, prompt-
beforeShellExecution(native only)command_textcommand, prompt-
beforeSubmitPromptUserPromptSubmitlifecyclecommand, prompt-
beforeTabFileRead(native only)lifecyclecommand, prompt-
postToolUsePostToolUsetoolcommand, prompt-
postToolUseFailure(native only)toolcommand, prompt-
preCompactPreCompactnonecommand, prompt-
preToolUsePreToolUsetoolcommand, prompt-
sessionEndSessionEndnonecommand, prompt-
sessionStartSessionStartnonecommand, prompt-
stopStoplifecyclecommand, prompt-
subagentStart(native only)lifecyclecommand, prompt-
subagentStopSubagentStoplifecyclecommand, prompt-
workspaceOpen(native only)nonecommand, prompt-

devin ​

Timeout unit: seconds. Matcher syntax: regex (output anchored). Repository base: env project_dir. Also loads hooks of: claude.

Variable conceptNamesEvents
project_dirDEVIN_PROJECT_DIRall
EventCanonicalMatcherTypesTimeout bounds
PermissionRequestPermissionRequesttoolcommand, prompt-
PostCompactionPostCompactnonecommand, prompt-
PostToolUsePostToolUsetoolcommand, prompt-
PreToolUsePreToolUsetoolcommand, prompt-
SessionEndSessionEndnonecommand, prompt-
SessionStartSessionStartnonecommand, prompt-
StopStopnonecommand, prompt-
UserPromptSubmitUserPromptSubmitnonecommand, prompt-

factory ​

Timeout unit: seconds. Matcher syntax: exact-or-regex. Repository base: env project_dir.

Variable conceptNamesEvents
project_dirFACTORY_PROJECT_DIRall
plugin_root (plugin only)DROID_PLUGIN_ROOT, CLAUDE_PLUGIN_ROOTall
EventCanonicalMatcherTypesTimeout bounds
NotificationNotificationlifecyclecommand-
PostToolUsePostToolUsetoolcommand-
PreCompactPreCompactlifecyclecommand-
PreToolUsePreToolUsetoolcommand-
SessionEndSessionEndlifecyclecommand-
SessionStartSessionStartlifecyclecommand-
StopStopnonecommand-
SubagentStopSubagentStoplifecyclecommand-
UserPromptSubmitUserPromptSubmitnonecommand-

gemini ​

Timeout unit: milliseconds. Matcher syntax: regex. Repository base: env project_dir.

Variable conceptNamesEvents
cwdGEMINI_CWDall
plans_dirGEMINI_PLANS_DIRall
project_dirGEMINI_PROJECT_DIR, CLAUDE_PROJECT_DIRall
session_idGEMINI_SESSION_IDall
plugin_root (plugin only)extensionPathall
EventCanonicalMatcherTypesTimeout bounds
AfterAgentStopnonecommand-
AfterModel(native only)nonecommand-
AfterToolPostToolUsetoolcommand-
BeforeAgentUserPromptSubmitnonecommand-
BeforeModel(native only)nonecommand-
BeforeToolPreToolUsetoolcommand-
BeforeToolSelection(native only)nonecommand-
NotificationNotificationlifecyclecommand-
PreCompressPreCompactlifecyclecommand-
SessionEndSessionEndlifecyclecommand-
SessionStartSessionStartlifecyclecommand-

opencode ​

Timeout unit: seconds. Matcher syntax: exact-or-regex (exact |/, lists). Repository base: env project_dir.

Variable conceptNamesEvents
project_dirAGENT_MARKETPLACE_PROJECT_DIRall
EventCanonicalMatcherTypesTimeout bounds
PreToolUsePreToolUsetoolcommand-

windsurf ​

Timeout unit: none. Matcher syntax: none. Repository base: cwd repository.

Variable conceptNamesEvents
workspace_rootROOT_WORKSPACE_PATHpost_setup_worktree
EventCanonicalMatcherTypesTimeout bounds
post_cascade_responseStopcommand-
post_cascade_response_with_transcript(native only)command-
post_mcp_tool_usePostToolUse(mcp)command-
post_read_codePostToolUse[file.read]command-
post_run_commandPostToolUse[shell]command-
post_setup_worktree(native only)command-
post_write_codePostToolUse[file.write, file.edit]command-
pre_mcp_tool_usePreToolUse(mcp)command-
pre_read_codePreToolUse[file.read]command-
pre_run_commandPreToolUse[shell]command-
pre_user_promptUserPromptSubmitcommand-
pre_write_codePreToolUse[file.write, file.edit]command-