chore: reuse hooks by building for all plugins - #2991
Merged
JasonYeMSFT (JasonYeMSFT) merged 1 commit intoAug 3, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a shared hooks build artifact so telemetry hook logic/config can be reused across plugin builds without duplicating hook files inside each plugin directory.
Changes:
- Add cross-client telemetry hook implementations (Bash + PowerShell) that parse PostToolUse payloads and emit telemetry via
@azure/mcp. - Add hook configuration files for Copilot/Claude/Cursor hook formats under a shared
hooks/directory. - Update the gulp build to copy the shared
hooks/directory into each plugin’soutput/<plugin>/hooksfolder during build.
Show a summary per file
| File | Description |
|---|---|
| hooks/scripts/track-telemetry.sh | Adds Bash telemetry hook implementation (parses tool events, emits MCP telemetry). |
| hooks/scripts/track-telemetry.ps1 | Adds PowerShell telemetry hook implementation with equivalent behavior to the Bash script. |
| hooks/hooks.json | Adds a hooks config file for PostToolUse with OS/shell-specific command entries. |
| hooks/cursor-hooks.json | Adds Cursor hook config to run the telemetry script after tool use. |
| hooks/claude-hooks.json | Adds Claude Code hook config to run the telemetry script after tool use. |
| gulpfile.ts | Copies the shared hooks/ directory into each built plugin output so hooks ship with all plugins. |
Review details
- Files reviewed: 1/6 changed files
- Comments generated: 0
- Review effort level: Low
msalaman
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Make hooks a plugin build artifact so they can be shared by all plugins without duplicating code.
Checklist
cd tests && npm test)fix:,feat:,feature:,chore:,misc:,test:,eval:tests/,npm run test:integration -- <skill>ornpm run test:vally -- --skill <skill>)Related Issues