Context editing (tool result clearing) regression: dynamic context management lost in recent versions

Resolved 💬 2 comments Opened Feb 14, 2026 by idiolect-ai Closed Mar 14, 2026

Description

In previous Claude Code versions with Opus 4.5, context percentage would drop between turns during tool-heavy sessions — for example, going from ~50% to ~30% without any explicit compaction or user action. This allowed sessions with heavy file reads, greps, and tool use to run significantly longer before hitting context limits.

In Claude Code v2.1.32 with Opus 4.6, this behavior stopped entirely. Every file read, grep result, and tool output now accumulates permanently in context until manual compaction. Sessions that previously completed in a single context window now require 1-2 compactions to finish equivalent work.

What I Observed (Opus 4.5, Previous CC Versions)

  • Context percentage would periodically drop by 15-25% between turns (e.g., 50% → 30%)
  • This happened automatically with no user action
  • Old tool results (file contents, search results) were cleared while recent ones were preserved
  • Being thorough with file reads was fine because stale content was cleared automatically
  • 600+ sessions ran successfully under this behavior without context being a critical constraint

What Changed (Opus 4.6, CC v2.1.32)

  • Context percentage only goes up, never down (until compaction)
  • Every file read, grep, search result, and tool output stays in context permanently
  • Sessions that previously completed in one window now overflow
  • A straightforward session (no subagents — just reading docs and editing files) hit 90% context before substantive work began
  • A multi-step workflow that completed in a single context window under Opus 4.5 consumed an entire window plus 75% of a second one under Opus 4.6

Root Cause Hypothesis

I believe Claude Code was previously using the Context Editing API (context-management-2025-06-27 beta) with the clear_tool_uses_20250919 strategy, and either stopped using it or changed its configuration.

The Context Editing docs confirm:

  • clear_tool_uses_20250919 clears old tool results when context exceeds a threshold, keeping only the N most recent — this exactly matches the behavior I observed with Opus 4.5
  • clear_thinking_20251015 clears older thinking blocks
  • Both strategies support Opus 4.6 — there is no technical reason they can't be used with the current model
  • This is a client configuration issue, not a model capability difference

Impact

This regression fundamentally changes context economics for tool-heavy workflows. My project involves extensive reference documentation, continuity tracking data, and configuration files. A typical working session reads 10-30 files before beginning substantive work.

To compensate, I've had to build:

  • Pre-indexed query systems to avoid loading full files into context
  • File summary caching to avoid re-reading large reference documents
  • Disk-based patterns where subagents write output to files and return only summaries
  • Quiet/summary flags on validation scripts to minimize tool output size
  • Manual pre-compaction preparation workflows to preserve context quality
  • A multi-session context optimization effort that compressed always-loaded files by ~57%

All of this compensates for the loss of a feature that was previously working transparently.

Additional: Auto-Compact Override Not Functional

Separately, the CLAUDE_AUTOCOMPACT_PCT_OVERRIDE environment variable does not work correctly. Tested at both 90% and 98% — auto-compact fires at ~78-80% regardless (apparently the default). I've disabled auto-compact entirely and rely on manual compaction. This means auto-compact can't serve as a workaround for the missing context editing.

Request

  1. Re-enable context editing (clear_tool_uses_20250919 + clear_thinking_20251015) in Claude Code's API calls. The API supports it on all current models.
  1. If there's a reason it was removed, please document why — and whether a user-facing configuration option is planned. Even exposing it as a Claude Code setting would be valuable.
  1. Fix or document CLAUDE_AUTOCOMPACT_PCT_OVERRIDE — it currently accepts values silently but doesn't change behavior.

Environment

  • Claude Code version: v2.1.32
  • Model: claude-opus-4-6
  • Platform: macOS (Darwin 25.2.0)
  • Context window: 200K

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗