agent_cost
Generate a multi-agent cost report from Claude Code transcripts: tokens, API cost, capacity intensity, and top runs. Use after a fan-out to review consumption or before to compare with the last run.
Instructions
Multi-agent cost report from Claude Code's own transcripts on this machine: tokens moved (cache read/write, fresh input, output), valued cost at API list prices (marked NOTIONAL on a subscription, UNPRICED when no rate matches), capacity intensity (subagents, failed, died at window, tool calls per agent, cache reuse), top runs, and context_burn / fanout_without_canary signals. Call it after a fan-out to read what it consumed, or before one to compare with the last. Thresholds come from .contextengine/policy.json agent_cost, else built-in defaults.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run | No | Filter by run id (wf_... or task group id) | |
| top | No | How many runs to list (default 10) | |
| days | No | Only runs started within the last N days | |
| json | No | Return the structured JSON report instead of the text one | |
| project | No | Filter by project slug as it appears in ~/.claude/projects (e.g. -Users-yan-Projects-ContextEngine) | |
| session | No | Filter by parent session id | |
| policy_dir | No | Absolute path of the repo whose .contextengine/policy.json supplies agent_cost thresholds and rates. Default: the MCP server's working directory, which under launchd is the home dir, not a repo; the report names which source it used on its 'thresholds:' line |