Meta Mode Memory (Sandbox MVP)
Use this skill when you need compact, durable task-state memory in the repo without external services, hooks, or model-dependent indexing. It is not a store for raw chat history.
If project/local policy forbids main-thread local execution, command examples in this skill are for scoped delegated worker/runtime lanes only.
When to apply
- Capture compact durable notes during implementation.
- Append structured session, reflection, or decision snapshots (checkpoints).
- Ingest markdown or text docs into memory inbox/ingest.
- Compile deterministic knowledge pages from saved files.
- Query stored memory by keywords.
- Run an audit for structure and markdown-link health.
Codex-safe behavior
- File-first only: no network, no DB, no non-stdlib deps.
- All active memory writes are rooted under
.codex-memory unless host/project policy sets META_MODE_MEMORY_ROOT.
- Root resolution is portable: default auto-detect + optional
META_MODE_MEMORY_REPO_ROOT / META_MODE_MEMORY_ROOT. Legacy archives under .agents/memory are read-only historical inputs unless host/project policy explicitly selects them.
- Deterministic compilation and ranking (no LLM summarization).
- Memory entries should persist stable facts, decisions, blockers, validation, changed files, and next steps.
- Before asking the user for previously settled context or exact prior state, query compact memory first.
- Generic retrieval order:
state/current.json -> state/checkpoints/* -> query_memory.py / compiled knowledge -> project-defined archive pointers -> ask user only if unresolved.
- Keep all entries compact and machine-actionable for later replay.
- Avoid storing raw logs, full file contents, secrets, tokens, or long diffs.
- Test artifacts should be cleaned up or clearly labeled test data.
Compact state layer (required)
- The durable state layer is rooted at:
.codex-memory/state/current.json (single source of last known compact state)
.codex-memory/state/checkpoints/*.json (timestamped immutable checkpoint artifacts)
.codex-memory/daily/*.md remains the human-readable log surface.
- Pair each session checkpoint with:
- one markdown daily entry
- one compact state update in
state/current.json and state/checkpoints/<id>.json
Guardrails
- Never store:
- raw chat transcripts
- raw logs or long diffs
- full source files
- credentials, secrets, tokens, or API keys
- duplicate universal/project policy text
Memory layout
See resources/schema.md for file structure and markdown formats.
See resources/workflow.md for the preferred session workflow and end-of-session checkpoint command.
Commands
Run from repo root (or set META_MODE_MEMORY_REPO_ROOT / META_MODE_MEMORY_ROOT first). These paths assume a vendored/project copy at .agents/skills/meta-mode-memory; for an installed user-level skill, resolve script paths relative to that skill directory:
python .agents/skills/meta-mode-memory/scripts/save_note.py "short text" --title "Optional title" --tag mvp --kind note
python .agents/skills/meta-mode-memory/scripts/append_daily_log.py --kind reflection --title "Session wrap" --body "What changed and why"
python .agents/skills/meta-mode-memory/scripts/session_checkpoint.py --title "Session checkpoint" --tag mvp --decision "Decision text" --do-not-reask-decision "Settled decision text" --body "Summary text"
python .agents/skills/meta-mode-memory/scripts/ingest_docs.py
python .agents/skills/meta-mode-memory/scripts/compile_knowledge.py
python .agents/skills/meta-mode-memory/scripts/query_memory.py "search terms" --limit 8
python .agents/skills/meta-mode-memory/scripts/lint_audit.py
Suggested workflow
- Capture notes with
save_note.py or append_daily_log.py.
- At session end, write one markdown daily entry and run
session_checkpoint.py.
session_checkpoint.py must align with the compact state files:
- updates
.codex-memory/state/current.json
- appends a new
.codex-memory/state/checkpoints/*.json entry
- Drop docs into
.codex-memory/inbox and run ingest_docs.py.
- Rebuild compiled pages with
compile_knowledge.py.
- Run
query_memory.py for retrieval and lint_audit.py for health checks.
1---2name: meta-mode-memory3description: File-first memory sandbox for Codex. Stores compact durable task-state snapshots, ingests docs, and compiles deterministic knowledge pages, with query and lint/audit support.4---56# Meta Mode Memory (Sandbox MVP)78Use this skill when you need compact, durable task-state memory in the repo without external services, hooks, or model-dependent indexing. It is not a store for raw chat history.9If project/local policy forbids main-thread local execution, command examples in this skill are for scoped delegated worker/runtime lanes only.1011## When to apply1213- Capture compact durable notes during implementation.14- Append structured session, reflection, or decision snapshots (checkpoints).15- Ingest markdown or text docs into memory inbox/ingest.16- Compile deterministic knowledge pages from saved files.17- Query stored memory by keywords.18- Run an audit for structure and markdown-link health.1920## Codex-safe behavior2122- File-first only: no network, no DB, no non-stdlib deps.23- All active memory writes are rooted under `.codex-memory` unless host/project policy sets `META_MODE_MEMORY_ROOT`.24- Root resolution is portable: default auto-detect + optional `META_MODE_MEMORY_REPO_ROOT` / `META_MODE_MEMORY_ROOT`. Legacy archives under `.agents/memory` are read-only historical inputs unless host/project policy explicitly selects them.25- Deterministic compilation and ranking (no LLM summarization).26- Memory entries should persist stable facts, decisions, blockers, validation, changed files, and next steps.27- Before asking the user for previously settled context or exact prior state, query compact memory first.28- Generic retrieval order: `state/current.json` -> `state/checkpoints/*` -> `query_memory.py` / compiled knowledge -> project-defined archive pointers -> ask user only if unresolved.29- Keep all entries compact and machine-actionable for later replay.30- Avoid storing raw logs, full file contents, secrets, tokens, or long diffs.31- Test artifacts should be cleaned up or clearly labeled test data.3233## Compact state layer (required)3435- The durable state layer is rooted at:36 - `.codex-memory/state/current.json` (single source of last known compact state)37 - `.codex-memory/state/checkpoints/*.json` (timestamped immutable checkpoint artifacts)38- `.codex-memory/daily/*.md` remains the human-readable log surface.39- Pair each session checkpoint with:40 - one markdown daily entry41 - one compact state update in `state/current.json` and `state/checkpoints/<id>.json`4243## Guardrails4445- Never store:46 - raw chat transcripts47 - raw logs or long diffs48 - full source files49 - credentials, secrets, tokens, or API keys50 - duplicate universal/project policy text5152## Memory layout5354See `resources/schema.md` for file structure and markdown formats.55See `resources/workflow.md` for the preferred session workflow and end-of-session checkpoint command.5657## Commands5859Run from repo root (or set `META_MODE_MEMORY_REPO_ROOT` / `META_MODE_MEMORY_ROOT` first). These paths assume a vendored/project copy at `.agents/skills/meta-mode-memory`; for an installed user-level skill, resolve script paths relative to that skill directory:6061```powershell62python .agents/skills/meta-mode-memory/scripts/save_note.py "short text" --title "Optional title" --tag mvp --kind note63python .agents/skills/meta-mode-memory/scripts/append_daily_log.py --kind reflection --title "Session wrap" --body "What changed and why"64python .agents/skills/meta-mode-memory/scripts/session_checkpoint.py --title "Session checkpoint" --tag mvp --decision "Decision text" --do-not-reask-decision "Settled decision text" --body "Summary text"65python .agents/skills/meta-mode-memory/scripts/ingest_docs.py66python .agents/skills/meta-mode-memory/scripts/compile_knowledge.py67python .agents/skills/meta-mode-memory/scripts/query_memory.py "search terms" --limit 868python .agents/skills/meta-mode-memory/scripts/lint_audit.py69```7071## Suggested workflow72731. Capture notes with `save_note.py` or `append_daily_log.py`.742. At session end, write one markdown daily entry and run `session_checkpoint.py`.753. `session_checkpoint.py` must align with the compact state files:76 - updates `.codex-memory/state/current.json`77 - appends a new `.codex-memory/state/checkpoints/*.json` entry784. Drop docs into `.codex-memory/inbox` and run `ingest_docs.py`.795. Rebuild compiled pages with `compile_knowledge.py`.806. Run `query_memory.py` for retrieval and `lint_audit.py` for health checks.