Feature Request: /compact --keep-recent — Compress beginning, keep end of conversation
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 /compact fails with "Conversation too long", the only workaround (Esc+Esc → Summarize from here) compresses FORWARD from a selected point, keeping the beginning in full detail and compressing the end.
For many workflows, the opposite is needed: The most recent messages contain the current working state, decisions, and context. The beginning contains setup, onboarding, and early exploration that is less relevant.
Proposed Solution
/compact --keep-recent (or /compact --drop-start <percentage>)
Behavior:
- Keep the last N% of messages (or last N messages) in full detail
- Aggressively compress the beginning into a brief summary
- The user retains their current working context
Alternative Solutions
/compact --keep-last 20 — keeps last 20 messages, compresses everything before.
Prerequisite: /compact --count (or /stats) — shows total number of messages in the current conversation, so the user can make an informed decision about how many to keep.
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
A user runs a 100+ message session setting up AWS infrastructure (accounts, permission sets, IAM policies). After 4 hours of work, /compact fails. The last 20 messages contain the current state: which tasks are done, which are open, what naming conventions were decided. The first 80 messages contain early exploration, team discussions, and corrections that are no longer relevant. The user needs the end, not the beginning — but the only workaround (Esc+Esc) compresses the end and keeps the beginning.
Additional Context
Related issues: #23751, #23047, #26518, #26317, #18211, #8839, #7594, #13929, #6004
Current workarounds:
- Esc+Esc → "Summarize from here" only compresses forward (keeps beginning, compresses end)
- /clear loses everything
- Starting a new session requires re-establishing context from files
The feature would also help with the root cause of the "Conversation too long" error: Instead of trying to summarize the ENTIRE conversation (which needs too much context), compressing only the beginning requires less context for the summarization operation itself.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗