Memory and context

Do not mix these layers:

LayerMechanismLifetime
Plantodowrite full listSession (protected in compact)
WorkingMessages in the windowTurn / until compact
Prior-stateCompact recovery blockSession
EpisodicSQLite transcriptDurable audit
Durable.zox/memory/*.md, /remember, memory_writeCross-session
SemanticCode indexFTS/BM25 today

Durable memory

Auto-summarize (default on): on SessionEnd, write into .zox/memory/auto/. Disable with "memory": { "autoSummarize": false } or ZOXX_MEMORY_AUTO_SUMMARIZE=0.

/remember stores an explicit note. Startup can inject recent memories (startupInjectCount).

Tools: memory_write / memory_search. See Tools.

Context, compaction, budgets

The context engine estimates tokens, assembles the next request, and can compact when near the window.

  • /context — breakdown.
  • /compact — run compaction now.
  • budget.preCompactTokenThreshold — soft mark (set what fits your model).
  • budget.maxTurns / budget.maxUsdPerTask — stop the loop.

Overflow: threshold × windowTokens. Optional prune of old tool bodies (protect plan, skills, recent errors). Details: spec/context.md on GitHub.

Hooks: PreCompact / PostCompact. See Hooks.