[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F67KE5EYCBWCK0D3S5ZBSR":3,"skill-same:01M7F67KE5EYCBWCK0D3S5ZBSR":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7F67KE5EYCBWCK0D3S5ZBSR","trace-claude-code",null,"Automatically trace Claude Code conversations to Braintrust for observability.\nCaptures sessions, conversation turns, and tool calls as hierarchical traces.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Ftrace-claude-code\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: trace-claude-code\ndescription: |\n  Automatically trace Claude Code conversations to Braintrust for observability.\n  Captures sessions, conversation turns, and tool calls as hierarchical traces.\nversion: 1.1.0\n---\n\n# Trace Claude Code to Braintrust\n\nAutomatically 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.\n\n## What you get\n\n```\nClaude Code Session (root trace)\n├── Turn 1: \"Add error handling\"\n│   ├── Read: src\u002Fapp.ts\n│   ├── Edit: src\u002Fapp.ts\n│   └── Response: \"I've added try-catch...\"\n├── Turn 2: \"Now run the tests\"\n│   ├── Terminal: npm test\n│   └── Response: \"All tests pass...\"\n└── Turn 3: \"Great, commit this\"\n    ├── Terminal: git add .\n    ├── Terminal: git commit -m \"...\"\n    └── Response: \"Changes committed...\"\n```\n\n## How it works\n\nFour hooks capture the complete workflow:\n\n| Hook | What it captures |\n|------|------------------|\n| **SessionStart** | Creates root trace when you start Claude Code |\n| **PostToolUse** | Captures every tool call (file reads, edits, terminal commands) |\n| **Stop** | Captures conversation turns (your message + Claude's response) |\n| **SessionEnd** | Logs session summary when you exit |\n\n## Quick setup\n\nRun the setup script in any project directory where you want tracing:\n\n```bash\nbash \u002Fpath\u002Fto\u002Fskills\u002Ftrace-claude-code\u002Fsetup.sh\n```\n\nThe script prompts for your API key and project name, then configures all hooks automatically.\n\n## Manual setup\n\n### Prerequisites\n\n- [Claude Code CLI](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code) installed\n- [Braintrust API key](https:\u002F\u002Fwww.braintrust.dev\u002Fapp\u002Fsettings\u002Fapi-keys)\n- `jq` command-line tool (`brew install jq` on macOS)\n\n### Configuration\n\nCreate `.claude\u002Fsettings.local.json` in your project directory:\n\n```json\n{\n  \"hooks\": {\n    \"SessionStart\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash \u002Fpath\u002Fto\u002Fhooks\u002Fsession_start.sh\"\n          }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"*\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash \u002Fpath\u002Fto\u002Fhooks\u002Fpost_tool_use.sh\"\n          }\n        ]\n      }\n    ],\n    \"Stop\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash \u002Fpath\u002Fto\u002Fhooks\u002Fstop_hook.sh\"\n          }\n        ]\n      }\n    ],\n    \"SessionEnd\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash \u002Fpath\u002Fto\u002Fhooks\u002Fsession_end.sh\"\n          }\n        ]\n      }\n    ]\n  },\n  \"env\": {\n    \"TRACE_TO_BRAINTRUST\": \"true\",\n    \"BRAINTRUST_API_KEY\": \"sk-...\",\n    \"BRAINTRUST_CC_PROJECT\": \"my-project\"\n  }\n}\n```\n\nReplace `\u002Fpath\u002Fto\u002Fhooks\u002F` with the actual path to this skill's hooks directory.\n\n### Environment variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `TRACE_TO_BRAINTRUST` | Yes | Set to `\"true\"` to enable tracing |\n| `BRAINTRUST_API_KEY` | Yes | Your Braintrust API key |\n| `BRAINTRUST_CC_PROJECT` | No | Project name (default: `claude-code`) |\n| `BRAINTRUST_CC_DEBUG` | No | Set to `\"true\"` for verbose logging |\n\n## Viewing traces\n\nAfter running Claude Code with tracing enabled:\n\n1. Go to [braintrust.dev](https:\u002F\u002Fwww.braintrust.dev)\n2. Navigate to your project (e.g., `claude-code`)\n3. Click **Logs** to see all traced sessions\n\nEach trace shows:\n- **Session root**: The overall Claude Code session\n- **Turns**: Each conversation exchange (user input → assistant response)\n- **Tool calls**: Individual operations (file reads, edits, terminal commands)\n\n## Trace structure\n\nTraces are hierarchical:\n\n- **Session** (root span)\n  - `span_attributes.type`: `\"task\"`\n  - `metadata.session_id`: Unique session identifier\n  - `metadata.workspace`: Project directory\n\n- **Turn** (child of session)\n  - `span_attributes.type`: `\"llm\"`\n  - `input`: User message\n  - `output`: Assistant response\n  - `metadata.turn_number`: Sequential turn number\n\n- **Tool call** (child of turn or session)\n  - `span_attributes.type`: `\"tool\"`\n  - `input`: Tool input (file path, command, etc.)\n  - `output`: Tool result\n  - `metadata.tool_name`: Name of the tool used\n\n## Troubleshooting\n\n### No traces appearing\n\n1. **Check hooks are running:**\n   ```bash\n   tail -f ~\u002F.claude\u002Fstate\u002Fbraintrust_hook.log\n   ```\n\n2. **Verify environment variables** in `.claude\u002Fsettings.local.json`:\n   - `TRACE_TO_BRAINTRUST` must be `\"true\"`\n   - `BRAINTRUST_API_KEY` must be valid\n\n3. **Enable debug mode:**\n   ```json\n   {\n     \"env\": {\n       \"BRAINTRUST_CC_DEBUG\": \"true\"\n     }\n   }\n   ```\n\n### Permission errors\n\nMake hook scripts executable:\n\n```bash\nchmod +x \u002Fpath\u002Fto\u002Fhooks\u002F*.sh\n```\n\n### Missing jq command\n\nInstall jq:\n- **macOS**: `brew install jq`\n- **Ubuntu\u002FDebian**: `sudo apt-get install jq`\n\n### State issues\n\nReset the tracing state:\n\n```bash\nrm ~\u002F.claude\u002Fstate\u002Fbraintrust_state.json\n```\n\n### Hook logs\n\nView detailed hook execution logs:\n\n```bash\n# Follow logs in real-time\ntail -f ~\u002F.claude\u002Fstate\u002Fbraintrust_hook.log\n\n# View last 50 lines\ntail -50 ~\u002F.claude\u002Fstate\u002Fbraintrust_hook.log\n\n# Clear logs\n> ~\u002F.claude\u002Fstate\u002Fbraintrust_hook.log\n```\n\n## File structure\n\n```\nhooks\u002F\n├── common.sh          # Shared utilities (logging, API, state)\n├── session_start.sh   # Creates root trace span\n├── post_tool_use.sh   # Captures tool calls\n├── stop_hook.sh       # Captures conversation turns\n└── session_end.sh     # Finalizes trace\n```\n\n## Alternative: SDK integration\n\nFor programmatic use with the Claude Agent SDK, use the native Braintrust integration:\n\n```typescript\nimport { initLogger, wrapClaudeAgentSDK } from \"braintrust\";\nimport * as claudeSDK from \"@anthropic-ai\u002Fclaude-agent-sdk\";\n\ninitLogger({\n  projectName: \"my-project\",\n  apiKey: process.env.BRAINTRUST_API_KEY,\n});\n\nconst { query, tool } = wrapClaudeAgentSDK(claudeSDK);\n```\n\nSee [Braintrust Claude Agent SDK docs](https:\u002F\u002Fwww.braintrust.dev\u002Fdocs\u002Fintegrations\u002Fsdk-integrations\u002Fclaude-agent-sdk) for details.\n","# Trace Claude Code to Braintrust\n\nAutomatically 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.\n\n## What you get\n\n```\nClaude Code Session (root trace)\n├── Turn 1: \"Add error handling\"\n│   ├── Read: src\u002Fapp.ts\n│   ├── Edit: src\u002Fapp.ts\n│   └── Response: \"I've added try-catch...\"\n├── Turn 2: \"Now run the tests\"\n│   ├── Terminal: npm test\n│   └── Response: \"All tests pass...\"\n└── Turn 3: \"Great, commit this\"\n    ├── Terminal: git add .\n    ├── Terminal: git commit -m \"...\"\n    └── Response: \"Changes committed...\"\n```\n\n## How it works\n\nFour hooks capture the complete workflow:\n\n| Hook | What it captures |\n|------|------------------|\n| **SessionStart** | Creates root trace when you start Claude Code |\n| **PostToolUse** | Captures every tool call (file reads, edits, terminal commands) |\n| **Stop** | Captures conversation turns (your message + Claude's response) |\n| **SessionEnd** | Logs session summary when you exit |\n\n## Quick setup\n\nRun the setup script in any project directory where you want tracing:\n\n```bash\nbash \u002Fpath\u002Fto\u002Fskills\u002Ftrace-claude-code\u002Fsetup.sh\n```\n\nThe script prompts for your API key and project name, then configures all hooks automatically.\n\n## Manual setup\n\n### Prerequisites\n\n- [Claude Code CLI](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code) installed\n- [Braintrust API key](https:\u002F\u002Fwww.braintrust.dev\u002Fapp\u002Fsettings\u002Fapi-keys)\n- `jq` command-line tool (`brew install jq` on macOS)\n\n### Configuration\n\nCreate `.claude\u002Fsettings.local.json` in your project directory:\n\n```json\n{\n  \"hooks\": {\n    \"SessionStart\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash \u002Fpath\u002Fto\u002Fhooks\u002Fsession_start.sh\"\n          }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"*\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash \u002Fpath\u002Fto\u002Fhooks\u002Fpost_tool_use.sh\"\n          }\n        ]\n      }\n    ],\n    \"Stop\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash \u002Fpath\u002Fto\u002Fhooks\u002Fstop_hook.sh\"\n          }\n        ]\n      }\n    ],\n    \"SessionEnd\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash \u002Fpath\u002Fto\u002Fhooks\u002Fsession_end.sh\"\n          }\n        ]\n      }\n    ]\n  },\n  \"env\": {\n    \"TRACE_TO_BRAINTRUST\": \"true\",\n    \"BRAINTRUST_API_KEY\": \"sk-...\",\n    \"BRAINTRUST_CC_PROJECT\": \"my-project\"\n  }\n}\n```\n\nReplace `\u002Fpath\u002Fto\u002Fhooks\u002F` with the actual path to this skill's hooks directory.\n\n### Environment variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `TRACE_TO_BRAINTRUST` | Yes | Set to `\"true\"` to enable tracing |\n| `BRAINTRUST_API_KEY` | Yes | Your Braintrust API key |\n| `BRAINTRUST_CC_PROJECT` | No | Project name (default: `claude-code`) |\n| `BRAINTRUST_CC_DEBUG` | No | Set to `\"true\"` for verbose logging |\n\n## Viewing traces\n\nAfter running Claude Code with tracing enabled:\n\n1. Go to [braintrust.dev](https:\u002F\u002Fwww.braintrust.dev)\n2. Navigate to your project (e.g., `claude-code`)\n3. Click **Logs** to see all traced sessions\n\nEach trace shows:\n- **Session root**: The overall Claude Code session\n- **Turns**: Each conversation exchange (user input → assistant response)\n- **Tool calls**: Individual operations (file reads, edits, terminal commands)\n\n## Trace structure\n\nTraces are hierarchical:\n\n- **Session** (root span)\n  - `span_attributes.type`: `\"task\"`\n  - `metadata.session_id`: Unique session identifier\n  - `metadata.workspace`: Project directory\n\n- **Turn** (child of session)\n  - `span_attributes.type`: `\"llm\"`\n  - `input`: User message\n  - `output`: Assistant response\n  - `metadata.turn_number`: Sequential turn number\n\n- **Tool call** (child of turn or session)\n  - `span_attributes.type`: `\"tool\"`\n  - `input`: Tool input (file path, command, etc.)\n  - `output`: Tool result\n  - `metadata.tool_name`: Name of the tool used\n\n## Troubleshooting\n\n### No traces appearing\n\n1. **Check hooks are running:**\n   ```bash\n   tail -f ~\u002F.claude\u002Fstate\u002Fbraintrust_hook.log\n   ```\n\n2. **Verify environment variables** in `.claude\u002Fsettings.local.json`:\n   - `TRACE_TO_BRAINTRUST` must be `\"true\"`\n   - `BRAINTRUST_API_KEY` must be valid\n\n3. **Enable debug mode:**\n   ```json\n   {\n     \"env\": {\n       \"BRAINTRUST_CC_DEBUG\": \"true\"\n     }\n   }\n   ```\n\n### Permission errors\n\nMake hook scripts executable:\n\n```bash\nchmod +x \u002Fpath\u002Fto\u002Fhooks\u002F*.sh\n```\n\n### Missing jq command\n\nInstall jq:\n- **macOS**: `brew install jq`\n- **Ubuntu\u002FDebian**: `sudo apt-get install jq`\n\n### State issues\n\nReset the tracing state:\n\n```bash\nrm ~\u002F.claude\u002Fstate\u002Fbraintrust_state.json\n```\n\n### Hook logs\n\nView detailed hook execution logs:\n\n```bash\n# Follow logs in real-time\ntail -f ~\u002F.claude\u002Fstate\u002Fbraintrust_hook.log\n\n# View last 50 lines\ntail -50 ~\u002F.claude\u002Fstate\u002Fbraintrust_hook.log\n\n# Clear logs\n> ~\u002F.claude\u002Fstate\u002Fbraintrust_hook.log\n```\n\n## File structure\n\n```\nhooks\u002F\n├── common.sh          # Shared utilities (logging, API, state)\n├── session_start.sh   # Creates root trace span\n├── post_tool_use.sh   # Captures tool calls\n├── stop_hook.sh       # Captures conversation turns\n└── session_end.sh     # Finalizes trace\n```\n\n## Alternative: SDK integration\n\nFor programmatic use with the Claude Agent SDK, use the native Braintrust integration:\n\n```typescript\nimport { initLogger, wrapClaudeAgentSDK } from \"braintrust\";\nimport * as claudeSDK from \"@anthropic-ai\u002Fclaude-agent-sdk\";\n\ninitLogger({\n  projectName: \"my-project\",\n  apiKey: process.env.BRAINTRUST_API_KEY,\n});\n\nconst { query, tool } = wrapClaudeAgentSDK(claudeSDK);\n```\n\nSee [Braintrust Claude Agent SDK docs](https:\u002F\u002Fwww.braintrust.dev\u002Fdocs\u002Fintegrations\u002Fsdk-integrations\u002Fclaude-agent-sdk) for details.\n",{"name":5,"version":24,"description":25},"1.1.0","Automatically trace Claude Code conversations to Braintrust for observability.\nCaptures sessions, conversation turns, and tool calls as hierarchical traces.\n","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","05-技能与代理开发\u002Ftrace-claude-code",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill trace-claude-code",{"tool":40,"command":41},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill trace-claude-code",{"tool":43,"command":44},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill trace-claude-code","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F05-技能与代理开发\u002Ftrace-claude-code\u002FSKILL.md",true,[],[49,56,61,68,75,82],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":57,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]