Skip to content

Feature Request: Global Hooks Configuration with UserPromptSubmit, Stop, and Notification Events #1157

@jie-meng

Description

@jie-meng

Problem Statement

Currently, GitHub Copilot's hooks implementation has significant limitations compared to similar AI coding assistants like Claude Code and Cursor:

  1. No global configuration: Hooks must be configured per repository via .github/copilot-hooks.json, requiring repetitive setup across projects
  2. Limited event types: Only basic Start hooks are supported, missing critical lifecycle events
  3. Poor developer experience: Cannot set up system-wide preferences for workflow automation

Use Case

I want to play different audio notifications to get immediate feedback during AI interactions:

  • UserPromptSubmit: When I submit a prompt to Copilot (AI starts working)
  • Stop: When Copilot finishes generating the response
  • Notification: When Copilot asks a question or needs my input (different sound to distinguish from completion)

This helps maintain awareness of AI activity without constantly monitoring the terminal, especially during long-running operations or when multitasking.

Comparison with Competitors

Claude Code (docs):

  • ✅ Global hooks configuration in user settings
  • ✅ Supports UserPromptSubmit, Stop, Notification events
  • ✅ Simple setup without per-repository configuration

Cursor (docs):

  • ✅ Global hooks configuration
  • ✅ Supports multiple lifecycle events including completion and user interaction
  • ✅ User-level preferences

GitHub Copilot CLI (docs):

  • ❌ Repository-level only (.github/copilot-hooks.json)
  • ❌ Only userPromptSubmitted event supported
  • ❌ No global/user-level configuration
  • ❌ Missing Stop and Notification events
  • ❌ And I tried to configure in my repository, never success to play sound when I submit a a prompt

Proposed Solution

  1. Add global hooks configuration

    • Support user-level hooks in ~/.config/copilot/hooks.json (or OS-equivalent)
    • Allow global hooks to be overridden by repository-specific hooks when needed
  2. Add essential lifecycle events

    • UserPromptSubmit: Triggered when user submits a prompt
    • Stop: Triggered when Copilot completes the response
    • Notification: Triggered when Copilot asks for user input/clarification
  3. Example configuration (desired syntax):

{
  "hooks": {
    "UserPromptSubmit": {
      "command": "afplay /path/to/start.mp3 &",
      "description": "Play sound when user submits prompt"
    },
    "Stop": {
      "command": "afplay /path/to/complete.mp3 &",
      "description": "Play sound when Copilot finishes"
    },
    "Notification": {
      "command": "afplay /path/to/question.mp3 &",
      "description": "Play different sound when Copilot needs input"
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions