/measure-usage:measure-usagefrom measure-usage
Track token usage, cost breakdown, and tool stats during a Claude Code session. Use when the user asks about token usage, session cost, how expensive something was, how many tokens, what the context window looks like, or wants to measure/monitor resource consumption. Also trigger for "show usage", "how much did that cost", "what did I spend", "session stats", "show me the breakdown", "how many turns", "per-turn", "per turn breakdown", "turn-by-turn". No args = full session stats. "start" = begin tracking from this point. "stop" = stop tracking and save. "stats" = check tracked stats. "turns" = per-turn drill-down.
Ships in measure-usage. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Run one of these commands based on $ARGUMENTS:
$ARGUMENTS contains "start" → begin tracking from this point:
cd "${CLAUDE_SKILL_DIR}" && python3 -m claude_measure_usage.plain start "${CLAUDE_SESSION_ID}"
$ARGUMENTS contains "stop" → stop tracking, show final stats, save to disk:
cd "${CLAUDE_SKILL_DIR}" && python3 -m claude_measure_usage.plain stop "${CLAUDE_SESSION_ID}"
$ARGUMENTS contains "stats" → check stats while tracking continues:
cd "${CLAUDE_SKILL_DIR}" && python3 -m claude_measure_usage.plain stats "${CLAUDE_SESSION_ID}"
$ARGUMENTS contains "turns", "per-turn", or "per turn" → per-turn drill-down table (main session + one table per subagent). If $ARGUMENTS also contains a session id (a UUID-like token), use it; otherwise default to the current session:
cd "${CLAUDE_SKILL_DIR}" && python3 -m claude_measure_usage.plain turns "${CLAUDE_SESSION_ID}"
Otherwise (default) → full session stats from the beginning:
cd "${CLAUDE_SKILL_DIR}" && python3 -m claude_measure_usage.plain session "${CLAUDE_SESSION_ID}"
For session, start, stop, stats: don't repeat the full output. Summarize the key takeaways: total cost, top cost drivers, anything notable (e.g. a subagent using more than main, high context usage). Mention that full details are in the collapsed Bash output above.
For turns: the per-turn table IS the output — do not re-render it. Summarize by pointing at notable turns (the most expensive ones, turns that spawned subagents with large sub rollups, turns where context grew sharply) by their turn number, and tell the user to expand the Bash output to see the full table. If subagent tables are present, note which ones are most expensive and their short ↳id anchors so the user can jump to them.
claude_measure_usage/__init__.py (opens in a new tab)claude_measure_usage/__main__.py (opens in a new tab)claude_measure_usage/metrics.py (opens in a new tab)claude_measure_usage/nonturn_rows.py (opens in a new tab)claude_measure_usage/output_estimation.py (opens in a new tab)claude_measure_usage/parse.py (opens in a new tab)claude_measure_usage/plain/__init__.py (opens in a new tab)claude_measure_usage/plain/__main__.py (opens in a new tab)claude_measure_usage/plain/commands.py (opens in a new tab)claude_measure_usage/plain/display.py (opens in a new tab)claude_measure_usage/plain/state.py (opens in a new tab)claude_measure_usage/plain/turns_table.py (opens in a new tab)claude_measure_usage/tui/__init__.py (opens in a new tab)claude_measure_usage/tui/app.py (opens in a new tab)claude_measure_usage/tui/detail_rows.py (opens in a new tab)claude_measure_usage/tui/discovery.py (opens in a new tab)claude_measure_usage/tui/format.py (opens in a new tab)claude_measure_usage/tui/screens.py (opens in a new tab)claude_measure_usage/turns_label.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub zytedata/claude-measure-usage --plugin measure-usage