Documentation menu
DocsInternal spend

Claude Code

Configure Claude Code telemetry for trAIce Internal Spend.

View source

Run the complete setup:

Shell
npx @traice/collector@latest setup

Choose Claude Code when prompted. Setup starts browser authorization when needed, patches user-level ~/.claude/settings.json, installs a background user service, and reports the result. It is safe to rerun. Add --no-browser for SSH, or --no-service if another process manager will run collection.

Restart every running Claude Code session after setup. Sessions that were already running do not reload the telemetry environment written to ~/.claude/settings.json.

Verify configuration, credentials, service state, the local listener, and server access:

Shell
npx @traice/collector@latest status

To run the collector in the foreground instead:

Shell
npx @traice/collector@latest collect --agent claude-code

Claude Code should export OTLP HTTP JSON to:

Text
http://127.0.0.1:4318

Prompt logging is off by default. Only pass --include-prompts when your organization has explicitly approved prompt collection. See Privacy.

Run continuously

Use the native service definitions in the Codex guide, replacing --agent codex with --agent claude-code. Credentials remain in Keychain, Credential Manager, Secret Service, or the protected-file fallback; never place a credential in a plist, systemd unit, or Windows Startup launcher.