AI coding and agents

Agent Cost

Also known as Coding agent cost

By WeavePublished Updated 2 min read

Definition

Agent cost is the expenditure attributable to an AI agent's work over a defined task or period. It can include model usage, allocated subscriptions, tool and compute charges, and human supervision, depending on the stated accounting boundary.

Define the cost boundary first

Model cost usually combines the charged token categories at their applicable rates. Whole-task cost may also include hosted tool execution, sandboxes, subscriptions, and human review. Keep those categories separate so a reader can reproduce the total.

Telemetry and invoices answer different questions. Claude Code's monitoring documentation describes cost metrics as approximations and directs users to their provider for official billing. Reconcile estimates with billed usage before reporting financial totals. Claude Code monitoring documentation.

An allocation of a fixed subscription is a management-accounting choice, not another charge. Do not add API-equivalent token estimates to the full subscription bill for the same included usage unless those tokens were actually billed separately.

A hypothetical cost-per-task calculation

A team spends $120 in model charges and $30 in sandbox charges while attempting 50 tasks. Reviewers accept 40 results. Model-and-compute cost per accepted task is therefore $150 divided by 40, or $3.75. Dividing by all 50 attempts would instead produce $3 per attempt.

Suppose supervision and review take eight hours valued at an internal planning rate of $75 per hour. Including that $600 gives $750 divided by 40, or $18.75 per accepted task. These are illustrative figures, not a benchmark or a vendor price.

Both measures can be useful. The first examines runtime efficiency; the second examines the team's delivery process. Neither is ROI until compared with a credible alternative and a defined benefit.

Include failures and retries

Costs from abandoned attempts still belong in the numerator. Link subagent calls and retries to their parent task, retain the model and rate version, and record the final task outcome. Otherwise, an agent that produces one good patch after many discarded attempts can appear artificially cheap.

Check that the accounting period covers both the work and the corresponding charges. Provider reporting can help reconcile consumption across a billing period. Claude Console cost and usage reporting.

How this relates to Weave

Weave Token Intelligence connects AI-tool spending and adoption with engineering output. Keep subscription allocation and usage-based charges explicit when comparing agent-assisted work. The resulting association should not be treated as proof that an agent caused a productivity improvement.

Explore Token intelligence

Sources and further reading

  1. Monitoring usage, Claude Code documentation
  2. Cost and Usage Reporting in the Claude Console