cost-xray

cost-xray is a skill for Claude Code from agentic-control-plane/codex-acp-plugin. It costs 43 tokens per session (980 once invoked), scanned A, original, MIT.

A report format for examining where a coding agent's model usage and spending come from, using metering data from the Agentic Control Plane.

In plain words
What is it for?
Use it before deployment or when costs rise to review runs, trace individual steps, rank cost problems, and identify changes that may reduce spending.
Why use it?
It separates total spend into areas such as cached input, context, tool output, and repeated loops, making unexpected costs easier to investigate.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions subagents.

Good fit Use it before deployment or when costs rise to review runs, trace individual steps, rank cost problems, and identify changes that may reduce spending.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/agentic-control-plane/codex-acp-plugin/cost-xray
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add agentic-control-plane/codex-acp-plugin --skill cost-xray
Clone the repo
git clone --depth 1 https://github.com/agentic-control-plane/codex-acp-plugin

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cost-xray

README.md
[![agentmods](https://agentmods.dev/badge/skills/agentic-control-plane/codex-acp-plugin/cost-xray/github.svg)](https://agentmods.dev/skills/agentic-control-plane/codex-acp-plugin/cost-xray)
Your own site
<a href="https://agentmods.dev/skills/agentic-control-plane/codex-acp-plugin/cost-xray"><img src="https://agentmods.dev/badge/skills/agentic-control-plane/codex-acp-plugin/cost-xray/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cost-xray

Your own site · 80×15
<a href="https://agentmods.dev/skills/agentic-control-plane/codex-acp-plugin/cost-xray"><img src="https://agentmods.dev/badge/skills/agentic-control-plane/codex-acp-plugin/cost-xray.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 980 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.00980
Opus 5.5 $0.00017 $0.00392
Sonnet 5.5 $0.00009 $0.00196
Haiku 4.5 $0.00004 $0.00098

Measured 2mo ago against content hash 1fb3bcbd1257, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cost-xray scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/cost-xray/SKILL.md · 53 lines

How it starts

The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cost X-ray

Produce a ranked, evidence-backed report on where this agent's model spend goes and what to change. ACP sits in the request path, so it sees composition (cache blend, context breakdown, per-tool output bytes, loop share) — not just totals. Your job: pull the data, run the decompositions below, and deliver a report the user can act on before scaling to production.

Data sources (in order of preference)

  1. ACP MCP tools if connected: acp_optimize (composition), acp_trace (one run's steps), acp_recommendations (policy findings), acp_cost (spend by model).
  2. REST fallback with the key in ~/.acp/credentials (or ~/.acp/proxy-key):
    • GET https://api.agenticcontrolplane.com/api/v1/runs?window=7d — run rollups
    • GET https://api.agenticcontrolplane.com/api/v1/runs/{runKey} — one run with ordered steps
    • GET https://api.agenticcontrolplane.com/api/v1/introspect/cost-insights?window=7d — ranked recommendations Auth: Authorization: Bearer <key>.

Analysis steps

  1. Headline: total cost, run count, window. If byoAuth, label costs "@ API rates" (subscription traffic priced at what it would cost).
  2. Cache economics — decompose before concluding. A low headline hit rate has at least four distinct causes with different fixes. Compute from step data (model, tMs, promptTokens, cachedTokens):
    • per-model hit rate — Anthropic caches are per-model; if one model is cold, switching is the cause → route or batch by model;
    • hit rate by gap since the previous same-model call (<1min / 1–5min / 5–60min) — decay over gaps = TTL expiry → schedule work closer together or accept it;
    • full-price share immediately after a model switch — high = switching cost, low = rules it out;
    • uniform ~50% across models and gaps = structural: likely cache writes of new tool output being counted as misses (heavy tool-result appending), or genuine prefix instability. Say which is more consistent with the context composition, and say what you cannot distinguish from the data.
  3. Context composition: system vs history vs tool-results share. If tool results dominate, name the top tools by re-read bytes (toolResultBytesByTool) and the worst offender's MB.
  4. Loop share: report the number. Only recommend a subagent split for autonomous agents (background/api tier) — for interactive agents the growing loop IS the work.
  5. Failure waste: only from runOutcome === "failed" runs. Runs without a terminal outcome NEVER get a waste claim.
  6. Recommendations: merge /cost-insights items, ranked by impactUsd.

Read the full file on GitHub · 53 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 53 lines · 43 tokens per session scan A 1fb3bcbd1257

Subscribe to this mod's changes

cost-xray is a skill published in the GitHub repository agentic-control-plane/codex-acp-plugin (1 stars, last pushed 12d ago), licensed MIT. It adds 43 tokens to every session and 980 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

cost-xray compared with skills from other repositories

cost-xray next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cost-xrayagentic-control-plane/codex-acp-pluginSkill112d agoMITA43Claude Code
safedepsaldegad/safedepsSkill2523d agononeA62Codex
token-goatDFKHelper/token-goatSkill146yesterdaynoneA57Claude Code
steviktorinkov/shookSkill42mo agononeA60Claude Code
deepseek-vision-bridgekoco-co/deepseek-vision-bridgeSkill13mo agononeA70Claude Code
jp-harness-tuneSora-bluesky/ja-output-harnessSkill16mo agoMITA86Claude Code, Codex
agent-qa-testingvibeeval/vibecosystemSkill5373d agoMITA58Claude Code, Codex