Put Claude Code's OpenTelemetry variables in the env block of managed-settings.json and deploy it to every developer machine. The file lives at /Library/Application Support/ClaudeCode/ on macOS, /etc/claude-code/ on Linux and C:\Program Files\ClaudeCode\ on Windows, or you can push the same JSON through Jamf, Intune or the Claude Team and Enterprise admin console. Add team.id in OTEL_RESOURCE_ATTRIBUTES for each team, run one prompt, and check that it appears in Ganivra under the developer's name.
Why use managed settings for Claude Code telemetry?
- Every machine reports. Shell profiles depend on each developer remembering, and a missing developer looks the same as one who spent nothing.
- Developers can't override it. Managed settings sit above command-line, project and user settings. When they set an
OTEL_EXPORTER_OTLP_*variable, Claude Code removes conflicting developer-set variables at startup. - Repositories can't do it. Claude Code ignores the OpenTelemetry exporter variables in a repository's
.claude/settings.json, so committing them to your repos won't turn telemetry on.
Anthropic's monitoring docs name managed settings as the way administrators configure telemetry for all users.
Which settings turn on Claude Code cost tracking?
Seven environment variables, set in the env block. Replace the key with one from Profile & setup in Ganivra.
{
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_LOGS_EXPORTER": "otlp",
"OTEL_METRICS_EXPORTER": "none",
"OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
"OTEL_EXPORTER_OTLP_ENDPOINT": "https://api.ganivra.com/v1/otlp",
"OTEL_EXPORTER_OTLP_HEADERS": "Authorization=Bearer gv_live_...",
"OTEL_LOGS_EXPORT_INTERVAL": "60000"
}
}| Variable | Value | Why |
|---|---|---|
CLAUDE_CODE_ENABLE_TELEMETRY | 1 | Turns telemetry on. Required. |
OTEL_LOGS_EXPORTER | otlp | Sends Claude Code's events, including one api_request event per model call with its model and tokens. |
OTEL_METRICS_EXPORTER | none | Metrics aren't needed: each event already carries the tokens Ganivra prices. |
OTEL_EXPORTER_OTLP_PROTOCOL | http/protobuf | Claude Code has no default protocol. Ganivra accepts HTTP (protobuf or JSON), not gRPC. |
OTEL_EXPORTER_OTLP_ENDPOINT | https://api.ganivra.com/v1/otlp | Where events go. The exporter adds /v1/logs itself. |
OTEL_EXPORTER_OTLP_HEADERS | Authorization=Bearer gv_live_... | Your Ganivra workspace key. It decides which workspace receives the usage. |
OTEL_LOGS_EXPORT_INTERVAL | 60000 | Batches events once a minute instead of every 5 seconds, the default, to keep a large team's traffic low. |
Use one workspace key for the whole company and tell teams apart with attributes, so all coding-agent spend lands in one workspace. Anyone with access to a machine can read the file, so treat the key like any other deployed secret, and replace it everywhere if it leaks.
Where do Claude Code managed settings go?
Pick the delivery method your IT team already uses. Each one carries the same JSON.
| Method | Location |
|---|---|
| macOS file | /Library/Application Support/ClaudeCode/managed-settings.json |
| Linux and WSL file | /etc/claude-code/managed-settings.json |
| Windows file | C:\Program Files\ClaudeCode\managed-settings.json |
| macOS device management (Jamf, Kandji and others) | Configuration profile for the com.anthropic.claudecode preferences domain |
| Windows device management (Intune, Group Policy) | A Settings value (REG_SZ) holding the JSON, under HKLM\SOFTWARE\Policies\ClaudeCode |
| Claude Team or Enterprise admin console | Organization settings > Claude Code > Managed settings (Owner or Primary Owner role) |
The file-based option also reads every *.json file in a managed-settings.d directory next to managed-settings.json, merged in alphabetical order. Admin-console settings need a Claude Team or Enterprise plan. Details: managed settings and server-managed settings.
Which managed settings source wins?
When a machine gets settings from more than one method, Claude Code by default uses only the highest-ranked source that delivers any setting and ignores the rest. From highest to lowest:
- The Claude admin console (server-managed settings)
- Device management: the macOS profile or the HKLM registry key
- The
managed-settings.jsonfile andmanaged-settings.ddirectory - The HKCU registry key on Windows
The common mistake: if someone already set any policy in the admin console, a managed-settings.json file you deploy with telemetry is ignored entirely. Either put the telemetry variables in the same source, or switch Claude Code to merge mode, which needs Claude Code 2.1.242 or later. Within the env block, a managed value overrides the same variable in user and project settings (settings precedence).
How do I label each team's Claude Code spend?
Add OTEL_RESOURCE_ATTRIBUTES. Ganivra groups spend by team.id, team or cost_center, in that order, and keeps other keys as filters. With files, deploy the shared settings above everywhere and a small per-team file such as managed-settings.d/50-team.json:
{
"env": {
"OTEL_RESOURCE_ATTRIBUTES": "team.id=payments,cost_center=eng-142"
}
}With device management, use one profile per team group instead. Follow the format rules from Anthropic's docs:
- Comma-separated
key=valuepairs, with no spaces:team.id=data-platform, or percent-encode, as inteam.id=data%20platform. - Quotes don't escape spaces:
team.id="Data Platform"keeps the quotes in the value. - Developers with no team attribute appear under No team in Ganivra, so gaps are easy to spot.
Will Ganivra know which developer made each request?
It depends on how developers sign in:
- Claude Team, Enterprise or another Claude account: each event carries the developer's email, and Ganivra shows spend under it. No extra setup.
- An API key, Amazon Bedrock, Google Vertex AI or Microsoft Foundry: there's no Claude account in the session, so Claude Code sends only a random per-install ID. Spend still adds up by team, but developers appear as IDs rather than names.
For the second group, add ganivra.user_id to each machine's attributes, for example from your device-management tool's per-user variables or a login script that writes the per-machine file:
"OTEL_RESOURCE_ATTRIBUTES": "team.id=payments,ganivra.user_id=priya.n"What do developers' machines send?
With the settings above, each model request sends its model, input, output, cache-read and cache-write tokens, timing, session and the developer's identity. Prompt text, responses and tool details are redacted by default and stay redacted unless someone sets OTEL_LOG_USER_PROMPTS, OTEL_LOG_ASSISTANT_RESPONSES or OTEL_LOG_TOOL_DETAILS. Leave all three unset: cost tracking doesn't need them, and Ganivra reads only the usage fields. Telling developers this up front avoids most rollout pushback.
How do I check every developer is reporting?
- 01Test one machine
Run any prompt in Claude Code. Within a minute or two, the request appears in Ganivra under Executions with an ID starting
cc-. - 02Check names and teams
Open the Coding agents tab and group by developer, then by team. Look for No team or unnamed IDs.
- 03Compare with your headcount
After a week, compare the developers reporting with the people who have Claude Code seats or keys. Anyone missing either hasn't used it or isn't covered by the policy.
- 04Debug a silent machine
Start Claude Code with
claude --debug-file <path>and look for[3P telemetry]errors. Check the protocol ishttp/protobuf, not gRPC, and that no higher-ranked settings source is hiding your file.
One exception to know: in sessions started from the Claude desktop app, a variable already set in the launch environment takes precedence over settings files.
What does a safe rollout look like?
- Pilot: five developers on one team for a few days. Confirm names, teams and costs look right.
- One department: deploy the shared file and per-team files through device management. Fix any No team rows.
- Everyone: roll out company-wide and announce what is and isn't collected.
- Use the data: after two to four weeks, use cost per developer at API rates to decide between Team seat tiers and API billing. See Claude Code Team seats vs API.
For the single-developer version of this setup, see how to track Claude Code cost per developer, and the integration guide for every option.
Claude Code managed settings: frequently asked questions
What are Claude Code managed settings?
Managed settings are an organization-wide Claude Code configuration that administrators deploy to developer machines. They take precedence over user, project and command-line settings, and an env block in them sets environment variables, such as the OpenTelemetry exporter settings, for every Claude Code session on the machine.
Where is the Claude Code managed-settings.json file?
On macOS it is /Library/Application Support/ClaudeCode/managed-settings.json, on Linux and WSL /etc/claude-code/managed-settings.json, and on Windows C:\Program Files\ClaudeCode\managed-settings.json. You can also deliver the same JSON through a macOS configuration profile, the Windows registry, or the Claude Team or Enterprise admin console.
Can developers turn off telemetry set in managed settings?
Not through their own settings files. A managed env value overrides the same variable in user and project settings, and when managed settings set an OTEL_EXPORTER_OTLP_* variable, Claude Code removes conflicting developer-set variables at startup. One exception: in sessions launched from the Claude desktop app, a variable already set in the launch environment takes precedence over settings files.
Can I enable Claude Code telemetry in a repository's .claude/settings.json?
No. Claude Code ignores the OpenTelemetry exporter variables in a repository's .claude/settings.json and .claude/settings.local.json, so a repository can't turn telemetry on or choose where it goes. Use managed settings, or each developer's shell or ~/.claude/settings.json.
Does Claude Code telemetry send prompts or code?
Not by default. Prompt text is redacted unless OTEL_LOG_USER_PROMPTS=1 is set, responses unless OTEL_LOG_ASSISTANT_RESPONSES=1 is set, and tool details unless OTEL_LOG_TOOL_DETAILS=1 is set. Leave all three unset for cost tracking: Ganivra only reads the model, token counts, timing and identity fields.
How do I give each team its own label?
Set OTEL_RESOURCE_ATTRIBUTES, for example team.id=payments,cost_center=eng-142, in a second file in the managed-settings.d directory, or in a separate device-management profile per team. Values can't contain spaces or commas; percent-encode anything else outside plain ASCII.
How do I check the rollout worked?
Run one prompt on a managed machine. Within a minute or two, the request appears in Ganivra under Executions with an ID starting cc-, and on the Coding agents tab under the developer and team. If nothing arrives, start Claude Code with claude --debug-file <path> and look for [3P telemetry] errors in that file.
One file, every developer
See Claude Code spend for your whole team.
Start a 14-day Ganivra trial, deploy the settings, and see cost by developer, team and model. No credit card required.