For everyone
Save tokens
Find the waste
Section titled “Find the waste”In the chat, type /sessioncost. The report opens with the answer: tokens sent, tokens with the fixes, and the
biggest fixes. On the path, the redder the tile, the heavier the turn; tap the heaviest to see inside it.
What you usually find: the cost is in the re-sending, not in what you typed. One of four causes leads:
| Cause | What it looks like | Where to read more |
|---|---|---|
| Step 0 | The chat was expensive before you typed anything: rules, tools and skills sent with every message | Step 0 |
| A long chat | Late turns cost far more than early ones, because the whole history is sent each time | Long chats and handover |
| Many tool calls in one turn | One turn with dozens of model calls | The turn panel |
| A big file or output that stays | One step pulled in a large file or command output, and every later call carries it | The turn panel |
Let your agent fix it
Section titled “Let your agent fix it”Say fix my token waste in the same chat, or type /sessioncost fix.
- Your agent shows the to-do list: each waste, how many tokens it cost in this chat, and the change that prevents it.
- It ends with Say “fix it” (or “fix 1 and 3”) to apply these. Say it for all, or name the ones you want. A bare “yes” is not enough, so it is never mixed up with a question of the agent’s own.
- Then each changed file is backed up first, then changed. Say undo the fix (or type
/sessioncost fix --undo) to put the newest fix back (unless you changed the file since).
What a fix changes:
| Kind | Where it goes |
|---|---|
| A rule for your agent | Its rules file in the project: CLAUDE.md (Claude Code), AGENTS.md (Codex), GEMINI.md (Antigravity), .cursor/rules/sessioncost.mdc (Cursor), .github/copilot-instructions.md (Copilot) |
| A setting | Claude Code’s personal project settings, .claude/settings.local.json (never committed) |
| A step only you can take | Listed with what to do, for example turning off an MCP server this project does not use |
Fixes are about tokens only. Safety is the guard’s job: no fix writes a permission or a safety rule.
See that it worked
Section titled “See that it worked”At the end of your next chat, say show my report (or type /sessioncost) again. The report, and the next fix list, say for each fix:
| It says | What it means |
|---|---|
| no new chat since the fix yet | Nothing to measure yet. |
| ~N fewer tokens sent in 3 chats since | What the fix saved, measured from your own chats. |
| no waste of this kind in 3 chats since | A rule that prevents a waste: the waste did not happen. |
| it came back | The waste is back, with how much. The fix is still in place. |
| the agent did not follow the rule | The rule is in the file but the agent ignored it: remind it, or word the rule more plainly. |
A list after every answer
Section titled “A list after every answer”From install, any new waste is named in the last line of your agent’s next reply, for example:
💡 SessionCost: token waste in this chat: Re-read the same file (~6k tokens). Say “fix it” (or type /sessioncost fix) to fix these.
Nothing changes until you say fix it. One tip per chat unless something big turns up; an item you skip stays
quiet in that project for a week. Say turn token tips off (or type /sessioncost fix auto off) to stop them,
turn token tips on to start them again.
An older chat, or another project
Section titled “An older chat, or another project”In a terminal, from the project folder:
sessioncost list # recent chats here: when, agent, id, cost, turns, first messagesessioncost 3f2a9c1e # one chat, by the first characters of its idsessioncost --project ~/code/api # the newest chat of another project foldersessioncost list --limit 20 shows more. SessionCost finds the logs of all five agents.
Were the helper agents worth it?
Section titled “Were the helper agents worth it?”Helper agents (subagents) each send their own Step 0 and their own chat. In the report, open Agent flow: each agent’s calls, tokens and cost, and what it handed back. A helper that read a lot and returned little may have been better done in the main chat.
Exact numbers in Cursor
Section titled “Exact numbers in Cursor”Cursor’s local log keeps no token counts, so a Cursor report is estimated and shows the cost as a range. Export your
usage as CSV from Cursor’s usage page and leave it in Downloads: SessionCost finds it by itself. Or pass it:
sessioncost --cursor-usage usage.csv.
A subscription, or your own rates
Section titled “A subscription, or your own rates”- On a monthly plan (Claude Pro or Max, ChatGPT):
sessioncost --subscriptionlabels the money as what the chat would cost at API prices. Good for comparing chats; it is not your bill. - Your own rates: see How the money is counted.