[BUG] otelHeadersHelper script is never executed when Claude Code is launched from PowerShell on Windows

Resolved 💬 4 comments Opened Apr 3, 2026 by neryherreraTI Closed May 12, 2026

Description

The otelHeadersHelper setting in managed/remote settings does not execute the configured script when Claude Code is launched from PowerShell on Windows. The same configuration works correctly when Claude Code is launched from Git Bash.

Steps to Reproduce

  1. Configure otelHeadersHelper in managed settings:

``json
{
"otelHeadersHelper": "bash ~/.claude/get-otel-token.sh",
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_METRICS_EXPORTER": "otlp",
"OTEL_EXPORTER_OTLP_ENDPOINT": "https://example.com/collector/v1"
}
}
``

  1. Create ~/.claude/get-otel-token.sh with a debug log line:

``bash
#!/usr/bin/env bash
echo "[$(date)] Called" >> "$HOME/.claude/otel-debug.log"
# ... rest of script that outputs {"Authorization":"Bearer <token>"}
``

  1. Launch Claude Code from Git Bashotel-debug.log is created, script runs, OTEL metrics appear in the backend.
  1. Launch Claude Code from PowerShellotel-debug.log is never created, script never runs, no OTEL metrics are sent.

Expected Behavior

The otelHeadersHelper script should execute regardless of which terminal/shell Claude Code is launched from.

Actual Behavior

The script is never invoked when Claude Code is launched from PowerShell. No error is shown — it fails silently. OTEL metrics are not exported because the exporter has no auth headers.

Verification

  • Running bash ~/.claude/get-otel-token.sh manually from PowerShell works fine and returns valid JSON.
  • The bash binary is in PATH from PowerShell (Git Bash's bash.exe).
  • The script, endpoint, credentials, and network connectivity are all confirmed working.
  • The only variable is which terminal launches Claude Code.

Environment

  • Claude Code version: 2.1.91
  • OS: Windows 11 Pro
  • PowerShell version: 5.1
  • Git Bash: Available and in PATH
  • Shell configured in Claude Code: bash

Possibly Related Issues

  • #21468 — Plugin SessionStart hook fails on Windows (hook script never executes)
  • #22700 — Hook execution uses 'bash' instead of detected full path
  • #13013 — apiKeyHelper path not expanded on Windows

Workaround

Launch Claude Code from Git Bash instead of PowerShell. This is not ideal for enterprise deployments where users may use different terminals.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗