qcost

Analyzes token spend across agent runs, separating cache-read from generated output costs.

Updated Aug 14, 2026
One-click install
npx skills add https://github.com/QSchlegel/session-viz --skill qcost-qschlegel
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: qcost
Source: https://github.com/QSchlegel/session-viz/tree/main/plugins/session-viz/skills/qcost
Command: npx skills add https://github.com/QSchlegel/session-viz --skill qcost-qschlegel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Token bills from coding agents are dominated by cache-read — context replayed to the model on every turn — which appears in no per-session view, so users cannot see where their money actually goes or which agent definitions drive the cost. ## Core Features & Use Cases - Token composition analysis: Runs node ${CLAUDE_PLUGIN_ROOT}/scripts/runs.mjs --cost to break down cache-read versus output tokens across Claude Code, Codex, and Cursor runs. - Sourced cost quoting: Fetches a dated rate card from the session-viz prices endpoint and only quotes money when the card is fresh, labelled with fetchedAt and source. - Agent family comparison: Surfaces the spread in cache-read per run between agent families, pointing to the editable prompt file responsible for the widest one. - Use Case: A user asks why their Claude Code bill is high; the skill shows that output is under half a percent of tokens, identifies which agent family replays the most context per run, and quotes an API-equivalent cost only if a fresh rate card exists. ## Quick Start Ask the assistant to run /qcost or ask where your token spend is going, and it will print the cache-read versus output breakdown for your recent agent runs.

Frequently Asked Questions about qcost

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I see where my Claude Code tokens are going?▼

Run /qcost, which executes the local runs.mjs --cost report over your transcripts. It breaks down cache-read versus output tokens per agent family, showing that cache-read typically dominates total spend.

Why is my AI coding agent bill so high?▼

The dominant cost is cache-read: context replayed to the model on every turn, which never appears in per-session views. Output text is usually under half a percent of tokens, so reducing replayed context per run is what lowers cost.

Does qcost work offline or without network access?▼

Yes, the cost report reads only local transcripts and prints to stdout. Without network access it simply cannot fetch the pricing rate card, so it reports token counts without any currency figures.

Can I trust the dollar amounts qcost reports?▼

Dollar figures are quoted only from a fetched, dated rate card and are labelled as API-equivalent cost, not actual subscription spend. If the card is missing or stale, no money is quoted at all.

What are the limitations of the qcost token report?▼

The report cannot distinguish 5-minute from 1-hour cache write TTL pricing, and totals may exclude harnesses with missing or partial token data. A 'not in these numbers' block prints whenever coverage is incomplete.