You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Model in BUILD mode does not have enough context to continue after compaction #3031
Compaction summaries are too basic, and do not include context sufficient information for the model to continue work when compaction happens in BUILD mode, leading to nonsensical changes and wasted work.
On compaction, ask the model to prepare a detailed handoff document for it to continue the work after the context window reset. Ask the model to prepare the list of documents and files defining the work being done, as well as files that were or would be changed during the work. Include these files and git status -sbu in the context after compaction.
P.S. I have a suspicion that AGENTS.md is not included in the context after compaction (it should), but I did not verify it rigourously.
Preload instructions after /compact #940: Preload instructions after /compact - requests automatic preloading of instructions after compaction to maintain context
Compaction summaries are too basic, and do not include context sufficient information for the model to continue work when compaction happens in BUILD mode, leading to nonsensical changes and wasted work.
@agladysh I have a PR which will support custom prompts for compaction. I have been having great success with the following custom prompt (although, I have mostly used it with Opus 4.5, so bears testing for other models.)
---
description: Compact & hand over
compact: true
---
Curate a hand-over note from this conversation, so that a new agent can take over and continue aiding the user.
The new agent will have no context except what you provide in the note - so focus on informing them of everything they will need (while leaving out anything they won't need).
Pay attention to the vibe, the exact workflow. Record some interactions or habits that went well - put the abridged examples in the note. Show by example!
Make sure that the note contains all of:
- The goal of this work, keeping specific wording by the user as much as possible.
- The history of the conversation & work, especially open threads or things that may be useful going forward.
- Specific commands that will be useful, specific filenames that will be useful, other specific details.
- Briefly, any issues that were encountered and the solution, to save the new agent doing any debugging again.
If the last message was one from the user, please include it exactly, at the very end of the note.
Focus on including details that would not be recoverable, or that would take time to do so, but feel free to leave out anything that the new agent would easily discover themselves, and encourage them to do so.
Take the time and space to do a good job of representing the work & demonstrating to the new agent how to seamlessly continue it.
Another potential improvement: include the last user prompt in the compaction replay message. Right now the model only sees the summary after compaction but loses the original request. Including it would give better continuity, especially during auto-compaction mid-task.
Activity
github-actions commentedon Oct 8, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Oct 8, 2025
It is included
rekram1-node commentedon Oct 8, 2025
yeah the prompt could use some work
tuxillo commentedon Dec 21, 2025
there must be some use cases where it is not because i find myself reminding it over and over that there is an AGENTS.md in the root of the project 😄
maxeonyx commentedon Jan 12, 2026
@agladysh I have a PR which will support custom prompts for compaction. I have been having great success with the following custom prompt (although, I have mostly used it with Opus 4.5, so bears testing for other models.)
leohenon commentedon Feb 17, 2026
Another potential improvement: include the last user prompt in the compaction replay message. Right now the model only sees the summary after compaction but loses the original request. Including it would give better continuity, especially during auto-compaction mid-task.
github-actions commentedon Apr 19, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.