measure-session-costlisted
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