mpfaffenberger / mpfaffenberger/code_puppy
Enhancement: Improve /compaction feature for better accuracy and reduced context drift
@nhicks00 is already working on this.
Since Feb 19, 2026.
- Dominant language
- Python
- Stars
- 814
- Forks
- 278
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 76
Description
Summary
The /compaction feature is useful for managing context window limits, but there's room for improvement in how it summarizes and compacts conversation history. Currently, important context can be lost during compaction, leading to context drift where the agent loses track of:
- Key decisions made earlier in the session
- File paths and specific changes discussed
- User preferences and constraints mentioned
- The overall goal/direction of the task
Proposed Enhancements
-
Smarter summarization - Prioritize retaining:
- File paths and code snippets that were modified
- User-stated requirements and constraints
- Key decisions and their rationale
- Current task state and progress
-
Structured compaction format - Instead of free-form summaries, use a structured format:
## Current Task: What we're working on## Key Decisions: Important choices made## Files Modified: List of touched files## Context: Critical background info## Next Steps: What was about to happen
-
User confirmation - Allow user to review/edit the compacted summary before proceeding
-
Incremental compaction - Compact older messages more aggressively while keeping recent context intact
-
Tag-based retention - Allow marking certain messages as "important" so they survive compaction
Expected Benefits
- Reduced "amnesia" after compaction
- Better continuity on long coding sessions
- Less need for users to re-explain context
- More reliable multi-step task execution
Related
This is especially important for long refactoring sessions or complex multi-file changes where losing context mid-task is frustrating.
Interested contributor: @nhicks00
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.