azure — Claude Code hook: run telemetry script on session events
The azure hook for Claude Code runs a telemetry script at session start and after a tool is used. It passes the script the claude-code label.
MIT ★ 3,232 updated 2026-11-11
/plugin marketplace add microsoft/skills
/plugin install azure@skillsWhat azure does
The hook configuration listens for SessionStart and PostToolUse. For either event, Claude Code runs hooks/scripts/track-telemetry.sh with bash and supplies the --harness claude-code argument.
Both events call the same script. Its configuration labels the harness as Claude Code, so it does not establish that GitHub Copilot events are tracked.
What it helps with
- run a telemetry script when a session begins
- call the telemetry script after tool use
- pass the
claude-codelabel to the script
Example prompts for the agent
- Start a Claude Code session to trigger the hook.
- Use a tool in Claude Code to trigger the hook after the action.
How to install azure
1Plugin marketplace
/plugin marketplace add microsoft/skills/plugin install azure@skills2Manually: put the files in place
.claude/settings.jsonThe hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json
Step by step, with commands for each platform: Claude Code hooks: what they are, where to configure them, how to block a risky command
Questions about azure
How do I install azure in Claude Code?
Run /plugin marketplace add microsoft/skills, then /plugin install azure@skills. The settings file is .claude/settings.json.
What does the azure hook do?
It runs hooks/scripts/track-telemetry.sh at session start and after tool use, passing --harness claude-code.
Which events trigger azure?
The hook configuration runs it for SessionStart and PostToolUse in Claude Code.
Source text
claude-hooks.json · MIT
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/track-telemetry.sh\" --harness claude-code"
}
]
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/track-telemetry.sh\" --harness claude-code"
}
]
}
]
}
}
© Microsoft · MIT · microsoft/skills