Describe the feature or problem you'd like to solve
The hooks reference does not clearly document matcher support for flat command hooks.
Proposed solution
This makes it hard to use matcher for common cases like running a postToolUse formatter/linter only after file-edit tools. The Copilot CLI v1.0.63 changelog mentions that PostToolUse matchers are honored, and also mentions preToolUse.matcher, but the reference does not make the supported events or matching semantics clear.
Could the docs clarify:
- Which hook events support
matcher on flat command hook entries
- Whether this includes
preToolUse, postToolUse, and postToolUseFailure
- For camelCase hooks, whether
matcher is matched against runtime toolName
- Whether matching is case-sensitive and full-match/anchored regex
- How this differs from PascalCase / Claude-format matchers such as
Edit|Write
A small example for an edit-only postToolUse hook would be enough, e.g. whether this is the intended form:
{
"version": 1,
"hooks": {
"postToolUse": [
{
"type": "command",
"matcher": "^(?:edit|create|apply_patch)$",
"bash": "uv run .github/hooks/scripts/post-edit-quality-feedback.py",
"powershell": "uv run .github/hooks/scripts/post-edit-quality-feedback.py",
"timeoutSec": 60
}
]
}
}
It would also help to point to the relevant built-in runtime tool names and argument shapes used by hook payloads. The hooks reference includes a runtime-to-Claude tool name table under PascalCase PreToolUse, but it is not obvious whether that table should be used for camelCase hook matchers.
Related issues I found:
This issue is specifically about documenting command hook matcher support and semantics. The feature is useful for reducing unnecessary hook executions and simplifying hook scripts, but it is currently hard to rely on from the docs alone.
Example prompts or workflows
No response
Additional context
No response
Describe the feature or problem you'd like to solve
The hooks reference does not clearly document
matchersupport for flat command hooks.Proposed solution
This makes it hard to use
matcherfor common cases like running apostToolUseformatter/linter only after file-edit tools. The Copilot CLI v1.0.63 changelog mentions thatPostToolUsematchers are honored, and also mentionspreToolUse.matcher, but the reference does not make the supported events or matching semantics clear.Could the docs clarify:
matcheron flat command hook entriespreToolUse,postToolUse, andpostToolUseFailurematcheris matched against runtimetoolNameEdit|WriteA small example for an edit-only
postToolUsehook would be enough, e.g. whether this is the intended form:{ "version": 1, "hooks": { "postToolUse": [ { "type": "command", "matcher": "^(?:edit|create|apply_patch)$", "bash": "uv run .github/hooks/scripts/post-edit-quality-feedback.py", "powershell": "uv run .github/hooks/scripts/post-edit-quality-feedback.py", "timeoutSec": 60 } ] } }It would also help to point to the relevant built-in runtime tool names and argument shapes used by hook payloads. The hooks reference includes a runtime-to-Claude tool name table under PascalCase
PreToolUse, but it is not obvious whether that table should be used for camelCase hook matchers.Related issues I found:
preToolUse.toolArgsThis issue is specifically about documenting command hook
matchersupport and semantics. The feature is useful for reducing unnecessary hook executions and simplifying hook scripts, but it is currently hard to rely on from the docs alone.Example prompts or workflows
No response
Additional context
No response