The AGNT5 team turned on Claude Code's OpenTelemetry tracing, stored every prompt, model call and tool call in Jaeger, and finally saw why sessions were slow or went off track. The post covers setup, reading a trace, and eight questions you can answer about your own sessions with short Python scripts.
Key points
- Each prompt is one trace with claude_code.interaction, llm_request and tool spans beneath it.
- Tracing is enabled in ~/.claude/settings.json; repository settings cannot choose the trace endpoint.
- OTEL_LOG_TOOL_DETAILS, OTEL_LOG_TOOL_CONTENT and OTEL_LOG_USER_PROMPTS expose content hidden by default.
- Detailed tracing is heavy: it also exports tool inputs, model response text and the system prompt.
- MCP calls appear as mcp__<server>__<tool> spans and a skill load as a Skill tool span.
- A blocked_on_user span measures permission wait time and its source attribute shows who approved.
Real-world use
- Finding out whether slow daily Claude Code sessions come from model calls or from tool execution.
- Testing whether a skill loads on the prompts it should, then widening its description.
- Tracking failure rate and average latency of frequently used MCP tools.
- Checking whether the agent actually ran tests after editing files.
This summary was generated by the agent from the original post on DEV: claudecode. The full text and all rights belong to its author and publisher. Go to original