# Trace Claude Code

Automatically trace Claude Code conversations to Braintrust for observability.

- Repository: https://github.com/parcadei/Continuous-Claude-v3 (3947 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-01-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add parcadei/Continuous-Claude-v3 --skill trace-claude-code -g -a claude-code -y`
Codex: `npx skills add parcadei/Continuous-Claude-v3 --skill trace-claude-code -g -a codex -y`
Cursor: `npx skills add parcadei/Continuous-Claude-v3 --skill trace-claude-code -g -a cursor -y`
Gemini CLI: `npx skills add parcadei/Continuous-Claude-v3 --skill trace-claude-code -g -a gemini-cli -y`

## Description

Automatically trace Claude Code conversations to Braintrust for observability. Captures sessions, conversation turns, and tool calls as hierarchical traces.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Trace Claude Code to Braintrust

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.

## What you get

```
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..."
```

## How it works

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 |

## Quick setup

Run the setup script in any project directory where you want tracing:

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

The script prompts for your API key and project name, then configures all hooks automatically.

## Manual setup

### Prerequisites

- [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) installed
- [Braintrust API key](https://www.braintrust.dev/app/settings/api-keys)
- `jq` command-line tool (`brew install jq` on macOS)

### Configuration

Create `.claude/settings.local.json` in your project directory:

The rest: https://github.com/parcadei/Continuous-Claude-v3/blob/HEAD/.claude/plugins/braintrust-tracing/skills/trace-claude-code/SKILL.md
