Skip to main content
hook

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

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add microsoft/skills
/plugin install azure@skills
Open on GitHub

What 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-code label 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@skills

2Manually: put the files in place

.claude/settings.json

The 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

Similar hooks

Everything for Cloud: AWS, Azure, GCP →

From the same set250

The whole set →
azure-observability azure-observability is a Claude Code hook for troubleshooting Azure web/API issues and Foundry agents, then checking recovery against evidence. It runs at session start and after tool use. ★ 3,232repo stars azure-observability azure-observability is a Claude Code plugin that guides incident investigation for Azure apps and Foundry agents. It structures troubleshooting from initial symptom analysis to fix validation. ★ 3,232repo stars azure-advisor-cost-optimization azure-advisor-cost-optimization is a Claude Code skill that reviews Azure Advisor findings for idle resources and checks deletion safety. It activates for requests about unused Azure resources and their potential savings. CX Codex +1 ★ 3,232repo stars aks-cost-optimization aks-cost-optimization is a Claude Code skill for analyzing AKS cluster costs, including pod placement, node scaling and storage. It activates for NAP readiness, bin packing and blocked scale-down investigations. CX Codex +1 ★ 3,232repo stars ui-widget-developer ui-widget-developer is a Claude Code skill for building MCP servers and interactive widgets for Copilot Chat, including new servers and widgets added to existing ones. CX Codex +1 ★ 3,232repo stars slack-to-teams slack-to-teams reads an existing Slack bot and walks you through porting it to Teams or building for both platforms at once. Useful once the bot works and has to go wider. CX Codex +1 ★ 3,232repo stars teams-app-developer teams-app-developer is a Claude Code skill that scaffolds, tests, and deploys Microsoft 365 agents and Teams apps with the ATK CLI. It also supports local debugging in Agents Playground and Slack migrations. CX Codex +1 ★ 3,232repo stars m365-agent-evaluator m365-agent-evaluator is a Claude Code skill that builds evaluation suites for Microsoft 365 Copilot declarative agents, runs evaluations, and inspects results. CX Codex +1 ★ 3,232repo stars

More in the catalog

Project sponsors

Companies that keep this analytics open