Tinker AI
Read reviews
4 min read Owner

Twelve months ago, AI coding tools were leaky on context. The chat panel would accumulate context until it hit the model’s limit, then cut things off awkwardly. Long sessions degraded; restart was frequent; the cost picture was unpredictable.

Today, context pruning is dramatically better in most tools. The user-visible effect is subtle — the chat just keeps working. The behind-the-scenes work is significant.

What context pruning does

Every AI coding tool has to fit your conversation into the model’s context window. The window is finite (200k tokens for Claude, 1M for Gemini, etc.). For long sessions, the conversation outgrows the window.

Pruning is the strategy for what to keep. The naive approach: keep recent messages, drop old ones. The smart approach: keep important messages, drop redundant ones.

What “important” means is the hard problem.

What’s gotten better

Several specific improvements I’ve noticed across tools in the past year:

Better summarization of dropped context. Instead of “I forgot what we were doing,” tools now summarize the dropped portions. “Earlier we discussed X; we agreed on Y.” The continuity is preserved without keeping the full text.

Smarter “important” detection. The first message of a session (where you state the goal) is now consistently preserved. Recent messages are preserved. Tool outputs that produced useful information are preserved. Random middle exchanges that didn’t lead anywhere are summarized or dropped.

File-aware pruning. Files mentioned in the chat get tracked. The current state of relevant files is preserved; outdated versions are dropped. The model doesn’t waste context on stale file content.

Cross-session memory. Some tools (Cline 3.x, Cursor with Memories) preserve information across sessions. “We decided X two weeks ago” is recoverable without scrolling. The session memory complements the in-session pruning.

Why this is invisible to most users

The improvements are invisible because the previous bad behavior was easy to ignore. When a session got long and the model “forgot,” users would either:

  • Start a new session (and lose track of what they were doing)
  • Repeat themselves (annoying but workable)
  • Copy-paste relevant context manually (laborious)

These workarounds masked the underlying problem. With better pruning, the workarounds aren’t needed. The improvement is “nothing bad happens” rather than “something good happens.”

A concrete cost example

For a typical 2-hour Cline session:

With 2024 pruning:

  • ~1.5M tokens accumulated total
  • Tool truncated at 200k
  • Lost ~1.3M tokens of intermediate context
  • Result: model occasionally lost the thread; user re-explained
  • Total cost: ~$5

With 2026 pruning:

  • ~800k tokens accumulated total (better deduplication)
  • Tool prunes intelligently as it grows
  • Effective context stays around 100-150k throughout
  • Result: model maintains context across the session
  • Total cost: ~$2

The 60% cost reduction is real. The user experience improvement (less re-explanation) is also real.

The technical work behind it

For tool builders, the engineering challenges:

Detecting redundancy. When the user says “let me restate” and gives a corrected version of an earlier prompt, the tool can drop the original. Detecting this requires understanding intent, not just text matching.

Preserving structure. Code in messages should be preserved differently than prose. Tool outputs differently than discussion. Each has different importance signals.

Updating without losing. When a file is referenced multiple times in a conversation, only the most recent version matters. But the discussion about earlier versions might still be relevant. Disambiguating is non-trivial.

Anchor preservation. Some messages anchor the conversation (the goal, key decisions, important constraints). These need to be preserved at any context length. Identifying anchors is a learned signal.

The tools that do this well aren’t using simple algorithms. They’re using model-assisted pruning — running a small model to summarize and decide what to keep, with results cached for performance.

Variation across tools

Quality of context pruning varies:

Cursor: Good. Their chat panel handles long sessions gracefully. Summarization quality has improved dramatically over the past year.

Cline: Good. The Plan/Act split helps because Plan contexts are smaller. Long autonomous loops are managed reasonably.

Claude Code: Good. Anthropic’s own product unsurprisingly takes advantage of Claude’s strengths.

Aider: Decent. The repo map approach is different from chat-based tools; pruning is mostly about which files stay in context.

Copilot Chat: Mediocre. GitHub’s chat sometimes loses context in ways that suggest pruning is more aggressive than ideal.

Older / smaller tools: Variable. Less-resourced tools sometimes haven’t invested in pruning sophistication.

For users picking tools, this is one of the dimensions worth evaluating in long sessions. A tool that handles 2-hour sessions well is meaningfully different from one that makes you restart every 30 minutes.

What to look for

Signs that a tool’s context pruning is working:

  • Long sessions don’t feel “fuzzier” than short ones
  • The model can reference decisions from earlier in the session
  • File changes from earlier in the session are still understood
  • Cost growth slows as the session continues (not linearly with messages)

Signs that pruning isn’t working:

  • “I don’t have context for that” responses to questions about earlier in the session
  • Files you discussed earlier appear unfamiliar to the model later
  • Costs grow unboundedly with session length
  • Models start hallucinating earlier context

What this enables

Better context pruning unlocks workflows that weren’t practical before:

Long autonomous sessions. A Cline agent loop that runs for 2-3 hours used to be expensive and unreliable. With better pruning, it’s affordable and stays coherent.

Day-long Claude Code sessions. Working on a feature across an entire workday with Claude Code maintaining context. Previously you’d lose the thread; now the thread persists.

Cross-task context reuse. A session that addresses 10 related tasks can keep the relevant context across all of them. Previously each task started fresh.

Cheaper per-task usage. With less wasted context, the per-task cost drops. Over a year, this is meaningful.

What I’d watch

A few things to track:

Continued cost reductions. As pruning improves further, sessions get cheaper. The trend should continue.

Cross-session memory becoming standard. Currently a feature of some tools; will likely become table stakes.

Better “this isn’t relevant anymore” detection. Early-conversation context that doesn’t matter to current work could be more aggressively dropped.

Privacy implications. Aggressive pruning means less data persists in tools’ systems. This is good for privacy. Whether tool vendors emphasize this varies.

A meta observation

The category of “improvements that make things not worse” is undervalued in software. We celebrate features that add value; we under-celebrate features that prevent loss.

Context pruning is a “prevent loss” feature. It makes long sessions stay coherent (don’t lose value) rather than introducing new capability (gain value).

The improvements over the past year have been substantial, but you wouldn’t know it from the marketing. The marketing emphasizes new agents, new features, new integrations. The mostly-invisible work of preserving session quality keeps happening in the background.

For users: appreciate when things “just work” through long sessions. The teams keeping that working are doing real engineering, even if it doesn’t make the changelog.

Closing

The state of context pruning in 2026 is meaningfully better than in 2024. Long sessions work. Costs are predictable. Models stay coherent. The improvement is real.

It’s also unmarketed. Users may not realize how much engineering went into making the experience smooth. The teams that did this work are doing valuable engineering; the products are better for it; the users barely notice.

That’s how good infrastructure feels. Invisible. Reliable. Trustworthy. Worth appreciating, even if it doesn’t generate buzz.