Skip to contentllms.txt

Copilot CLI — Hooks

File format
JSON
Discovery path
.github/hooks
Syllago install method
JSON merge
Symlink support
No
Config file
.github/hooks/
Handler types
command

Hook events

Canonical EventNative NameCategory
after_tool_executepostToolUseTool
agent_stopagentStopLifecycle
before_promptuserPromptSubmittedLifecycle
before_tool_executepreToolUseTool
error_occurrederrorOccurredLifecycle
session_endsessionEndLifecycle
session_startsessionStartLifecycle
subagent_stopsubagentStopLifecycle
tool_use_failureerrorOccurredTool

Features

How each feature converts to syllago's canonical format. See format conversion for what these statuses mean.

Fields

Native frontmatter or config fields this provider exposes. The first column is the provider's own field name; the canonical key column links to syllago's cross-provider equivalent.

Provider fieldConversionCanonical keySummary
permissionDecisionTranslatedConversion type: TranslatedActively mapped to the target provider’s equivalent field during conversion.Learn more →Only preToolUse can block tool execution by returning {permissionDecision:"deny", permissionDecisionReason:"..."}; other hook outputs are ignored.

Other features

Behaviors, conventions, and capabilities that aren't tied to a single named field — things like path-based activation, discovery rules, and lifecycle behavior.

FeatureConversionSummary
decision_controlTranslatedConversion type: TranslatedActively mapped to the target provider’s equivalent field during conversion.Learn more →pre_tool_use_deny: Copilot CLI PreToolUse hooks can deny (block) the tool invocation; no allow or modify documented
JSON Hook Configuration FileTranslatedConversion type: TranslatedActively mapped to the target provider’s equivalent field during conversion.Learn more →Hooks live in .github/hooks/*.json with a {version, hooks:{EVENT_NAME:[...]}} schema; each hook has type, bash, powershell, cwd, timeoutSec, comment.
Six Hook Event TypesTranslatedConversion type: TranslatedActively mapped to the target provider’s equivalent field during conversion.Learn more →Six named events (sessionStart, sessionEnd, userPromptSubmitted, preToolUse, postToolUse, errorOccurred) receive JSON payloads via stdin.

Sources

Source
https://raw.githubusercontent.com/github/docs/main/content/copilot/reference/hooks-configuration.md
https://raw.githubusercontent.com/github/docs/main/content/copilot/how-tos/copilot-cli/customize-copilot/use-hooks.md
https://raw.githubusercontent.com/github/docs/main/content/copilot/concepts/agents/copilot-cli/about-copilot-cli.md