← Back to Blog

When to Reset Context vs Continue in AI Coding: The Token Cost Trade-off

By Eric Bush · July 1, 2026 · 8 min read

Empty concrete steps descending into shallow water at sunset

The Two Forces Pulling on Session Length

A long agent session accumulates context — every turn adds to the input. Some of that context is genuinely useful (you don't want to re-explain the codebase). Some of it is pure bloat (dead branches from earlier exploration). The two forces:

  • Cache advantage — long sessions benefit from prompt caching on stable prefixes. Cache reads cost ~10% of write cost.
  • Bloat penalty — long sessions carry irrelevant context that the model still has to process, and can degrade reasoning quality.

Reset too often and you re-pay setup costs. Reset too rarely and you pay for context you don't need.

The Break-Even Math

Assume a Claude Code session with 80K tokens of “stable” context (system prompt, project files loaded early) and 5K tokens of task-specific query. At Claude Sonnet 5 promo pricing:

Scenario Input cost per turn Effective savings
Fresh session (write on 85K) $0.170
Same session, cache hit on 80K $0.026 85% vs fresh
Same session, 200K accumulated context $0.045 74% vs fresh
Same session, 500K accumulated context $0.110 35% vs fresh

The cache advantage erodes as accumulated context grows. Beyond ~500K, cached-turn cost approaches fresh-session cost — the point at which a reset actually saves tokens.

Reset Triggers Worth Adopting

Rather than resetting on a schedule, reset on triggers. Situations where /clear pays off:

  1. Task-boundary switch. Just finished a feature, moving to an unrelated bug fix. The old feature's context is dead weight.
  2. Wrong-path recovery. The agent went 20 turns down the wrong direction. Better to reset with a corrected plan than to keep steering.
  3. Context above 400K. Approaching the cache-benefit ceiling. Reset with a synthesized summary if you need continuity.
  4. Model swap. Switching from Opus to Sonnet for cost reasons? Reset, because prompt cache doesn't transfer across models.
  5. Quality degradation. If the agent starts making basic errors it wasn't making earlier, context poisoning is likely. Reset.

Continuing Is Usually Cheaper

In the absence of a specific trigger, continuing beats resetting. Concrete numbers from typical Claude Code usage:

  • Fresh session setup: pays $0.30–0.60 in overhead before the first real task.
  • Cache-warm continuation: ~$0.03–0.06 per turn overhead.
  • Breakeven: continuing pays back roughly 5–8 turns of use before the cache benefit is worth the accumulated bloat.

For most workflows, keep the session alive across related tasks and reset only at genuine boundaries. The instinct to “start fresh” often costs money without improving output.

The Summary-Based Reset Pattern

A useful middle ground: reset the session, but seed the new one with a compressed summary rather than starting from scratch. This retains high-level continuity (what we're working on, what's decided) while shedding the accumulated noise (dead exploration paths, obsolete tool outputs).

Cost profile:

  • Ask the agent to summarize state in 500 tokens before reset: ~$0.005.
  • Start new session with summary as system context: normal fresh-session pricing (~$0.30).
  • Total: same as a full reset, but with continuity preserved.

Compaction is now built into most major agents (Claude Code, Cursor Composer, Codex CLI all support automatic compaction). Use it. Manual summary-then-reset is only worth doing when the automatic compaction disagrees with what you want to keep.

Model Choice Interacts with Reset Strategy

Cheaper models make resets less painful because setup cost is lower. On DeepSeek V4-Flash at $0.14/M input, a fresh 85K-token setup costs $0.012 — an order of magnitude less than Claude Sonnet 5 fresh setup. If you're on a cheap model, don't agonize over reset decisions; just reset whenever context feels stale.

On expensive models like Opus 4.8, the calculation flips: reset overhead becomes a real budget line, and continuing pays back much faster. This is one place where model choice affects workflow habits directly.

Practical Default

A defensible default policy:

  • Continue across related tasks within a work session.
  • Reset at task-boundary switches.
  • Force a reset if context exceeds 400K, or if quality visibly degrades.
  • Use built-in compaction rather than manual summary-then-reset unless you have a specific reason.

Following this policy typically saves 15–25% of monthly agent spend versus a “fresh session per task” habit, and 5–10% versus a “never reset” habit. The reason to be intentional about it is that the wrong default is quietly expensive on either extreme.

Want to calculate exact costs for your project?

Frequently Asked Questions

When should I reset an AI coding session?

On task-boundary switches, wrong-path recovery, context exceeding ~400K tokens, model swaps, or visible quality degradation. Not on a schedule.

Is it always cheaper to continue an existing session?

Usually yes, thanks to prompt cache hits at ~10% of write cost. But beyond roughly 500K accumulated tokens, cache benefits erode and continuing becomes as expensive as resetting.

What is the break-even point for resetting versus continuing?

Fresh session setup costs $0.30–0.60 depending on model. That amortizes over 5–8 continued turns. Reset only when you're either past 400K context or at a natural task boundary.

Does /clear affect prompt cache?

Yes — clearing the session invalidates any cached prefix. The next turn pays full write cost on system prompt and reloaded context. Automatic compaction preserves more cache benefit than manual resets.

Does the reset strategy change on cheaper models like DeepSeek?

Yes. On DeepSeek V4-Flash, setup cost is ~10× lower, so the reset penalty is small. Feel free to reset more aggressively. On Opus 4.8, the opposite — continue where possible, reset carefully.