[FEATURE] Ahead of time (background) context compaction to hide latency #6841

Resolved 💬 3 comments Opened Nov 18, 2025 by lupuletic Closed Nov 22, 2025

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

When Claude Code performs compaction it feels slow and blocking (taking over 2 minutes) which hammers the developer experience.

Proposed Solution

I was thinking whether CC could support non-blocking, background compaction that triggers ahead of the context limit, so users can keep using it while context is being compacted.

When the context approaches a particular threshold of the context window (e.g. ~75%), automatically trigger a background compaction - however, keep letting the user continue to submit prompts while compaction runs, as long as there's still context window free / available.

When compaction completes, on next idle occasion, pre-append the compacted context in front of the last user turns / context.

This would make compaction effectively “instant” from the user’s perspective and reduce cases where long sessions feel sluggish.

Alternative Solutions

_No response_

Priority

High - Significant impact on productivity

Feature Category

Performance and speed

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

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