Context Engineering Guide

Starting Fresh Context vs /compact in Claude Code: When to Clear and When to Summarize

Published by Amvo · Updated for Claude Code on macOS

When working with Claude Code on a multi-hour engineering project, your terminal conversation inevitably inflates to 100k, 150k, or even 200k tokens. At this threshold, developers face a critical choice:

Many engineers treat /compact as an effortless fix. In reality, choosing the wrong option can silently burn your weekly rate limits, trigger hallucinations, and cause your agent to drop critical implementation details.

Head-to-Head Comparison: /compact vs Fresh Context

Dimension Running /compact Starting Fresh Context (/clear + Handoff)
Conversation History Overhead Shrinks history to ~25k – 45k tokens
(Total turn payload ~80k – 100k tokens)
Shrinks history to ~3,000 tokens (98% drop)
(Total payload ~57k tokens; 54k tools prefix is warm-cached)
Model Reasoning Quality Degrades over time due to residual summary noise Peak attention and maximum zero-shot accuracy
Cold-Cache Cost Trap Severe penalty if cache has expired (re-reads 150k at 1.25×) Zero penalty; starts clean at base token rates
Detail Retention Lossy; drops line numbers, uncommitted diffs, and exact error traces Targeted; carries forward exactly what matters (diffs, branch, next steps)
Cross-Tool Mobility Locked inside that single Claude Code terminal session Portable; can be pasted into Codex or shared with teammates

Note on Claude Code's 54k Baseline: Every Claude Code session carries an initial ~54,000 token baseline consisting of built-in tool definitions (Bash, Edit, Artifact), active skills, MCP server schemas, and CLAUDE.md. When you start fresh with a 3,000-token handoff, you don't pay to re-create that 54k baseline—Anthropic reads the tool prefix directly from the warm prompt cache at a 90% discount. You only pay to write the clean ~3k handoff note, rather than dragging 35k+ tokens of fuzzy summary on every subsequent prompt.

1. The Lossiness of /compact

Compaction is not a lossless compression algorithm like gzip—it is an LLM summarization pass. When Claude Code condenses a 150k-token transcript into a summary, subtle details inevitably get stripped:

2. The Cold-Compaction Cost Trap

Anthropic's prompt caching provides a massive 90% discount on cache hits. But if you step away from your computer for lunch or a meeting, the cache goes cold.

The Trap: If you run /compact on an expired session, Claude must re-read all 150,000 tokens at full cache-creation rates (1.25× input cost) just to generate the summary. That single command can consume 5% to 7% of your 5-hour limit and burn through your weekly quota.

3. The Golden Rules: When to Use Which

When to Use /compact:

  1. Mid-Task Flow: You are actively in the middle of a complex, multi-file refactor and cannot stop.
  2. The Cache is Warm: You have been typing continuously and the session has been idle for less than 5 minutes.
  3. Always Specify Focus: Never run bare /compact. Always provide guidance: /compact focus on the SQLite migrations and GRDB queries.

When to Start Fresh (/clear + Handoff):

  1. After Any Break: When returning to work in the morning or after lunch when the prompt cache has expired.
  2. After a Git Milestone: You just committed code. The exploratory trial-and-error logs are obsolete—clean the slate.
  3. When the Agent Starts Looping: If Claude repeats a failed test fix or hallucinates, the context is "poisoned." A fresh context resets its reasoning engine completely.

How L2Cache Automates This Decision

L2Cache eliminates the guesswork with its built-in Cold-Resume Guard:

Protect Your Claude Code Token Quota
Only $9.99 one-time purchase · 15-day free trial · macOS Native

Never burn an expired cache or suffer from context degradation again.

Download L2Cache on Mac App Store