crates/goose-context-management/src/prompts/compaction.md
Conversation History: {{ messages }}
Wrap reasoning in <analysis> tags:
After the closing </analysis> tag, output exactly one ```json code block and nothing else, matching this schema:
{
"user_intent": ["every user goal and request, most important first"],
"technical_concepts": ["all discussed tools, methods, and concepts"],
"files": [
{
"path": "path of a file that was viewed or edited",
"summary": "what was done to it and why",
"key_code": "important code, signatures, or diffs from this file (omit if none)"
}
],
"errors_and_fixes": ["bugs hit, their resolutions, and user-driven changes"],
"problem_solving": ["issues solved or in progress, and key decisions: what was chosen, what was rejected, and why"],
"user_messages": ["all user messages, truncating long tool call arguments or results"],
"pending_tasks": ["all unresolved user requests, most important first"],
"current_work": "active work at summary request time: filenames, code, alignment to latest instruction",
"next_step": "include only if it directly continues a user instruction, otherwise omit"
}
Rules for the JSON:
<analysis> block is a discarded scratchpad: only the JSON survives, so it must be self-contained and repeat every detail from the analysis that matters for continuingfiles, whose entries are objects shaped as shown aboveerrors_and_fixes - exact strings including numbers, identifiers, and paths, not paraphrases