Trace Claude Code to Braintrust
Automatically ships Claude Code sessions, conversation turns, and tool calls to Braintrust as hierarchical traces.
Dev & CodingIntermediate★ 3,883⑂ 296AI score 7/10Last updated: Jan 26, 2026
What it does
Wires up four Claude Code hooks (SessionStart, PostToolUse, Stop, SessionEnd) so every coding session is logged to the Braintrust observability platform.
- Session (root span): session ID and workspace metadata
- Turn (child span): each user message → assistant response pair, numbered sequentially
- Tool call (child span): input/output for every file read, edit, and terminal command
A setup.sh script prompts for your API key and project name and writes the hook config for you; manual .claude/settings.local.json setup is documented too, along with debug logging, log tailing, and state reset for troubleshooting.
Who it's for
- Developers who want an audit trail of exactly what the agent read and executed
- Engineering leads measuring how a team uses Claude Code
- Teams already running Braintrust for LLM logging and evals
- (Caveat) Not a fit if you have no Braintrust account or cannot send conversation content to a third-party SaaS.
Examples
- Post-mortem a big refactor: open Braintrust Logs to see a timeline of which files were edited how many times and which test commands failed.
- Onboarding material: share a senior engineer's session trace so new hires can study effective prompting and tool-use flow.
- Incident tracing: when a file disappears unexpectedly, cross-check the trace against
tail -f ~/.claude/state/braintrust_hook.logto pinpoint the offending tool call.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the .claude/plugins/braintrust-tracing/skills/trace-claude-code folder from the GitHub repo parcadei/Continuous-Claude-v3 into my ~/.claude/skills/trace-claude-code/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/parcadei/Continuous-Claude-v3.git && mkdir -p ~/.claude/skills && cp -r Continuous-Claude-v3/.claude/plugins/braintrust-tracing/skills/trace-claude-code ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Prerequisites: Claude Code CLI installed plus
jq(brew install jqon macOS,sudo apt-get install jqon Ubuntu/Debian). - Grab a Braintrust API key from braintrust.dev.
- Clone the repo and copy the skill:
git clone https://github.com/parcadei/Continuous-Claude-v3.gitmkdir -p ~/.claude/skills && cp -r Continuous-Claude-v3/.claude/plugins/braintrust-tracing/skills/trace-claude-code ~/.claude/skills/ - Make the hook scripts executable:
chmod +x ~/.claude/skills/trace-claude-code/hooks/*.sh - Change into the project directory you want traced and run
bash ~/.claude/skills/trace-claude-code/setup.sh, entering your API key and project name. - Prefer manual setup? Create
.claude/settings.local.jsonusing the JSON sample in the docs and replace/path/to/hooks/with the real path. - Run Claude Code, do a few actions, then open braintrust.dev → your project → Logs. If nothing shows up, set
BRAINTRUST_CC_DEBUGto"true"and check~/.claude/state/braintrust_hook.log. - Add
.claude/settings.local.jsonto.gitignoreso your API key never gets committed.
View source on GitHub ↗License: MIT