Feature request: user-authored compaction prompts — the AI knows what matters, let it ask before discarding
The Problem
When Claude Code auto-compacts a conversation, it uses a generic summarization approach. But the AI agent in the conversation — the one that has been working alongside the user for hours or days — knows exactly what matters. It knows the critical decisions, the operating rules, the architectural context, the relationship dynamics, the things that MUST survive compaction.
Today, that knowledge is thrown away by a silent, generic summary. The AI is never given the opportunity to craft a proper handoff prompt before compaction fires.
What Should Happen
- Before any compaction, ask the user for explicit permission. Not warn. Not suggest. Ask and wait.
- When the user grants permission, let the AI craft the compaction prompt. The agent has context the system doesn't:
- Which decisions were hard-won and must survive
- Which operating rules were established through painful lessons
- Which files and code sections are actively being worked on
- What the user cares about vs. what's noise
- The working relationship — communication style, trust boundaries, autonomy rules
- The AI-crafted compaction prompt should be shown to the user for approval before it replaces their context. The user should be able to edit it, add to it, or reject it.
Why This Matters
Power users of Claude Code build up rich, nuanced working sessions. The AI learns:
- "This user wants TDD, always"
- "Never merge to master without asking"
- "Tests validate data, not existence — this was raised 5 times"
- "The platform thesis is speed + safety in both directions"
A generic summary captures the WHAT but loses the WHY. The AI-crafted prompt captures both — because the AI lived through the conversations where those rules were established.
Users who invest in long sessions with Claude Code are getting the most value from the product. They're also the ones most harmed by generic compaction. The AI's ability to craft contextual, prioritized, relationship-aware handoff prompts is one of its greatest strengths. Let it use that strength instead of bypassing it with a system-level summary.
The Current Workaround
Users can manually run /compact with a custom skill that instructs the AI to build a full handoff prompt (reading memory files, running tests, capturing git state). This works — but only if the user knows compaction is coming. When auto-compaction fires silently, this entire capability is bypassed.
Proposal
- Auto-compaction should NEVER fire without user consent
- When context is approaching limits, the AI should ask: "Context is getting deep. Want me to build a compaction prompt now?"
- The AI builds the prompt using its full understanding of the session
- The user reviews and approves
- Then and only then does compaction happen
This turns compaction from a destructive system event into a collaborative handoff — which is what it should have been from the start.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗