mpfaffenberger / mpfaffenberger/code_puppy

Enhancement: Improve /compaction feature for better accuracy and reduced context drift

Open
#191 0 comments 0 reactions 1 assignee View on GitHub

@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

  1. 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
  2. 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
  3. User confirmation - Allow user to review/edit the compacted summary before proceeding

  4. Incremental compaction - Compact older messages more aggressively while keeping recent context intact

  5. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.