{
  "schema": "vedokrok.public-item.v1",
  "release_id": "MHC-RPUB-20260920-75ad787a",
  "url": "/knowledge/compact-context-by-preserving-decisions-and-unresolved-work-not-every-tool-result",
  "id": "MHC-D-RESEARCH-0952",
  "version": "0.1.0",
  "title": "Compact context by preserving decisions and unresolved work—not every tool result",
  "summary": "Compaction should save the project, not the transcript.",
  "kind": "protocol",
  "body": "When context must be compressed, preserve architectural decisions, constraints, unresolved bugs/questions, current state, source/artifact references and next actions. Drop duplicated prose and old raw tool results once their useful facts are represented elsewhere. Start with high recall; trim only after testing complex traces.",
  "limits": [
    "Over-aggressive compaction can silently remove a detail that matters later; favor recall before token efficiency."
  ],
  "topics": [
    "union-agent-loop-reliability"
  ],
  "intents": [],
  "source_ids": [
    "RS-23629BCC74F3AC0C"
  ],
  "evidence": [
    {
      "claim": "Anthropic recommends compaction that preserves key decisions, unresolved work and implementation details while removing redundant tool outputs.",
      "source_id": "RS-23629BCC74F3AC0C",
      "role": "supports",
      "note": "Over-aggressive compaction can silently remove a detail that matters later; favor recall before token efficiency.",
      "locator": "See source record"
    }
  ],
  "use_when": [
    "A long context contains large raw tool outputs and repeated discussion that crowd out current task state."
  ],
  "avoid_when": [
    "Over-aggressive compaction can silently remove a detail that matters later; favor recall before token efficiency."
  ],
  "example": "Keep 'migration uses option B because rollback is required' and the source file path; drop the 2,000-line raw search result that led there.",
  "check": "A fresh context can continue the task without reopening decisions or inventing missing constraints.",
  "steps": [
    "Keep decisions and their reasons.",
    "Keep unresolved items and next actions.",
    "Keep references to authoritative artifacts/sources.",
    "Remove redundant raw tool outputs already reflected in durable state.",
    "Test compaction on difficult long traces before aggressive shortening."
  ],
  "sources": [
    {
      "id": "RS-23629BCC74F3AC0C",
      "title": "Effective context engineering for AI agents",
      "url": "https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents"
    }
  ],
  "relations": [
    {
      "from": "MHC-D-RESEARCH-0952",
      "to": "MHC-D-RESEARCH-0354",
      "type": "useful_with",
      "url": "/knowledge/version-the-configuration-that-changes-behavior"
    }
  ],
  "collections": [
    {
      "id": "RC-043A908C9263BF6A",
      "title": "Make the agent loop finish, recover and stay inspectable",
      "url": "/collections/make-the-agent-loop-finish-recover-and-stay-inspectable"
    }
  ]
}
