Live collection

Optional OTLP endpoint. Prefer local agent scan unless you need traces streamed while an agent runs.

Collector
/api/collect

Claude Code CLI

Add to ~/.zshrc or ~/.bashrc

export CLAUDE_CODE_ENABLE_TELEMETRY=1
export CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1
export OTEL_TRACES_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_PROTOCOL=http/json
export OTEL_EXPORTER_OTLP_ENDPOINT=/api/collect
export OTEL_LOG_USER_PROMPTS=1
export OTEL_LOG_TOOL_DETAILS=1
export OTEL_LOG_TOOL_CONTENT=1

Claude Desktop

~/.claude/settings.json

{
  "telemetry": {
    "otlpEnabled": true,
    "otlpTracesEnabled": true,
    "otlpEndpoint": "/api/collect",
    "otlpProtocol": "http/json",
    "otlpContentCapture": ["user_prompt", "tool_details", "tool_content"]
  }
}

Codex CLI

~/.codex/config.toml

[otel]
enabled = true
exporter = "otlp-http"
endpoint = "/api/collect"
log_user_prompt = true

Test

POST a dummy span

curl -X POST /api/collect \
  -H "Content-Type: application/json" \
  -d '{"resourceSpans":[{"scopeSpans":[{"spans":[{"traceId":"test","spanId":"1","name":"test"}]}]}]}'
  1. 1. Point the agent at this collector
  2. 2. Work in the agent as usual
  3. 3. Open Runs to inspect the incoming trace