Skip to main content
Trace every Claude Code request — model calls, tool calls, sub-agents and token usage — with the traceroot Claude Code plugin.

Install

The plugin runs its hook with uv (recommended) or Python 3.11+ with the traceroot package installed.

Set up

Claude Code asks for the plugin settings when you install it and stores the API key in your OS keychain. To check or change them later, run /plugin in Claude Code, or from a terminal:
An environment variable with the same name is used only when the plugin setting is empty. Settings with a default always have a value, so an export won’t change them; set them in the plugin settings instead. Restart Claude Code after changing them.

Usage

Use Claude Code as usual. Each request you send becomes one trace, sent when Claude Code finishes responding (after any sub-agents report back). Traces from the same session share a session ID.

Verify

Send one request in Claude Code and confirm the trace arrives:
  1. In the traceroot UI: Navigate to Tracing > Traces in traceroot Cloud. You should see a trace with root span Claude Code Turn.
  2. Via the CLI: Run traceroot traces list to inspect your recent traces from the terminal.

What gets captured

Prompts, tool inputs and tool outputs are sent as they are, including file contents and command output. Nothing is redacted. See Data Capture and Privacy.

Limitations

  • No user ID is recorded, so traces don’t appear on the Users page.
  • If no trace arrives, turn on Debug logging in the plugin settings and check ~/.claude/state/traceroot/debug.log. Without an API key the plugin does nothing.

Run the example

traceroot-claude-code-plugin

Source and full settings

Next steps

Sessions

See a whole Claude Code session as one timeline.

Data Capture and Privacy

Control what leaves your machine.