Job-Level Spend Visibility When Engineering Managers Need to Chargeback Cursor and Claude Code Runs by Team

Track AI coding spend to teams and jobs with per-run attribution instead of pooled dashboards.

· 9 min read
Cover illustration for “Job-Level Spend Visibility When Engineering Managers Need to Chargeback Cursor and Claude Code Runs by Team”
Cloud Agent Licensing · October 29, 2026 · 9 min read · 2,074 words

Per-run agent cost attribution for engineering teams requires a record of each run’s job, user, session, and team, captured below the billing dashboard. Native Cursor and Claude Code reports provide parts of that record, but not the complete join. Instrumenting individual agent runs, reconciling their costs to vendor billing, and linking them to shipped work turns pooled spend into defensible team chargeback.

Why native billing dashboards for Cursor and Claude Code cannot produce team-level chargeback

An engineering manager has a billing dashboard open in one tab and a cost center spreadsheet in another, with no join between them. Neither view supplies the missing execution record. Cursor’s team analytics page focuses on adoption and accepted code, while its Admin API supplies per-member billing-cycle spend rather than allocations by team, project, or job. Knowing which member incurred a charge does not establish which team’s work produced it.

Claude Code separates these views in a similar way. Its Team and Enterprise dashboards show activity and accepted lines, while a separate spend report shows the cost for each user. The Claude Code Analytics API returns records for each user each day, with no job tag or team rollup. The separate Claude Enterprise Analytics API supports group-level rollups through rbac_group_id, but a group total still does not identify individual jobs.

The gap follows the vendors’ units of account. Both products combine seats with token-based usage charges, but their native views provide no shared billing unit for cross-tool totals. Engineering finance needs to assign those costs to teams and cost centers, with enough detail to explain each charge. This is an architectural mismatch.

What the spend actually looks like when it arrives unattributed

Microsoft gave about 12,000 engineers access to Claude Code in December 2025 and canceled those licenses by June 2026. Engineering dissatisfaction was not the reason. Finance could not keep paying token-based costs that worked differently from per-seat software licensing, and those costs were not going through infrastructure Microsoft controlled. Engineers were redirected to GitHub Copilot CLI, which exposes Claude models together with GPT and Gemini through Microsoft’s pricing and governance plane.

Uber’s CTO reported in April 2026 that his team had exhausted its entire 2026 AI coding budget in four months. These cases expose the limits of headcount-based budgeting. Token consumption grows with task complexity and agentic behavior, rather than simply with the number of licensed engineers. A focused code review and an autonomous refactor of a large codebase are different cost events, even when the same developer initiates both.

Multi-hour autonomous sessions can therefore produce meaningfully higher daily spend than interactive work. A seat count cannot anticipate that variance. A workspace aggregate cannot explain it afterward, because it lacks the task and session boundaries that distinguish one run from another. Without per-job visibility, the invoice provides the first signal of costs that still need reconciliation.

The four pieces of data a job-level attribution system actually needs

The Claude Code Analytics API is a useful starting point because it has token records for each user each day and an estimated cost for each model. It is not the destination. Defensible chargeback requires four fields captured together, namely job identity, user identity, session boundary, and team membership. If any one is missing, a team lead can dispute a charge that the reporting system cannot fully explain.

Job identity names the work the run did. It can be a feature branch, Linear issue ID, pull request number, or custom job label, so that cost is attached to a unit of work encompassing an assortment of API calls. User identity establishes who initiated that work through a per-developer virtual key or credential. A shared team key erases that distinction.

Session identity groups all the requests that belong to one agent run. A user tag alone cannot show what a particular PR review cost, because the same person may start several runs. Team membership supplies the remaining join from user to cost center, maintained outside the AI tool in an identity provider, HRIS, or configuration file and joined at reporting time. A fifth field, the resulting commit or pull request, lets this accounting record track what the work produced.

Where to capture those four fields in each agent run

Claude Code can export OpenTelemetry metrics, including token usage and estimated cost, to an observability backend. For teams with an OTel pipeline, this is the least-friction starting point. The Cursor Admin API also supplies per-request usage events with tokens and charged amounts, which can be joined to external team membership data. Neither source has the full record of the job and session, and each covers only its own tool.

The instrumentation gap sits between the agent CLI and its upstream API. An AI gateway places a common recording point on traffic routed through it. Claude Code can use that path through a configured ANTHROPIC_BASE_URL, with per-developer virtual keys preserving user identity and request metadata supplying job and session tags. LiteLLM tracks usage and spend across providers by key, user, team, org, tool, agent, and MCP.

The common instrumentation mistake is routing only the IDE plugin through the gateway while terminal CLI requests still reach Anthropic directly. That leaves chargeback blind to part of the traffic. The practical correction is to set ANTHROPIC_BASE_URL in the shell profile as well as in the IDE configuration. Shared team or organization keys create a separate blind spot by collapsing individual attribution.

The same gateway can enforce budgets before charges accumulate. LiteLLM uses max_budget in dollars and budget_duration, with windows such as "24h", "7d", and "30d", to reset spending counters automatically. Cross-tool accounting still needs normalization because Copilot moved to usage-based GitHub AI Credits in June 2026, while Codex draws on ChatGPT workspace credits. Those connections consolidate billing sources while leaving job-level metadata necessary.

Sandboxed per-job environments make attribution cleaner and cost boundaries harder to blur

A per-job environment gives the session boundary a concrete execution boundary. The run has somewhere distinct to begin and end. In a shared process, tasks can interleave, making the assignment of requests to jobs ambiguous. In a per-job VM or sandbox, the session ID and job tag applied at launch can accompany every request from that job.

Anthropic’s Claude Code includes a sandboxed Bash tool backed by @anthropic-ai/sandbox-runtime, while its cloud sessions run in full microVMs. Each cloud session has its own set of resources. The AgentBox SDK applies a related boundary in CI/CD by launching each agent as a server process inside a sandbox and communicating over WebSocket or HTTP. It supports Claude Code, Opencode, and Codex, allowing the attribution system’s job boundary to map directly to the runtime’s process boundary.

Cloud agent environments also give each run a pre-loaded VM with the team’s dependencies and tooling. Agents can install packages, run services, drive a browser, and verify their work within that environment. Those operations belong to a specific run. As a result, instrumentation can associate runtime activity with its source, harness, model, and credential without disentangling tasks on a shared host. Isolation makes attribution more precise, but the tags still have to be applied.

The showback-first sequence for rolling out team chargeback

Claude Code 2.1.268 added gateway pricing parity, so gateway configuration can make /cost and telemetry use negotiated rates in place of list-price estimates. Those rates establish the basis for internal reporting. Gateway request totals should then reconcile to the Claude Code Analytics API and Cursor Admin API before the first showback report goes out. A discrepancy at this stage is an accounting problem to resolve before invoicing a team.

Showback should precede chargeback by at least one billing cycle. Each team receives its number without commentary or an invoice attached. At one 12-person company, the engineering lead reduced spend in the first showback month by stopping three forgotten scheduled agent jobs that were costing around $900 between them. This period exposes forgotten runs, runaway loops, and duplicate subscriptions before their costs become disputed internal charges, while allowing the work itself to stay the same.

Session caps come next, before any markup. Claude Managed Agents supports dollar-denominated session budgets that pause a session with the stop reason budget_reached, preserving its files and state so that a higher cap can allow it to continue. A cap set at a modest multiple of the median session cost is a good place to start. Unlike retrospective reports, the cap bounds a runaway session while it is executing. The cap and rate belong in a managed policy file above user and project configuration, so a subagent cannot discard them when it drops other context.

Only trusted numbers justify moving to chargeback. Claude Code 2.1.271 supports a multiplier in the modelPricing managed setting, allowing platform teams to recover gateway operations and support overhead. During showback, the rate should stay straight pass-through. A modest markup can follow when it recovers genuine shared costs, while a large multiplier gives teams an incentive to bypass the internal platform. Because chargeback adds work for finance, the switch should come after the numbers reconcile cleanly and teams have had at least one showback cycle they trust.

How harness and model choice affect the cost basis before chargeback begins

Agent Teams sessions consume approximately 7x more tokens than standard sessions in the 2026 comparison described in the brief. Harness choice changes the cost basis substantially. A cross-team report that omits it can treat differences in execution strategy as differences in engineering efficiency. To compare chargeback figures, teams need to see both the task mix and the harness used to do the work.

A migration from Cursor to Claude Code mid-quarter can change a team’s reported cost without a corresponding reduction in output. That change needs its own label. Model selection adds another source of variance because Claude Sonnet 5.5 costs meaningfully less per token than Claude Opus 5.5 at API rates. Routing simpler completions to lighter models and reserving heavier models for complex reasoning can reduce costs, but a report without model tags cannot reveal which teams made that choice.

Pricing changes can also invalidate a previously correct formula. In June 2026, Cursor announced a change that would add a Premium Teams seat alongside the Standard seat, taking effect July 1, 2026 for customers who renew. Each tier tracks separate “Cursor Models” and “Other Models” usage pools. Cursor then ended flat-rate unlimited Auto mode on August 24, 2026, so each Auto request is billed at the list price of the model it is routed to.

The attribution layer must track which harness and model each run used. For teams using Claude Code, Cursor, OpenCode, or other harnesses, those labels distinguish tool decisions from productivity signals. They also meet finance’s accounting requirement to interpret a cost change without assuming that engineering did less work.

Connecting the cost record to the work that produced it

Chargeback identifies who spent what, but finance also needs to understand what shipped per dollar. The additional join is the output artifact. Native token bills show how much of the API was used but do not show what code shipped, so the session’s cost record needs a link to a commit hash or pull request. Without that link, the cost ledger and the engineering ledger remain separate.

At merge time, the job tag, session ID, and model label can be connected to the commit hash, producing a cost receipt with the model, input, output, and cached token breakdown, and dollar cost. TokenShift by PointFive connects task costs to outputs ranging from merged pull requests to discarded code. That distinction supports a cost-per-unit-of-work view of spending.

GitLab workflows have an artifact-side path as well. Claude Code v2.1.232 introduced initial GitLab support, including plugin marketplaces and token redaction, on August 13, 2026. Version v2.1.233 followed on August 14, 2026 with GitLab merge request support in --worktree and agent view. Those associations provide the merge-request join key for GitLab-hosted work, while cost instrumentation supplies the other side.

An unusually expensive commit can then be reviewed to see why it cost so much. Its task may have been complex, its agent inefficient, or its session poorly scoped, and the joined record gives that investigation a starting point. An engineering manager with attribution down to job, session, user, team, harness, model, and merged PR has the record finance needs for chargeback. Engineering leadership can use the same record to compare teams with similar task mixes and output rates, asking which teams get more from agent runs and what they do differently.

More in Cloud Agent Licensing