Principle

Store durable task state outside the context window

Context is working memory, not a durable project database.

When it fits

  • The agent keeps all progress, decisions and open items only in conversation history.

When to avoid it

  • Persistent memory can become stale or wrong; attach timestamps, versions or source references to important state.

Why it matters

Persist structured task state—todo status, decisions, artifact references, constraints and unresolved questions—in an external file, database or workflow state. Rehydrate only what the next step needs. This makes continuity less dependent on one increasingly polluted context window.

An example

Keep `STATE.md` or a structured workflow record with current branch, completed tasks, test status and open blockers instead of relying on 80,000 tokens of chat history.

Check your result

Important project state survives a fresh context and can be inspected independently.

Keep this limit in mind

  • Persistent memory can become stale or wrong; attach timestamps, versions or source references to important state.

Connected ideas

Useful with
Carry data lineage through derived outputs

Evidence and sources

Supports

Anthropic and current long-running-agent frameworks recommend structured memory or durable state outside the context window for continuity.

Persistent memory can become stale or wrong; attach timestamps, versions or source references to important state.

Effective context engineering for AI agents · See source record

All sources (1)