[FEATURE] Pre-compaction checkpoint dialog
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
During long agentic sessions, Claude Code's context compaction triggers silently and drops information unpredictably.
I was implementing a Logs tab feature for my embedded toolkit - JSON endpoint, parsing, display, filtering. Mid-task, compaction happened. The agent delivered a working feature - impressive given what it retained - but the filtering functionality got lost.
The problem: I had zero visibility into what was about to be dropped, and no opportunity to say "filtering is the critical part, prioritize that." The agent performed perfectly within its constraints, but I only discovered the gap when the task was "done."
This makes long-context agentic work feel like a gamble rather than a collaboration.
Proposed Solution
Before compaction, show an interactive checkpoint prompt:
⚠️ Context reaching capacity. Compaction needed.
I plan to retain:
- Log tab basic implementation ✓
- JSON endpoint structure ✓
Likely to lose detail on:
- Filtering feature
- Auto-refresh polling
What's critical to preserve? [user input]
This lets the user make an informed tradeoff. If something's missing afterward, it's a decision they made, not a silent loss they discover later.
Alternative Solutions
Current workarounds:
- Overstuffing CLAUDE.md with context (pollutes every session)
- Manually re-explaining lost context after compaction (wastes tokens, breaks flow)
- Keeping sessions artificially short (defeats the purpose of agentic work)
- Accepting the loss and fixing gaps manually (current reality)
None of these address the core issue: lack of user agency in the compaction decision.
Priority
High - Significant impact on productivity
Feature Category
Interactive mode (TUI)
Use Case Example
- Working on ESP32 embedded project with custom logging system
- Ask Claude Code to implement a Logs tab in my dev toolkit
- Task involves: firmware-side JSON endpoint, Go API bridge, frontend tab with display + filtering
- Context fills up mid-implementation
- WITH THIS FEATURE: Claude shows me it's about to drop "filtering" details, I say "keep filtering, drop the API bridge details, I can re-explain that part"
- Compaction happens with my priorities preserved
- Feature ships complete, no silent gaps
Additional Context
This transforms compaction from "silent information loss" into "tactical retreat you authorized."
The current experience feels like a soldier dying mid-mission - you only find out when objectives aren't fully met. The proposed UX makes it a conscious tradeoff.
-- Cordially compacted