[FEATURE] Allow claude to save important context for a session and avoid auto compacting that
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 auto compaction happens, claude trims the context. There should be a way to allow claude to save the important context and prevent it from auto trimming. If I ask claude to read a document, it creates a list of tasks to perform, it should not be auto compacted after a while when task 1 to k is run. The list of tasks to perform should be present for task k + 1 to n to avoid mistakes.
Proposed Solution
There should either be a wildcard to allow claude to store the summary of context like Read the document (it should store summary or list of tasks to perform to avoid auto-compacting) or it should automatically decide if the context should be persisted. If needed, it should read the context again after auto compacting to not lose sense.
Alternative Solutions
_No response_
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
4 Comments
---
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
---
Hey, I've definitely run into this issue myself! It's frustrating when you have a good plan going and then auto-compaction makes Claude lose the plot.
I dug into the docs and changelogs a while back and found a couple of features that really help manage this. It seems like the team has built-in ways to guide the compaction process.
Guiding the Compaction
You can actually give Claude instructions on what to remember when it compacts the conversation.
/compact Keep the full list of remaining tasks to perform and the key takeaways from the document.CLAUDE.mdfile. This tells Claude how to handle auto-compaction every time for that specific project. Add a section like this:```markdown
# Summary instructions
When you are using compact, please focus on preserving the full, un-summarized list of tasks to be performed. Also, retain the main summary points of any documents we've discussed.
```
Other Helpful Commands
I also noticed a couple of commands (some might not be in the main docs yet) that are super useful for this:
/todosto see what it's tracking. This seems more robust than just relying on the conversation history and might survive compaction better.And if all else fails, you can disable auto-compaction completely in the
/configmenu, though I've found that guiding it withCLAUDE.mdusually works well enough.Hope this helps you out
Thank you so much! This is helpful.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.