Skip to main content
Applies to:
  • Plan -
  • Deployment -

Summary

Issue: Claude Code tracing appears to succeed but logs never appear in Braintrust, and ~/.claude/state/braintrust_hook.log is never created. Cause: The trace-claude-code plugin is not installed or not registered — the braintrust plugin (for querying Braintrust from Claude Code) is a separate plugin and does not register tracing hooks. Resolution: Install the trace-claude-code plugin and verify hooks are registered before testing tracing.

Resolution steps

Step 1: Distinguish the two plugins

Two separate plugins exist:
  • braintrust — lets you query Braintrust from within Claude Code
  • trace-claude-code — registers the hooks that send Claude Code sessions to Braintrust Logs
Both can be installed simultaneously. Missing logs means trace-claude-code is not loaded.

Step 2: Check which plugins are installed

Exit any running Claude Code session and run from your terminal:
If trace-claude-code is not listed, install it:

Step 3: Verify hooks are registered

Fully restart Claude Code, then run /hooks inside a session. Confirm trace-claude-code appears with all five hooks and source: Plugin:
  • SessionStart
  • UserPromptSubmit
  • PostToolUse
  • Stop
  • SessionEnd
If these are missing, the plugin is not loaded and tracing will not work regardless of environment variables.

Step 4: Confirm environment variables are set

Set any missing values and fully restart Claude Code after changing them.

Step 5: Enable debug mode and test

Start a fresh session with debug enabled:
Send one prompt, then exit. Check for hook activity:
If braintrust_hook.log still does not exist after this step, the hooks are not executing. Review the debug file for errors about skipped or failed hook commands.

Step 6: View logs in the correct URL

The setup helper may print an incomplete URL. Use the correct pattern to find your logs:
Example: