Control the bill
Operate Claude Code in production
Operating Claude Code after rollout means watching four signals: spend (/usage and the OpenTelemetry cost metrics), session health (claude doctor and /context), the performance of the code Claude Code ships, and the security of that code. Each signal has an owner in the table below and a page, so nobody has to watch sessions.
This hub is for developers and tech leads who own Claude Code for a team after the first month: the token bill has doubled, one teammate’s sessions behave differently, and a security reviewer asks what the agent touched last week. Commands were checked against Claude Code v2.1.283 on the latest channel.
Which Claude Code operate page answers your question?
Section titled “Which Claude Code operate page answers your question?”| Your question | Page |
|---|---|
A session ignores CLAUDE.md, a permission rule does not apply, or an MCP server is dead. | Troubleshoot a Claude Code session |
| Where does the money go, and how do I cap it? | Claude Code cost control for teams |
| How do I add logging, tracing and alerts to my application? | Observability setup with Claude Code |
| How do I find slow queries, heavy bundles and slow endpoints? | Application performance analysis with Claude Code |
| How do I cut tokens and latency without losing quality? | Claude Code performance optimization |
| How do I audit a codebase for vulnerabilities and prove the findings? | Security audits with Claude Code |
Agent telemetry for every tool (traces, tool calls, audit retention) lives in observing the agents, cost per accepted change in the economics of agent-built software, and model prices on the models hub.
How do you set an operating baseline for Claude Code?
Section titled “How do you set an operating baseline for Claude Code?”Do this once per team, before tuning.
-
Check the install and the release channel. In a terminal, run
claude --versionandclaude doctor./doctorin a session can also fix issues. Record the version: on 2026-09-26 thelatestchannel was v2.1.283 and thestablechannel v2.1.274, and the Opus 5.5 default needs v2.1.280 or later. -
Read your own spend. In a session,
/usageshows session cost, plan limits and activity./contextshows how much of the context window each part of the session uses. -
Turn on telemetry, and prove it arrives. Start with the console exporter to see a datapoint before wiring a collector:
Terminal window export CLAUDE_CODE_ENABLE_TELEMETRY=1export OTEL_METRICS_EXPORTER=consoleexport OTEL_METRIC_EXPORT_INTERVAL=10000claudeWithin about 10 seconds of your first prompt, a
claude_code.session.countdatapoint prints. Then switch toOTEL_METRICS_EXPORTER=otlpwithOTEL_EXPORTER_OTLP_ENDPOINT, and put the same variables in theenvblock of managed settings so every developer reports. Cost arrives asclaude_code.cost.usage(USD) and tokens asclaude_code.token.usage. -
Cap every unattended run. Headless jobs take a budget:
claude -p "…" --max-budget-usd 2.00. It works only with-p(--print); interactive sessions need plan limits instead. -
Fix the model policy in managed settings.
availableModelsandmaxEffortLevelcap model choice and effort, andautoUpdatesChannelkeeps native installs on one release channel.
How do you know Claude Code is operating well without watching sessions?
Section titled “How do you know Claude Code is operating well without watching sessions?”Read owned signals, not transcripts; open a session only when a signal points at it.
| Signal | Where it comes from | What healthy looks like | Owner |
|---|---|---|---|
| Spend | claude_code.cost.usage per user; claude_code.session.count proves every developer reports | Stable cost per active developer week to week. Anthropic’s typical enterprise figure is “around $13 per developer per active day and $150-250 per developer per month” (Claude Code costs docs, checked 2026-09-26) | Tech lead |
| Session health | claude doctor after upgrades; /context in long sessions | No errors; one release channel across the team | Each developer |
| Performance of shipped code | Your application’s traces and error rate | No regression after a Claude Code change | On-call engineer |
| Security of shipped code | /security-review and your scanners on each pull request | Every high finding has an exploit test or a documented dismissal | Code owner |
The stage before this one is review and ship with Claude Code.
What breaks when Claude Code runs every day?
Section titled “What breaks when Claude Code runs every day?”| Symptom | Cause | Recovery |
|---|---|---|
| Spend rises while output does not | Long sessions carry stale context; many MCP servers add tools to every session | Check /context, start a fresh session per task, remove unused servers; see performance optimization |
| A CI job costs far more than planned | A headless run has no budget | Add --max-budget-usd to every claude -p call and fail the job when it trips |
| The telemetry dashboard is empty | CLAUDE_CODE_ENABLE_TELEMETRY or an exporter is unset | Rerun with the console exporter; if nothing prints, run claude --debug-file /tmp/cc.log and search it for [3P telemetry] |
| One teammate gets a different default model | Different release channels: the Opus 5.5 default needs v2.1.280, which stable had not reached on 2026-09-26 | Compare claude --version. autoUpdatesChannel in managed settings steers only auto-updating native installs; for Homebrew use the claude-code@latest cask (or claude-code for stable), for npm the matching dist-tag |
| A vulnerability ships in an agent-written change | Security review ran only when someone remembered | Make the audit a pull-request gate; see security audits with Claude Code |
Where to go next with operating Claude Code
Section titled “Where to go next with operating Claude Code”Observe the agents
Set team policy
Across all tools
For other agents, see operate Codex and operate Cursor.