trace-claude-code

Trace Claude Code sessions, turns, and tool calls to Braintrust.

3.9k|296|Updated Dec 23, 2025
One-click install
npx skills add https://github.com/parcadei/Continuous-Claude --skill trace-claude-code-parcadei
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trace-claude-code
Source: https://github.com/parcadei/Continuous-Claude/tree/main/.claude/plugins/braintrust-tracing/skills/trace-claude-code
Command: npx skills add https://github.com/parcadei/Continuous-Claude --skill trace-claude-code-parcadei

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automatically trace Claude Code conversations to Braintrust for tracing and observability. This Skill captures sessions, turns, and tool calls as hierarchical traces for complete visibility.

Core Features & Use Cases

  • Hierarchical traces: Sessions, turns, and tool-calls are captured with their metadata.
  • Cross-session correlation: Handoffs linked to traces for debugging across sessions.
  • Use Case: When debugging a long Claude Code session, review Braintrust traces to see how decisions and tool uses happened.

Quick Start

Run the setup to enable tracing in your project:

  • bash /path/to/skills/trace-claude-code/setup.sh

Frequently Asked Questions about trace-claude-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I trace Claude Code conversations to Braintrust?

Tracing Claude Code conversations to Braintrust captures sessions, turns, and tool calls as hierarchical traces for observability. Run the setup script, set environment variables (TRACE_TO_BRAINTRUST, BRAINTRUST_API_KEY, BRAINTRUST_CC_PROJECT), and traces automatically flow to Braintrust for debugging and auditing.

What gets captured when I trace Claude Code sessions?

Hierarchical traces capture sessions, turns, reads, edits, terminal interactions, and all tool calls with metadata. Cross-session correlation links handoffs to traces, enabling complete visibility into how decisions and tool uses occurred during long debugging sessions.

Do I need Braintrust set up before using Claude Code tracing?

Yes. Prerequisites include a Braintrust account with API key, project name, and environment variables configured. Optional hooks (SessionStart, PostToolUse, Stop, SessionEnd) enable manual configuration for granular control over what gets traced.

Can I enable verbose logging for Claude Code traces?

Yes. Set the optional BRAINTRUST_CC_DEBUG environment variable to enable verbose logging, which outputs detailed trace information for troubleshooting and understanding trace capture behavior.

How do I debug a long Claude Code session using traces?

Review the hierarchical traces in Braintrust after your session ends. Traces show the full sequence of turns, tool calls, and decisions, letting you identify where issues occurred and audit the complete interaction history.

What's the difference between automatic and manual trace configuration?

Automatic tracing works after setup with environment variables. Manual configuration uses four hooks (SessionStart, PostToolUse, Stop, SessionEnd) for fine-grained control over which events and data get captured in traces.