For everyone
Long chats and handover
Why a long chat costs more with every message
Section titled “Why a long chat costs more with every message”Every message makes the agent send the whole chat again: its instructions, its tools, and every earlier turn.
Two things make it worse:
- Breaks. The provider keeps the chat in a cache for a few minutes, where re-reading it is cheap. After a longer break the cache has expired, and the whole history is sent again at full price.
- Old work that no longer matters. Files read an hour ago, a test run that failed and was fixed: all of it rides along with every later message.
A new chat starts small. The handover is how you start one without losing your place.
The handover
Section titled “The handover”- Your agent writes it at once. When a chat passes 200k tokens (with the live tips, on unless you turned
them off), your agent finishes your request, then writes the handover in
NEXT-SESSION.mdin the project, without asking. The handover covers the goal, what is done, files changed, tests run and what is next, plus a short “other token waste in this chat” section. SessionCost calls no AI model; your own agent writes the words and shows them in its reply. In a git project,NEXT-SESSION.mdis added to.gitignore, so the handover is never committed. - The last line tells you, for example: 💡 SessionCost: This chat is at 214k tokens: every message re-sends all of it. A handover is in NEXT-SESSION.md: start a fresh chat and say “continue from handover”. If you carry on instead, the handover is written again each time the chat doubles in size (here at about 430k, then 860k tokens). The first handover on a computer also says once how to change the 200k.
- Start a new chat in the same project and say “continue from handover”. The agent reads the file and carries on from “what is next”.
For a week after a handover, a new chat in that project is told one exists; the agent reads it only when you ask. There is one handover file per project. Each new handover goes at the top; older ones and your own notes stay below. Each handover ends with a marker line, so “continue from handover” reads only the newest one, however long the file grows.
This works in Claude Code, Codex and Antigravity. Cursor and Copilot let SessionCost add text only when a chat starts,
too late for the chat that grew long: there, type /sessioncost fix in the long chat and say write a handover.
Choose when a chat counts as long
Section titled “Choose when a chat counts as long”| Say | Or type | What it does |
|---|---|---|
| “Warn me at 1m tokens” | /sessioncost fix long-chat 1m |
The handover is offered from 1m tokens instead of 200k (any number from 10k). |
| “Set my budget to $5” | /sessioncost fix budget 5 |
Also offer it once a chat passes $5. “Clear my budget” (fix budget off) removes the dollar budget. |
In a terminal:
| Command | What it does |
|---|---|
sessioncost fix --handover |
In a terminal: where this project’s handover file is. |
Without a handover
Section titled “Without a handover”- Start a new chat for a new task. The cheapest habit there is.
- Compact before a break. In Claude Code,
/compactreplaces the history with a summary. - Check the report. In Cost breakdown, the tab for breaks and compactions shows each cache miss and why; How to save shows what a fresh start would have saved.