braintrust-analyze — Claude Code skill: what it does, how to install
Analyzes Claude Code sessions using Braintrust tracing data. Spots repeated tool loops, tracks token consumption trends, and audits agent activity.
npx skills add parcadei/Continuous-Claude-v3 --skill braintrust-analyze -a claude-codeWhat braintrust-analyze does
The skill inspects telemetry collected during Claude Code runs to debug errors and review agent actions. Its CLI script runs via uv run python -m runtime.harness scripts/braintrust_analyze.py to produce summaries of tool calls, token usage estimates, and subagent spawns like plan-agent or debug-agent.
One key diagnostic is loop detection. Running with --detect-loops identifies sessions where the assistant triggered the same tool more than 5 times consecutively, pointing to stuck searches or inefficient tooling. You can also trace action sequences with --replay <session-id> or inspect 7-day stats via --agent-stats and --skill-stats.
The analysis fails immediately if BRAINTRUST_API_KEY is missing from ~/.claude/.env or the project .env, or if tracing was not enabled through braintrust-claude-plugin. The script defaults to the Braintrust project named agentica unless overridden with --project NAME.
What it helps with
- detect tool loops when the same tool runs more than 5 times
- audit token usage trends across recent sessions
- replay the sequence of tool and subagent actions for a specific session ID
- review weekly statistics on activated skills and spawned agents
Example prompts for the agent
- Analyze my last Claude Code session with braintrust-analyze
- Run braintrust-analyze to check if tools were stuck in a loop
- Show token usage trends and weekly summary via braintrust_analyze.py
How to install braintrust-analyze
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill braintrust-analyze -a claude-code2Manually: put the files in place
~/.claude/skills/braintrust-analyze/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/braintrust-analyze/
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill braintrust-analyze -a codex2Manually: put the files in place
.agents/skills/braintrust-analyze/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill braintrust-analyze -a cursor2Manually: put the files in place
.cursor/skills/braintrust-analyze/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install parcadei/Continuous-Claude-v3 braintrust-analyze2Manually: put the files in place
.github/skills/braintrust-analyze/SKILL.md1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill braintrust-analyze -a gemini-cli2Platform CLI
gemini skills install https://github.com/parcadei/Continuous-Claude-v3 --path .claude/skills/braintrust-analyzeManually: put the files in place
.devin/skills/braintrust-analyze/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill braintrust-analyze -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about braintrust-analyze
How to install braintrust-analyze in Claude Code?
Run npx skills add parcadei/Continuous-Claude-v3 --skill braintrust-analyze -a claude-code. The skill file will be placed in ~/.claude/skills/braintrust-analyze/SKILL.md.
What does braintrust-analyze do?
It evaluates Claude Code execution traces recorded in Braintrust. It details tool usage, highlights repeated execution loops, and tracks token consumption over time.
What are the requirements for running braintrust-analyze?
You need BRAINTRUST_API_KEY defined in ~/.claude/.env or your project .env, plus active tracing enabled via braintrust-claude-plugin.
Source text
SKILL.md · MIT
--- name: braintrust-analyze description: Analyze Claude Code sessions via Braintrust --- # Braintrust Analysis Analyze your Claude Code sessions for patterns, issues, and insights using Braintrust tracing data. ## When to Use - After completing a complex task (retrospective) - When debugging why something failed - Weekly review of productivity patterns - Finding opportunities to create new skills - Understanding token usage trends ## Commands Run from the project directory: ```bash # Analyze last session - summary with tool/agent/skill breakdown uv run python -m runtime.harness scripts/braintrust_analyze.py --last-session # List recent sessions uv run python -m runtime.harness scripts/braintrust_analyze.py --sessions 5 # Agent usage statistics (last 7 days) uv run python -m runtime.harness scripts/braintrust_analyze.py --agent-stats # Skill usage statistics (last 7 days) uv run python -m runtime.harness scripts/braintrust_analyze.py --skill-stats # Detect loops - find repeated tool patterns (>5 same tool calls) uv run python -m runtime.harness scripts/braintrust_analyze.py --detect-loops # Replay specific session - show full sequence of actions uv run python -m runtime.harness scripts/braintrust_analyze.py --replay <session-id> # Weekly summary - daily activity breakdown uv run python -m runtime.harness scripts/braintrust_analyze.py --weekly-summary # Token trends - usage over time uv run python -m runtime.harness scripts/braintrust_analyze.py --token-trends ``` ## Options - `--project NAME` - Braintrust project name (default: agentica) ## What You'll Learn ### Session Analysis - Tool usage breakdown - Agent spawns (plan-agent, debug-agent, etc.) - Skill activations (/commit, /research, etc.) - Token consumption estimates ### Loop Detection Find sessions where the same tool was called repeatedly, which may indicate: - Stuck in a search loop - Inefficient approach - Opportunity for better tooling ### Usage Patterns - Which agents you use most - Which skills get activated - Daily/weekly activity trends ## Examples ### Quick Retrospective ```bash # What happened in my last session? uv run python -m runtime.harness scripts/braintrust_analyze.py --last-session ``` Output: ``` ## Session Analysis **ID:** `92940b91...` **Started:** 2025-12-24T01:31:05Z **Spans:** 14 ### Tool Usage - Read: 4 - Bash: 2 - Edit: 2 ... ``` ### Find Loops ```bash uv run python -m runtime.harness scripts/braintrust_analyze.py --detect-loops ``` ### Weekly Review ```bash uv run python -m runtime.harness scripts/braintrust_analyze.py --weekly-summary ``` ## Requirements - BRAINTRUST_API_KEY in ~/.claude/.env or project .env - Braintrust tracing enabled (via braintrust-claude-plugin)
© parcadei · MIT · parcadei/Continuous-Claude-v3