Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Automatically trace Claude Code conversations to Braintrust for observability. Captures sessions, conversation turns, and tool calls as hierarchical traces.
.claude/skills/parcadei-trace-claude-code/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 8% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 10% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 167% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -16% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 28% | 0% |
Automatically send Claude Code conversations to Braintrust for tracing and observability. Get full visibility into your AI coding sessions with hierarchical traces showing sessions, turns, and every tool call.
Claude Code Session (root trace)
├── Turn 1: "Add error handling"
│ ├── Read: src/app.ts
│ ├── Edit: src/app.ts
│ └── Response: "I've added try-catch..."
├── Turn 2: "Now run the tests"
│ ├── Terminal: npm test
│ └── Response: "All tests pass..."
└── Turn 3: "Great, commit this"
├── Terminal: git add .
├── Terminal: git commit -m "..."
└── Response: "Changes committed..."Four hooks capture the complete workflow:
| Hook | What it captures | |------|------------------| | SessionStart | Creates root trace when you start Claude Code | | PostToolUse | Captures every tool call (file reads, edits, terminal commands) | | Stop | Captures conversation turns (your message + Claude's response) | | SessionEnd | Logs session summary when you exit |
Run the setup script in any project directory where you want tracing:
bashbash /path/to/skills/trace-claude-code/setup.sh
The script prompts for your API key and project name, then configures all hooks automatically.
jq command-line tool (brew install jq on macOS)Create .claude/settings.local.json in your project directory:
json{ "hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": "bash /path/to/hooks/session_start.sh" } ] } ], "PostToolUse": [ { "matcher": "*", "hooks": [ { "type": "command", "command": "bash /path/to/hooks/post_tool_use.sh" } ] } ], "Stop": [ { "hooks": [ { "type": "command", "command": "bash /path/to/hooks/stop_hook.sh" } ] } ], "SessionEnd": [ { "hooks": [ { "type": "command", "command": "bash /path/to/hooks/session_end.sh" } ] } ] }, "env": { "TRACE_TO_BRAINTRUST": "true", "BRAINTRUST_API_KEY": "sk-...", "BRAINTRUST_CC_PROJECT": "my-project" } }
Replace /path/to/hooks/ with the actual path to this skill's hooks directory.
| Variable | Required | Description | |----------|----------|-------------| | TRACE_TO_BRAINTRUST | Yes | Set to "true" to enable tracing | | BRAINTRUST_API_KEY | Yes | Your Braintrust API key | | BRAINTRUST_CC_PROJECT | No | Project name (default: claude-code) | | BRAINTRUST_CC_DEBUG | No | Set to "true" for verbose logging |
After running Claude Code with tracing enabled:
claude-code)Each trace shows:
Traces are hierarchical:
span_attributes.type: "task"metadata.session_id: Unique session identifiermetadata.workspace: Project directoryspan_attributes.type: "llm"input: User messageoutput: Assistant responsemetadata.turn_number: Sequential turn numberspan_attributes.type: "tool"input: Tool input (file path, command, etc.)output: Tool resultmetadata.tool_name: Name of the tool usedbash tail -f ~/.claude/state/braintrust_hook.log
.claude/settings.local.json:TRACE_TO_BRAINTRUST must be "true"BRAINTRUST_API_KEY must be validjson { "env": { "BRAINTRUST_CC_DEBUG": "true" } }
Make hook scripts executable:
bashchmod +x /path/to/hooks/*.sh
Install jq:
brew install jqsudo apt-get install jqReset the tracing state:
bashrm ~/.claude/state/braintrust_state.json
View detailed hook execution logs:
bash# Follow logs in real-time tail -f ~/.claude/state/braintrust_hook.log # View last 50 lines tail -50 ~/.claude/state/braintrust_hook.log # Clear logs > ~/.claude/state/braintrust_hook.log
hooks/
├── common.sh # Shared utilities (logging, API, state)
├── session_start.sh # Creates root trace span
├── post_tool_use.sh # Captures tool calls
├── stop_hook.sh # Captures conversation turns
└── session_end.sh # Finalizes traceFor programmatic use with the Claude Agent SDK, use the native Braintrust integration:
typescriptimport { initLogger, wrapClaudeAgentSDK } from "braintrust"; import * as claudeSDK from "@anthropic-ai/claude-agent-sdk"; initLogger({ projectName: "my-project", apiKey: process.env.BRAINTRUST_API_KEY, }); const { query, tool } = wrapClaudeAgentSDK(claudeSDK);
See Braintrust Claude Agent SDK docs for details.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | fail→pass | 13,048 | 4,758 | -64% | 1 | 1 | 0% | 2,479 | 2,685 | +8% | 0 | 0 | — |
case-01 | fail→pass | 14,178 | 6,920 | -51% | 1 | 1 | 0% | 2,986 | 3,288 | +10% | 0 | 0 | — |
case-03 | fail→pass | 22,960 | 6,495 | -72% | 1 | 1 | 0% | 1,163 | 3,108 | +167% | 0 | 0 | — |
case-04 | fail→pass | 15,587 | 4,275 | -73% | 1 | 1 | 0% | 3,013 | 2,519 | -16% | 0 | 0 | — |
case-05 | fail→pass | 13,712 | 5,665 | -59% | 1 | 1 | 0% | 2,180 | 2,782 | +28% | 0 | 0 | — |
case-06 | fail→pass | 12,908 | 7,596 | -41% | 1 | 1 | 0% | 2,140 | 3,013 | +41% | 0 | 0 | — |
case-07 | pass→pass | 5,598 | 2,804 | -50% | 1 | 1 | 0% | 967 | 1,942 | +101% | 0 | 0 | — |
case-08 | fail→pass | 7,808 | 2,456 | -69% | 1 | 1 | 0% | 1,240 | 2,064 | +66% | 0 | 0 | — |
case-09 | fail→pass | 10,385 | 5,757 | -45% | 1 | 1 | 0% | 1,920 | 2,803 | +46% | 0 | 0 | — |
case-10 | pass→pass | 10,390 | 5,481 | -47% | 1 | 1 | 0% | 1,591 | 2,545 | +60% | 0 | 0 | — |
case-11 | pass→pass | 7,882 | 2,529 | -68% | 1 | 1 | 0% | 1,429 | 2,139 | +50% | 0 | 0 | — |
case-12 | pass→pass | 7,408 | 2,583 | -65% | 1 | 1 | 0% | 1,229 | 1,951 | +59% | 0 | 0 | — |
case-13 | pass→pass | 6,708 | 1,419 | -79% | 1 | 1 | 0% | 1,049 | 1,884 | +80% | 0 | 0 | — |
case-14 | fail→pass | 7,924 | 2,643 | -67% | 1 | 1 | 0% | 1,383 | 2,164 | +56% | 0 | 0 | — |
case-15 | fail→fail | 7,712 | 1,421 | -82% | 1 | 1 | 0% | 1,208 | 1,956 | +62% | 0 | 0 | — |
case-16 | fail→pass | 6,362 | 3,547 | -44% | 1 | 1 | 0% | 1,114 | 2,458 | +121% | 0 | 0 | — |
case-17 | fail→pass | 12,017 | 2,411 | -80% | 1 | 1 | 0% | 2,026 | 2,133 | +5% | 0 | 0 | — |
case-18 | fail→pass | 11,592 | 1,453 | -87% | 1 | 1 | 0% | 2,375 | 1,945 | -18% | 0 | 0 | — |
case-19 | pass→pass | 11,419 | 3,230 | -72% | 1 | 1 | 0% | 2,390 | 2,389 | -0% | 0 | 0 | — |
case-20 | pass→pass | 6,024 | 1,684 | -72% | 1 | 1 | 0% | 1,068 | 2,043 | +91% | 0 | 0 | — |
case-21 | fail→pass | 12,156 | 6,357 | -48% | 1 | 1 | 0% | 2,157 | 2,909 | +35% | 0 | 0 | — |
case-22 | pass→pass | 3,869 | 2,058 | -47% | 1 | 1 | 0% | 808 | 2,168 | +168% | 0 | 0 | — |
case-23 | pass→pass | 7,598 | 3,384 | -55% | 1 | 1 | 0% | 1,469 | 2,356 | +60% | 0 | 0 | — |
case-24 | pass→pass | 2,868 | 4,271 | +49% | 1 | 1 | 0% | 445 | 2,450 | +451% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted, and 23 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +54 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.