Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "trace-claude-code",
"description": "Claude Code tracing only. Use the Braintrust Cursor plugin for Cursor tracing.",
"hooks": {
"version": 1,
"hooks": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ journaling, trace construction, and delivery.
## Supported surfaces

This plugin supports Claude Code CLI and Claude Code mode in the desktop app.
Cursor automatically imports installed Claude plugins when third-party imports
are enabled. This plugin includes a Cursor manifest with no hooks so that
Cursor uses the native Braintrust Cursor integration for tracing. Enable that
integration with `bt trace enable cursor --project <project>`.

It does not support the Cowork tab. Cowork executes hooks in a separate VM that
does not inherit the host's `bt` binary, saved Braintrust route, or credentials,
so installing this plugin there does not enable tracing.
Expand Down
9 changes: 9 additions & 0 deletions src/plugins/claude/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ check_json "$MARKETPLACE"
# Required files for each shipped plugin.
required=(
"plugins/trace-claude-code/.claude-plugin/plugin.json"
"plugins/trace-claude-code/.cursor-plugin/plugin.json"
"plugins/trace-claude-code/hooks/hooks.json"
)
for rel in "${required[@]}"; do
Expand Down Expand Up @@ -65,6 +66,14 @@ import sys
with open(sys.argv[1]) as f:
hooks = json.load(f)["hooks"]

# Cursor prefers its own manifest when importing an installed Claude plugin.
# An explicit empty hook config prevents fallback to the Claude hook file.
from pathlib import Path
plugin = Path(sys.argv[1]).parent.parent
cursor = json.loads((plugin / '.cursor-plugin/plugin.json').read_text())
assert cursor['name'] == 'trace-claude-code'
assert cursor['hooks'] == {'version': 1, 'hooks': {}}

expected_events = {
"PermissionDenied", "PostCompact", "PostToolUse", "PostToolUseFailure",
"PreToolUse", "SessionEnd", "SessionStart", "Stop", "StopFailure",
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/cursor/content/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Cursor's `PATH` when hooks run. `bt trace enable cursor` also installs capture
hooks in `~/.cursor/hooks.json`. These user hooks work with third-party imports
disabled and when a marketplace installation takes precedence over the local
plugin. Plugin hooks skip capture for events covered by these user hooks.
The Braintrust Claude Code plugin exposes no hooks when Cursor imports it;
Cursor tracing uses this integration's native hooks.

## Quickstart

Expand Down
Loading