← ClaudeAtlas

measure-session-costlisted

Reports what a Claude Code session cost at API list prices, by phase, by model and by subagent, from its transcripts on disk, through a bundled script holding a dated price table. Prices each call's context, read from or written to the prompt cache, and its output; splits the session at each compaction and each idle gap over an hour; names every call that rewrote its context to the cache and why, whether the start, a compaction, an expired cache or a model switch; gives the context at the first call, before any work, and the tools called with the size of what they returned. Takes a session id or its start, the current session, or a repo's newest sessions, in every account's config directory. A model, speed or usage shape the table lacks is reported unpriced, never guessed. Reads only. Finding a session by what was said in it is find-session's. Typed only: measure-session-cost [id | --repo <folder> --last <n>].
wardawgmalvicious/claude-plugins · ★ 0 · AI & Automation · score 78
Install: claude install-skill wardawgmalvicious/claude-plugins
# Measuring what a session cost **A session's bill is its context times its calls, not its output.** Each API call re-reads everything before it from the prompt cache, and writes what is new, so a long session is dear because every call carries the whole conversation. Two work-issue sessions in a client repo cost about $23 and $11 at list prices, of which output was about $4, and resuming each after nine idle hours rewrote its whole context to the cache, about $5 between them (2026-11-05). The bundled script reads a session's transcripts and says where its cost went, so a change meant to lower it can be measured, not assumed. Past this file, the live page: code.claude.com by the `claude-code-docs` MCP server or `curl -s https://code.claude.com/docs/en/<page>.md`, and the prices by `curl -s https://platform.claude.com/docs/en/about-claude/pricing.md`. A live page that contradicts a line here wins: say so, act on the page, and route the fix by `capture-learning`, bar a dated measured line that names the page it overrules and the call that measured it, which a page changed since its date sends back to re-measure. An observed claim is cited or marked pending a doc check, and stands, marked observed, only where no page covers it. ## 1. Run ```bash uv run --no-project ${CLAUDE_SKILL_DIR}/scripts/measure-session-cost.py [<id> | --repo <folder> --last <n>] [--json] ``` - **No argument** measures the current session, so far. - **An id, or its first eight characters**, measures th