Track your Claude Code usage | LangWatch

Track your Claude Code Usage

Or Codex, OpenCode, Copilot, Cursor and Pi. Capture full trace history to improve your flow, and track how much you're spending in tokens.

Start tracking right away:

$npx langwatch claude

Star on GitHub

Ask AI

Features

Everything a session leaves behind, in the platform's own UI.

Cache hit tracking

Cache reads and writes are separate token classes on every span, down to the 5m and 1h TTL split on writes.

Tools, skills, MCP

Every Bash command, file edit, skill invocation, and MCP call is a span with a duration.

Claude Code can query it back

The MCP server exposes your traces to the agent itself: it inspects last week’s runs, finds where tokens go, and edits its own workflow.

Questions

How do I track my Claude Code usage?

Run npx langwatch claude. It configures Claude Code’s native OpenTelemetry export to LangWatch. Every session lands as a trace: model turns, tool calls, tokens by class, and theoretical cost.

Does it work with Codex, OpenCode, Copilot, Cursor, and Pi?

Yes. Each agent exports through the same OTLP endpoint, so everything lands in one store with the same token, cost, and trace treatment.

What does the "Bundled" cost label mean?

Sessions on a Claude subscription (Pro, Max, Team) have no per-token invoice. LangWatch marks those sessions Bundled and computes a theoretical total at API list prices, per token class.

Are cached tokens counted?

Cache read and cache write are separate token classes on every span, priced at their own rates.

What if I accidentally paste any secret keys on my Claude session?

API secrets are automatically redacted and never stored on the LangWatch side. PII is redacted the same way, so personal information does not end up in the trace.

One command, then keep working.

Free for individual use. Setup docs

$npx langwatch claude

Tools (continued)