> ## Documentation Index
> Fetch the complete documentation index at: https://braintrust.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code tracing not working after setup

export const plans_0 = "Any"

export const deployments_0 = "Any"

export const data_plane_version_0 = undefined

export const use_case_0 = "Use case - Claude Code users who completed setup but see no traces in Braintrust Logs because the trace-claude-code plugin hooks are not registered"

<Note>
  **Applies to:**

  * Plan - {plans_0}
  * Deployment - {deployments_0}
  * {data_plane_version_0}
  * {use_case_0}
</Note>

## 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:

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
claude plugin list
```

If `trace-claude-code` is not listed, install it:

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
claude plugin install trace-claude-code@braintrust-claude-plugin
```

### 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

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
echo $TRACE_TO_BRAINTRUST   # must be: true
echo $BRAINTRUST_API_KEY    # must be non-empty
echo $BRAINTRUST_CC_PROJECT # must match your target project name
```

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:

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
TRACE_TO_BRAINTRUST=true \
BRAINTRUST_CC_DEBUG=true \
BRAINTRUST_CC_PROJECT="your-project-name" \
claude --debug-file /tmp/claude-hooks-debug.log
```

Send one prompt, then exit. Check for hook activity:

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
tail -n 100 ~/.claude/state/braintrust_hook.log
tail -n 200 /tmp/claude-hooks-debug.log
```

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:

```
https://www.braintrust.dev/app/{org}/p/{project}/logs
```

Example:

```
https://www.braintrust.dev/app/Augment/p/LLM-Coding-Logs/logs
```
