Skip to content

PostToolUse telemetry hook fails on every tool call when home dir has a space (Windows) — re-raise of closed PR #122 #2703

Description

@ivanovvitaly

Summary

The azure plugin's PostToolUse hook errors on every tool call in Claude Code on
Windows when the user profile path contains a space (e.g. C:\Users\First Last).

Root cause

hooks/hooks.json registers the command unquoted:

"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/track-telemetry.sh"

${CLAUDE_PLUGIN_ROOT} expands to a path with a space, bash word-splits it, and tries to
run the first segment as the script. Result, repeated on every tool invocation:

bash ...track-telemetry.sh: C:/Users/First: line 1: syntax error near unexpected token `('

track-telemetry.sh itself never runs — so even AZURE_MCP_COLLECT_TELEMETRY=false
can't suppress it (the script's opt-out short-circuit is never reached).

Fix

Quote the path (exactly what PR microsoft/azure-skills#122 proposed before it was closed unmerged):

"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/scripts/track-telemetry.sh\""

The same fix is needed in .github/plugins/azure-skills/hooks/hooks.json.

Environment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions