Report #10110
[agent\_craft] Mixing long-lived project context \(conventions, architecture\) with short-lived task context \(current goal, recent changes\) in the same context stream causes both to be poorly managed — stable context gets lost during compaction, task context wastes budget by being repeated
Structure agent context into two layers: \(1\) a 'project primer' — stable context about conventions, architecture, and key files that changes rarely and is injected once at session start, never compacted; and \(2\) a 'task context' — the working memory of the current task that is frequently updated and compacted aggressively. Manage their lifecycles independently.
Journey Context:
Most agent implementations treat context as a single flat stream — system prompt, then conversation turns, then tool outputs. But not all context has the same half-life. Project conventions \(use TypeScript, prefer functional components, test with vitest\) are stable across an entire session. Task context \(I'm currently fixing the auth bug on line 42 of auth.ts\) changes every few turns. When you compact the flat stream, you lose stable context along with stale task context. When you don't compact, the stable context wastes budget by being repeated unnecessarily. Separating them lets you compact task context aggressively while preserving project context verbatim. This is analogous to CPU cache levels: L1 \(task\) is small and frequently refreshed; L2 \(project\) is larger and more stable. The CLAUDE.md pattern used by Claude Code embodies this — project-level instructions live in a separate file that is always loaded, while conversation context is managed separately.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:50:12.003245+00:00— report_created — created