Handoff (No More Compaction)
Key Points
- 1Amp has replaced its problematic "compaction" feature, which led to lossy summaries and encouraged unfocused threads, with a new method called "Handoff."
- 2Handoff enables users to extract specific relevant context from an existing thread and move it into a new, focused thread by specifying a clear goal for the next task.
- 3For a new thread, Amp generates a draft prompt and lists relevant files based on the specified goal, allowing users to review and edit for precise context transfer and optimal agent interaction.
Amp has replaced its compaction feature with a new mechanism called Handoff, designed to address the shortcomings of traditional thread summarization. Compaction, previously accessible via /compact in the Amp CLI or through editor extensions, was deemed problematic due to its inherent lossiness; it replaced the detailed context window with a summary, the fidelity and focus of which were often left to the agent's interpretation. Even with user guidance mechanisms, compaction encouraged the development of "long, meandering threads" where summaries were stacked, leading to a diffusion of focus, which is considered suboptimal for agent performance.
Handoff's core methodology aims to foster "focused threads" by providing a structured way to transfer relevant context to a new conversational thread. Instead of generating a summary, Handoff facilitates the *extraction* of specific, pertinent information from an existing thread that is directly relevant to a new task. The process begins with the user explicitly defining a "goal for the new thread." Upon receiving this goal (e.g., via CLI commands like /handoff now implement this for teams as well, /handoff execute phase one of the created plan, or /handoff check the rest of the codebase and find other places that need this fix), Amp's system performs a sophisticated contextual analysis of the current thread.
This analysis involves:
- Semantic Comprehension: Interpreting the entire history of the current thread, including all conversational turns, code snippets, discussions, and previous outputs.
- Relevance Determination: Based on the user's specified goal for the new thread, the system identifies and extracts only the most salient and directly applicable pieces of information from the current thread's context. This is a selective process, distinguishing it from summarization, which condenses the entire content.
- Prompt Synthesis: Leveraging the extracted relevant information and the user's new goal, Amp automatically generates a draft prompt for the new thread. This generated prompt serves as the initial instruction for the agent in the new context. Concurrently, Amp also compiles and suggests a "list of relevant files" from the previous thread's context, further aiding the agent in starting the new task with appropriate resources.
A critical aspect of Handoff is user control and transparency: the generated prompt is presented as a draft in the new thread. This allows users to review, refine, or entirely rewrite the instructions before sending, ensuring that the new thread commences precisely as intended, without any unintended loss or misinterpretation of context. Access to Handoff is also available in editor extensions, typically via the token usage hover.