Skip to content

Hook event for slash-command / skill invocation (like Claude Code's UserPromptExpansion), and async command hooks #5305

Description

@aramakr2

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:

  1. 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.
  2. 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

  1. added theissue type on Oct 30, 2026
  2. added
    area:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agents
    and removed on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agents

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions