[FEATURE] Increase effective context window / reduce compaction overhead in Claude Code

Resolved 💬 7 comments Opened Feb 26, 2026 by Vilis322 Closed Mar 25, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Context window compaction overhead significantly reduces effective token utilization in Claude Code

Environment: Claude Code (Max plan, $115/mo)

Problem:
During extended agentic coding sessions, context window compaction kicks in frequently and consumes what feels like roughly half of the available tokens. This creates a frustrating loop where:

  1. Context fills up with codebase files, tool calls, and conversation history
  2. Compaction triggers and repacks the window
  3. Useful context from earlier in the session gets lost or compressed
  4. The agent then needs to re-read files or re-establish context, burning even more tokens

This is particularly painful when working on complex tasks that span multiple files or require deep understanding of a codebase - exactly the scenarios where an agentic coding tool should shine.

Expected behavior:
More of the context window should be available for productive work. At the Max tier pricing, the effective usable context feels disproportionately small relative to what's being paid for.

Suggestions:

  • Increase the base context window size for Claude Code sessions
  • Optimize the compaction algorithm to retain more relevant context
  • Consider a smarter eviction strategy that prioritizes keeping recently referenced files and key architectural context
  • Provide users with metrics on context utilization (productive vs. overhead tokens)

Proposed Solution

There should be a larger effective context window for Claude Code sessions, or a more efficient compaction strategy that preserves more usable context.

Ideally:

  • Compaction should prioritize retaining file contents and architectural decisions made during the session over conversation history
  • A smarter eviction strategy that keeps recently referenced files and key decisions intact
  • Optionally, a visible indicator showing how much context is productive vs. overhead, so users can plan when to break tasks into smaller chunks
  • Consider allowing Max plan users ($115/mo) to opt into a larger context window, even if it costs more tokens per session

Alternative Solutions

_No response_

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

Example scenario:

I ask Claude Code to implement an RBAC system across multiple files - routes, middleware, database schema, and tests. Midway through the task (~15-20 tool calls in), compaction triggers. After compaction, Claude loses track of the schema decisions it made earlier, re-reads the same files it already processed, and sometimes even contradicts its own prior implementation choices. I end up manually re-explaining the requirements or starting a new session, which defeats the purpose of an agentic workflow.

What should take one continuous session ends up split across 2-3 sessions with me copy-pasting context between them.

Additional Context

_No response_

View original on GitHub ↗

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