npx langwatch claude on each engineer’s machine. LangWatch then collects the OpenTelemetry that Claude Code already emits into one place that splits it by person, project and pull request.
Instead of the command on every machine, one managed settings file can cover the whole fleet. Both work on Claude Max and Pro plans as well as on API keys.
With the per-machine setup, each engineer’s sessions, prompts included, land in a project only they own. You get the cost numbers per person; reading a session itself takes an audited admin path, and the organization can drop the prompts before they are stored. To start now, go to Connect each engineer.
What you can answer once it is running
From a monthly invoice you get the total. Once every machine reports, you can also answer the questions finance and the team actually ask:
Codex, GitHub Copilot, Gemini CLI, opencode, Grok CLI and pi report the same way, so a team that mixes agents reads one set of numbers.
1. Connect each engineer
Each engineer runs this once:- Using a Claude subscription keeps the engineer’s own Max or Pro plan and login. LangWatch receives only the telemetry.
- Using an API key routes calls through the LangWatch AI Gateway with a virtual key, which makes cost exact and spend caps enforceable. See Cap spend.
claude works as usual. To wire the machine without the wrapper, run npx langwatch instrument claude, which writes the telemetry settings into ~/.claude/settings.json. It does not route calls through the gateway, so budgets do not stop those calls.
2. Pick where sessions land
By default each engineer’s sessions go to their personal project. That is the right place for day-to-day work: the engineer reads their own sessions, and the organization still counts their spend. When the work belongs to a team, such as an application everyone works on or a shared build machine, pin Claude Code to a team project instead:3. Roll it out to every machine
For a managed fleet, put the telemetry settings in Claude Code’s managed settings file and distribute it with your device management system. Its values take precedence over each user’s own settings. The file lives at:- macOS:
/Library/Application Support/ClaudeCode/managed-settings.json - Linux and Windows Subsystem for Linux:
/etc/claude-code/managed-settings.json - Windows:
C:\ProgramData\ClaudeCode\managed-settings.json
env block as ~/.claude/settings.json, with a project ingest key (ik-lw-...) in the OTLP header. An ingest key can only send traces, so it is safe on every laptop. Manual OpenTelemetry setup lists every variable, and Headless machines and CI covers build agents and servers.
4. Cap spend
How hard a cap you can set depends on the path from step 1:
On the API key path set up by
npx langwatch claude, every call is a gateway request, so the gateway’s budgets apply: a personal budget per engineer, or a budget on a team or project. See Cap LLM spend per team.
What engineers can expect
Engineers will ask who can read their sessions, so the answer belongs in the rollout email. By default the setup sends prompts and tool activity along with the numbers, so each engineer can replay their own sessions. Then:- Their sessions land in a project only they own. Teammates see them only in a team project the tool was pinned to. A managed settings file with one ingest key sends every machine to that key’s project instead, so say which project in the email.
- Admins see spend as numbers. Cost per person and per team, with no conversation content in it.
- Reading a session as an admin is never silent. It goes through one audited path that shows a banner for the whole visit, and the engineer can read the audit log.
- The organization can drop the content entirely. Set input, output and system instructions to Drop in the data privacy policy, and LangWatch strips the content before it is stored. Cost and token numbers keep working. See no-spy mode.
[SECRET] at ingestion by default. See Privacy.
Questions about LangWatch for Claude Code
Does LangWatch track Claude Code on Max and Pro plans
Yes. The subscription path keeps the engineer’s plan and login and sends only telemetry. Cost there is Claude Code’s own estimate.How is LangWatch different from the analytics in my Anthropic account
LangWatch works per session: it replays what the agent did, shows where the context and the cache cost went, and adds up every session behind a pull request, across Claude Code and the other coding agents your team uses.Can we self-host LangWatch for Claude Code telemetry
Yes, point the OTLP endpoint at your own instance followed by/api/otel. See Self-hosting.
Next, run npx langwatch claude on your own machine and open Sessions to see what your engineers will see, then read Reduce coding agent cost for what to change once the numbers are in.