You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hook event for slash-command / skill invocation (like Claude Code's UserPromptExpansion), and async command hooks #5305
Describe the feature or problem you'd like to solve
Add a hook event that fires when a slash command or skill is invoked, with a matcher on its name
Proposed solution
We ship skills as plugins for both Claude Code and Copilot CLI and log their use from plugin hooks. A skill the user types (/my-skill) doesn't go through the model's skill tool, so the only way to see it today is a userPromptSubmitted hook. That hook starts a process on every prompt and blocks it (~0.3 s), just to check whether the prompt starts with /.
Claude Code solves this with a UserPromptExpansion event. It fires when a typed command expands, carries command_name (plugin:skill) and command_source, and supports a matcher on the command name, so the hook only runs for matching commands.
Requests:
A hook event (e.g. skillInvoked / userPromptExpansion) that fires when a typed slash command or skill expands, with the plugin and skill name in the payload and a matcher on the name.
Support for "async": true on command hooks, so a logging hook doesn't delay the prompt (Claude Code runs async hooks in the background; Copilot CLI 1.0.105 currently waits for them).
The skill name and plugin are already available as the github.copilot.skill.invoked OTel span and the SDK SKILL_INVOKED event; exposing the same to plugin hooks would cover it.
Example prompts or workflows
User types /my-plugin:my-skill (or /my-skill). A hook configured as "skillInvoked": [{ "type": "command", "command": "...", "matcher": "^my-plugin:" }] runs with { "skillName": "my-plugin:my-skill", "source": "slash_command"}; ordinary prompts run no hook.
Additional context
Copilot CLI 1.0.105, Windows 11. Claude Code already offers this as UserPromptExpansion
Activity