Context compaction should be incremental, not stop-the-world

Resolved 💬 4 comments Opened Feb 16, 2026 by jodonnel Closed Mar 20, 2026

Summary

Long Claude Code sessions (3-4 hours of iterative development) eventually trigger context compaction. The compaction quality is good — no noticeable loss of context — but the pause is disruptive. It feels like old Java stop-the-world full GC.

Suggestion

Incremental / concurrent compaction. Compact older conversation turns during idle time — while the user is typing, while waiting on tool calls, while background agents run — rather than one big collection when the window fills up.

Same insight that took Java from SerialGCG1ZGC: the problem isn't the collection, it's the pause.

Context

Observed during multi-hour sessions involving iterative deploy-test-fix cycles across an OpenShift cluster (Flask app, multiple HTML presentations, ConfigMap deployments, parallel Haiku agent audits). The work itself wasn't interrupted by compaction quality — just by the wall-clock stall.

View original on GitHub ↗

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