[FEATURE] `/declutter` command for surgical context pruning of completed subtasks
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 working on a large task with many subtasks in Claude Code, the current /compact command forces a full context reset whenever the context window fills up. This creates a painful and repetitive cycle:
- User explains the parent task and all subtasks (~50% context used)
- User works through a subtask to completion (~80% context used)
/compactresets context to ~5%- User must re-explain the entire parent task and remaining subtasks before continuing
- Repeat for every subtask
The re-explanation overhead compounds with each subtask. For a task with 10 subtasks, you may re-explain the same parent context 8–9 times. This wastes time, tokens, and breaks flow.
The root cause is that /compact is a blunt instrument — it discards everything, including still-relevant context, when the real need is to shed only the completed work.
Proposed Solution
A /declutter command that performs selective, scoped context compression — targeting only the portion of context the user specifies, while leaving everything else intact.
/declutter forget specifics about A1
/declutter A1
/declutter last subtask
The command would:
- Summarise only the specified scope down to a brief outcome (e.g. "Completed A1: implemented X, created files Y and Z")
- Leave all other context — the parent task, remaining subtasks, prior decisions — fully intact
- Optionally show a preview of what will be summarised before committing (
/declutter --preview) - Confirm what was pruned so the user can verify nothing important was lost
Conceptually, this is the difference between a git commit (closing a chapter of work cleanly) and deleting your entire working directory.
Alternative Solutions
/compact(current): Full reset. Solves the token problem but destroys all parent context, requiring expensive re-explanation each cycle.- Manual copy-paste: Some users paste a task list at the top of each new session. Fragile and tedious.
- Splitting into separate sessions: Loses continuity entirely; Claude has no memory of prior subtask outcomes.
None of these preserve the parent task context while shedding completed-subtask detail.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
Working on a large refactor across 10 files, each treated as a subtask:
User explains the refactor goal and lists files F1–F10 (context: 20%)
User walks CC through refactoring F1, tests pass (context: 80%)
/declutter forget specifics of F1 refactor (context: 55%)
User walks CC through refactoring F2, tests pass (context: 85%)
/declutter forget specifics of F2 refactor (context: 60%)
...
vs. the current flow:
User explains the refactor goal and lists files F1–F10 (context: 50%)
User walks CC through refactoring F1, tests pass (context: 80%)
/compact (context: 5%)
User re-explains the entire refactor goal and F2–F10 (context: 40%)
User walks CC through refactoring F2, tests pass (context: 80%)
/compact (context: 5%)
...
The /declutter flow avoids 9 full re-explanations across a 10-subtask session.
Additional Context
- This mirrors how developers already manage cognitive load: a git commit signals "this chapter is closed, I don't need to hold those details in my head anymore."
/decluttergives Claude the same signal. - A
--previewflag would make the feature safe and trustworthy — users can see exactly what Claude is about to summarise before it's gone. - Could complement rather than replace
/compact—/declutterfor routine hygiene during flow,/compactas a last resort when context is critically full.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗