[FEATURE] Rolling asynchronous compaction
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
A models memory conrtext It's important for all models. For Claude, I find it particularly troublesome when it reaches the compaction stage. I have a number of solutions but it is always a worry.
Proposed Solution
My suggestion is for a rolling compaction and use of other memory tools. Suggestion is to implement a sub-agent that after every interaction saves to beads and to git, and then does a rolling compaction, which the user can define as two interactions before or three interactions before. It gets that done in the background so the user's interaction with the agent is not compromised.
Nothing ever disappears, and there is never a moment where you have to worry about loss of context, and everything's already been saved. I have to manually save to git and to beads, usually right when I'm warned of impending compaction, and usually there's not enough time, and there's always a crunch.
The important two features are a rolling compaction that trails behind user-defined, how far back. That's done by a sub-agent and the ability to have Claude initiate directly within Claude sub-agent action on third-party memory tools like Git and Beads.
And so if there was just a rolling regular save that went on and a user-defined compaction window, maybe going back two or three interactions, everything prior to that, then I think that would be fantastic.
Alternative Solutions
_No response_
Priority
High - Significant impact on productivity
Feature Category
Performance and speed
Use Case Example
I'm working with Claude in Claude Code. Claude is dispatching background subagents and some API agents. It is monitoring things and other operations are going on. After I input a question, Claude responds.
In the background beads and git are automatically saved. The context window for compaction, which trails, follows up and compacts whatever interactions are two or three iterations ago. That's compacted. Get is saved. Beads is saved. Then there's the compacted memory reference. And the most important thing is my context window with the agent that I'm currently using is not affected at all. And the memory and usage never gets to a critical point and everything is already saved.
Additional Context
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗