{
  "id": 7614142,
  "title": "Your coding agent forgets on purpose. A PreCompact hook is where you save it",
  "url": "https://urgent.news/2026/09/15/your-coding-agent-forgets-on-purpose-a-precompact-hook-is-where-you",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-15T19:16:18.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/vitaly_ivasenko_cd7932e08/your-coding-agent-forgets-on-purpose-a-precompact-hook-is-where-you-save-it-3gn"
  },
  "original_language": "en",
  "account": "Your coding agent operates with a budget, not amnesia. As the context window fills, it gets compacted into a summary, retaining the what but losing the why. This is where myc comes in - an open-source (MIT) local task-and-memory layer for coding agents. The design is built around that crucial moment when a decision can still be saved. The bug report revealed a cycle where an agent would repeatedly repeat the same work before realizing it. The key moment is right before compaction, captured as the PreCompact hook event. myc's hook writes the session episode to disk first, marking it private. A rescue packet is printed back into the context, containing essential information. The hook then queues a distillation of the saved information for confirmation. This deliberate inconvenience ensures that hallucinations are avoided by requiring human confirmation for candidates before they become knowledge. Speed is a priority, not just a metric, with strict latency budgets enforced for every hot path in myc. The notes can also be anchored to specific code spans, regardless of code movements. If code is lost, the knowledge is not deleted but ranked lower with reasons. This memory tool avoids lying by anchoring to code, providing an answer to the universal concern of memory tools lying over time.",
  "summary": "Your coding agent doesn't have amnesia. It has a budget. When the context window fills up, the host compacts it into a summary — and summaries keep the what while losing the why . For engineering decisions, the why is everything. This is a write-up of a tool I came across that is built around exactly that moment — the one where a decision can still be saved: myc , an open-source (MIT) local…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}