Eligible new accounts get $0.10 in free API credit. Once per account; abuse limits apply. Create an account

Outrun

Why long agent sessions cost more, and how to cut the bill

Your coding agent rereads the whole conversation on every turn. Here is how caching helps, what breaks it, and how working in stages cuts the bill.

Short answer: your agent resends the whole chat on every turn, so long sessions get expensive. Do one task per session, then /clear.

Does starting a new session save money with coding agents?

Yes. A new session (for example after /clear) stops the agent from resending the whole old chat on every turn, so each turn sends fewer input tokens and costs less.

Why long sessions cost more

Models don't remember between requests. Every turn, the agent resends its instructions, tool definitions, every file it read and the whole chat. At 100,000 tokens of history, even "ok, continue" sends 100,000 input tokens.

Caching helps, but only while the session is steady

Repeated text can be read from cache at a much lower rate. Claude Sonnet 5.5: $0.49 per million input tokens, $0.03 cached (all prices). One 50-turn session averaging 80,000 tokens of context:

Input tokensInput cost
Not cached4,000,000about $1.96
Mostly cached4,000,000about $0.10 plus new text

These reset the cache, so the next turn pays full price for the whole history:

  • A break of more than a few minutes (usually about 5)
  • Switching models
  • Editing an earlier message, or turning tools or MCP servers on or off

Work in stages

  1. Have the agent write the plan to PLAN.md.
  2. Do one stage. Check it works.
  3. Have the agent update PLAN.md with what's done.
  4. Run /clear (Claude Code) or /new (Codex), or open a new chat. Then: "read PLAN.md and do the next stage".

Other quick wins

  • /compact when you can't stop yet: it swaps the history for a short summary.
  • Put long logs in a file instead of pasting them; pasted text is resent every turn.
  • Turn off MCP servers you aren't using.
  • Check Activity in your Outrun dashboard to see which sessions cost the most.
  • Paste a ccusage report into the Claude Code cost calculator to see what a day costs.

← All posts