[FEATURE] /compact without instruction should auto-generate smart compact instruction
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 running /compact with no instruction, the compaction uses a generic heuristic that doesn't know what the user plans to do next. This leads to suboptimal context retention — important decisions get dropped while noise (CI output, DOM snapshots) stays.
Meanwhile, the model already has the full conversation context and can trivially identify what matters vs what's noise. Users who know this trick manually write /compact Focus on X, drop Y — but most users don't.
Proposed Solution
When /compact is invoked without an instruction:
- Before compacting, have the model analyze the current conversation
- Auto-generate a targeted compact instruction (e.g., "Focus on: metric visibility settings, network metrics implementation, file paths modified. Drop: CI/CD watch output, Playwright DOM snapshots, agent exploration results, intermediate diffs.")
- Apply the generated instruction as if the user had typed it
This is zero-effort for the user and strictly better than the generic heuristic. The model already does this when asked — it just needs to do it by default.
Example
Current behavior:
/compact → generic heuristic → loses important context about decisions made
Proposed behavior:
/compact → model generates: "Keep: auth refactoring decisions, new file locations,
pending tasks. Drop: git log output, build output, file contents already committed."
→ much better context retention
Related
- #7627 (closed as NOT_PLANNED) was broader (proactive warnings + UI changes). This is simpler — no UI changes, just make the existing
/compactsmarter by default.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗