Setup Claude Code
Claude Code supports centrally-managed configuration through the Claude admin console. An administrator defines the settings once; Anthropic delivers them to every authenticated user on next startup. No per-developer install is required.
This is different for individual developer onboarding and does not cover historical backfill - please refer to this document for details on how to do that or go direct to https://github.com/revenium/revenium-cli-node
This page covers only the telemetry Claude Code sends from each developer's machine. Connecting the provider that bills for the tokens (Anthropic, Amazon Bedrock, Google Vertex AI, Microsoft Foundry) is a separate setup with its own page: see Provider Integrations.
Requirements:
Claude for Teams or Claude for Enterprise plan
Claude Code version that supports managed settings
Administrator role of Primary Owner or Owner in the Claude admin console
Direct connection to
api.anthropic.comto receive server-managed settings — configuration delivery only; telemetry does not transit AnthropicDirect connection to
api.revenium.aion port 443 from each developer machine for telemetry egress
Network Path: Configuration Delivery vs. Telemetry Egress
Configuration delivery and telemetry egress are two independent network paths. Telemetry does not transit Anthropic.
Configuration delivery (inbound) Telemetry egress (outbound)
Claude admin console (Anthropic) Claude Code process
| server-managed settings | OTLP / HTTP-JSON, ~5s batches
| delivered at sign-in |
v v
Developer machine ----------------------> api.revenium.ai:443
^ (direct TLS connection)
| ...or MDM / OS policy / settings file
| (never contacts Anthropic)Configuration delivery — how the
envblock below reaches the machine. With server-managed settings, Anthropic's servers deliver it at sign-in, which is whyapi.anthropic.comappears in the requirements above. With MDM, OS policy, or a managed settings file, Anthropic is not involved at all.Telemetry egress — Claude Code embeds the OpenTelemetry SDK and is itself the OTLP exporter. It opens a direct TLS connection from the developer's machine to the host in
OTEL_EXPORTER_OTLP_ENDPOINTand POSTs batches to/v1/logs. Anthropic does not receive, proxy, buffer, or store this telemetry.
Practical consequences:
Firewall and proxy rules must name
api.revenium.aiexplicitly. An allowlist entry forapi.anthropic.comdoes not cover telemetry egress; they are separate destinations.If the Revenium endpoint is unreachable, telemetry for that period may not reach Revenium. Claude Code continues to work normally.
Prompt and response content is redacted by default. The configuration below sends session, identity, model, token, and cost metadata; message bodies are exported as
<REDACTED>unless an administrator explicitly opts in using Anthropic's content-logging variables.
Steps:
Sign in to Claude.ai as Primary Owner or Owner.
Navigate to the Managed settings screen. Depending on plan and admin console version, this appears under Admin Settings → Claude Code → Managed settings or Organization settings → Claude Code → Managed settings.
Paste the following JSON, substituting your Revenium metering key.
Use a Revenium metering key (rev_mk_*) for Claude Code OTLP telemetry. Do not use an Anthropic/OpenAI provider key here; provider keys authenticate model calls, while the Revenium key authenticates telemetry ingest.
Save the managed settings.
Ask developers to fully quit and relaunch Claude Code after the config push.
On first launch after the settings are picked up, each developer may see a one-time security approval dialog listing the managed environment variables. They should approve the administrator-delivered configuration.
Verifying Your Configuration
Ask a developer to run a brief Claude Code session. Usage should appear in Revenium after the next telemetry flush. Your Revenium tenant is identified by the metering key, and Claude Code attaches the developer identity it knows for the session. If your organization uses direct API keys, Bedrock, Vertex, Microsoft Foundry, or a custom ANTHROPIC_BASE_URL, attach identity yourself with OTEL_RESOURCE_ATTRIBUTES.
If no sessions appear after configuring the settings, check:
The Revenium metering key is active in your Revenium account
The OTLP endpoint matches your Revenium environment
The developer fully quit and relaunched Claude Code after the config push
Still missing usage for some developers? See Troubleshooting.
Viewing merged pull requests by repository
When a GitHub integration is connected, select a person on the Claude Code dashboard to open their details. Where their PRs land groups that person's merged pull requests by repository for the selected time range and links to the matching pull requests on GitHub.
This repository breakdown covers GitHub only. GitLab merge requests can still contribute to the person's overall merged-PR figure, but they do not appear as per-repository rows.
Optional Internal Attribution
The resource attributes in a managed installation have one fixed value for everyone using it. Keep the required revenium.middleware.source=managed-settings value. To report spend by department, assign people through Departments; their individual usage is then grouped by department.
Skill Name Redaction
The Skills dashboard attributes estimated cost and usage to individual Claude Code skills. Two separate mechanisms can hide skill names in your dashboard:
Skill telemetry not enabled — recoverable. Claude Code only includes skill and tool details in telemetry when OTEL_LOG_TOOL_DETAILS is set to 1. Without it, skill executions are still metered, but they arrive without names and appear as Skills with details hidden in the dashboard. Add "OTEL_LOG_TOOL_DETAILS": "1" to the managed settings env block above and ask developers to fully quit and relaunch Claude Code. New sessions report full skill names; sessions recorded before the change stay redacted.
Plugin skills from outside Anthropic's official marketplace are named when skill telemetry is on. Claude Code removes these names from the cost records it sends. That includes skills from a marketplace your company runs. With OTEL_LOG_TOOL_DETAILS=1, it still sends each name on a separate record when the skill starts. Revenium pairs the two records to name the run. Runs recorded before the setting was on stay in a Plugin skills (names hidden) row, with a small number Revenium can't pair yet. Cost, run counts and user counts on that row are complete.
This is independent of prompt and response content redaction described above: enabling skill and tool details does not export message bodies. See Data Privacy for what is exported and what Revenium retains.
On the dashboard
Open Intelligence > AI Assistants > Claude Code to review spend, merged pull requests, people, findings, and seat and plan costs. See Claude Code Dashboard for the measures and how to read them.
Troubleshooting
Claude Code sends usage to Revenium only when it has the right telemetry settings. If some developers' usage is missing or looks too low, work through the checks below for one of those developers. Most of them happen on the developer's machine.
How the settings reach Claude Code
Your organization delivers the Revenium settings in one of these ways. Which ones you can use depends on your Claude plan.
Claude admin console (server-managed settings)
Claude Team and Claude Enterprise
Claude Code downloads them when the developer signs in with their Team or Enterprise account.
MDM configuration profile, Windows registry policy, or a managed-settings.json file on each machine
Any
Also applies when Claude Code uses Amazon Bedrock, Google Cloud, Microsoft Foundry or a custom ANTHROPIC_BASE_URL. Admin console settings are skipped in those cases.
See Setup Claude Code for the settings to deliver.
Step 1: Check the settings
1. The values are right
The env block you deliver (the full block shown earlier on this page) must contain at least these values:
CLAUDE_CODE_ENABLE_TELEMETRY
1
OTEL_EXPORTER_OTLP_ENDPOINT
https://api.revenium.ai/meter/v2/otlp
OTEL_EXPORTER_OTLP_HEADERS
x-api-key=<your team's Revenium metering key>
OTEL_EXPORTER_OTLP_PROTOCOL
http/json
OTEL_LOGS_EXPORTER
otlp
OTEL_METRICS_EXPORTER
none
The values people most often get wrong:
The endpoint must include
/meter. Revenium does not accept telemetry athttps://api.revenium.ai/v2/otlp.OTEL_LOGS_EXPORTERmust beotlp. Revenium reads Claude Code's usage from its log events. It does not accept the metrics signal (the endpoint answers410 Gone), so a machine that exports only metrics sends nothing Revenium can use.OTEL_EXPORTER_OTLP_PROTOCOLmust be set. Claude Code has no default protocol.The key must be your team's current metering key. Revenium metering keys start with
rev_mk_.
If you deliver settings from more than one place, the endpoint, the key and the protocol all come from one source: the admin console first, then MDM, then the managed-settings.json file. Claude Code never pairs an endpoint from one source with a key from another. So if the admin console sets a telemetry endpoint, a correct file on the machine has no effect on where telemetry goes.
If you use MDM or a settings file, check that the file or profile is on the machine:
managed-settings.json
macOS: /Library/Application Support/ClaudeCode/managed-settings.json
Linux and WSL: /etc/claude-code/managed-settings.json
Windows: C:\Program Files\ClaudeCode\managed-settings.json
MDM on macOS
The com.anthropic.claudecode managed preferences domain
Registry on Windows
A value named Settings under HKLM\SOFTWARE\Policies\ClaudeCode
Claude Code does not read the old Windows path C:\ProgramData\ClaudeCode\managed-settings.json. Extra .json files in a managed-settings.d folder next to managed-settings.json are merged in.
Admin console settings are delivered from Anthropic's servers, and Claude Code keeps a cached copy on the machine. To see whether they reached a machine, have the developer run claude doctor and read the Managed settings (remote) line, or use the end-to-end check in check 5.
2. Admin console only: the developer approved the settings
Because the Revenium settings name a telemetry endpoint, Claude Code in the terminal asks each developer to approve them in a security dialog. If the developer rejects them, Claude Code exits.
The prompt appears the next time Claude Code starts, or within an hour in a session that is already open. Changes to telemetry settings take effect only when Claude Code starts again, so after you change them, have developers fully quit Claude Code and start it again.
The desktop app's Code tab and headless runs (claude -p) cannot show the prompt. They apply the settings for that run without it.
Claude Code skips admin console settings when the developer's shell exports a CLAUDE_CODE_USE_* provider variable (for example for Amazon Bedrock or Google Cloud) or a non-default ANTHROPIC_BASE_URL. Use MDM or a settings file for those machines.
3. The developer is signed in with their work account
Revenium shows Claude Code usage under the email of the account Claude Code is signed in to.
Terminal: run
claude auth statusto see which account is signed in.Desktop app: in the Code tab, type
/statusto see the signed-in account.
If the email is a personal account, the usage arrives under that personal email. If Claude Code is not signed in with a Claude account at all, for example because it uses an API key or a cloud provider, contact support and we will check how that usage is attributed.
4. No leftovers from the old Revenium CLI
Older installs of the Revenium CLI set Claude Code up from the developer's shell. Remove what it left behind:
the file
~/.claude/revenium.env(for the fish shell,~/.claude/revenium.fish)the block in
~/.zshrc,~/.bashrc,~/.bash_profileor~/.config/fish/config.fishthat starts with# >>> revenium-claude-code-metering >>>and ends with# <<< revenium-claude-code-metering <<<. Delete both marker lines and everything between them.
While your managed settings reach the machine, they replace these values in the terminal. But wherever managed settings are missing, for example on a machine without your MDM profile or a terminal signed in to a personal account, Claude Code uses the values from these files instead, and they may hold an old key or endpoint.
If you plan to import past usage with the old CLI's backfill, contact support first.
5. Desktop app: confirm sessions arrive
When your organization uses the admin console, desktop app Code tab sessions in the Local environment pick up the Revenium settings with no setup on the machine. The developer needs to be signed in to the app with their Team or Enterprise account.
Check it end to end. This is the reliable test for the desktop app:
In the desktop app's Code tab, start a new session in the Local environment and send one short prompt.
In Revenium, open Logs, stay on the Transactions tab and click Advanced Filter.
On the Identifiers & Context tab, enter the developer's email in Subscriber Email. Allow a few minutes for the session to arrive.
Revenium stores the Claude Code session id as the Trace ID, so you can also filter by the session id shown by /status in that Code tab session.
If the session does not arrive:
Update the desktop app. Use the current version before you test telemetry settings.
Clear the local environment editor. Variables saved there are passed to every local session. Keep Revenium values out of it when your organization manages the settings, so there is only one place they come from. To open it: in the Code tab, open the environment dropdown in the prompt box, hover over Local and click the gear icon. The Edit local environment dialog has an Environment variables box in
.envformat. When it is empty it shows placeholder example text. An empty box is what you want when your organization uses managed settings. If it holdsOTEL_or other Revenium values, delete them.
Then fully quit the desktop app, open it again and repeat the end-to-end check.
Do not check by asking Claude in the Code tab to print its environment. Claude Code does not pass OTEL_ variables to the commands it runs, so they look missing even when telemetry is being sent.
Other places Claude Code runs from the desktop app:
Cloud sessions receive admin console settings. Files on the developer's machine do not reach them.
SSH sessions read the managed settings file on the remote host.
Cowork has its own OpenTelemetry form in the admin console. See Setup Claude Cowork.
6. Other machines
Claude Code on CI runners, servers and other computers sends usage only if Claude Code there gets the telemetry settings, either from your managed settings or from its own configuration. Contact support if you need help with those.
Step 2: Compare local usage with Revenium
If the settings are right and a developer's totals still look low, contact support. We will send you a script that the developer runs on their machine. It adds up the Claude Code usage recorded in the conversation transcripts Claude Code keeps locally, and writes a file for you to send back.
What the file contains:
dates and model names
numbers of requests and sessions
token counts: input, output, cache read and cache creation
a breakdown by how Claude Code was started, such as interactive terminal, headless
claude -p, or the desktop app's Code tabif you ask for them, Claude Code session ids and API request ids, with their times and token counts
What it never contains: prompts, responses, code, tool inputs or outputs, file paths, project or folder names, or git information. You can open the file in any text editor and check before sending.
One thing to expect when you compare:
Old terminal transcripts are deleted. Claude Code deletes transcripts older than its
cleanupPeriodDayssetting, which defaults to 30 days. Raising it keeps more history from then on, but does not bring back deleted files.
Step 3: Cross-check with Anthropic's reports
Anthropic's own reports show who uses Claude Code. Use them to find developers who use Claude Code but do not appear in Revenium.
Claude Team and Claude Enterprise
The Claude Code analytics dashboard at claude.ai/analytics/claude-code shows daily active users and sessions. Admins and Owners can view it. Once usage credits are turned on, the spend report lists token usage and estimated spend per user and per model.
Claude Enterprise only
The Enterprise Analytics API returns per-user usage.
Claude Console (API key)
The Claude Code dashboard at platform.claude.com/claude-code and the Claude Code Analytics API.
Step 4: Send us what you found
Send the following to support@revenium.io:
the email the developer signs in to Claude Code with
where they run Claude Code: terminal, desktop app, remote machines, scripts or CI
the files from the usage script, if you ran it, and the time zone used if not UTC
We will compare it with what Revenium received and tell you which sessions are missing and why.
Common causes
One developer shows nothing at all
The settings never reached the machine, or the endpoint is missing /meter
Check 1, then check 5.
A developer stopped appearing after you changed the admin console settings
They have not restarted Claude Code and approved the new settings
Check 2.
Usage appears under a personal email
Claude Code is signed in with a personal account
Sign out and sign in with the work account.
Terminal usage is there, desktop app usage is missing
Desktop app sessions are not sending telemetry to Revenium
Check 5.
Usage went to the wrong team
An old key in your managed settings, the local environment editor or the old CLI's files
Checks 1, 4 and 5.
The local transcripts have nothing for early dates
Claude Code deleted transcripts older than 30 days
Compare only the dates the transcripts cover.
Last updated
Was this helpful?