Logo van Codex Memory Guard

Codex Memory Guard

Community
wl1650918245
codex-memory-guard

Guard task boundaries and preserve confirmed critical project state across Codex compaction. Use when a user wants topic-switch guidance, write-through critical memory, compact HANDOFF checkpoints, PreCompact and compact-resume hooks, four-layer Markdown memory initialization, or memory workflow auditing.

Overzicht

Uitgeverwl1650918245
Repositorycodex-memory-guard
Skillnaamcodex-memory-guard
Sterren
26
Forks
1
Meegeleverde bestanden
21
LicentieMIT
Links
  • Instructies in Markdown

    Een SKILL.md-bestand dat het model laadt wanneer nodig, zodat het alleen tokens kost als een verzoek er daadwerkelijk bij past.

  • Werkt met elk LLM

    AI-skills zijn gewone Markdown, geen aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • 21 meegeleverde bestanden

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. Bestanden zijn alleen-lezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door wl1650918245 op GitHub. Lees de broninhoud voordat je de skill installeert.

Installatie

Installeer de AI-skill Codex Memory Guard in TypingMind om deze met elke LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map — het leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/wl1650918245/codex-memory-guard/tree/main
  4. Schakel de skill in elke chat in waarin je deze beschikbaar wilt hebben.
Plug-ins → Skills → Nieuwe skill → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wl1650918245/codex-memory-guard.git \
  .claude/skills/codex-memory-guard
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Codex Memory Guard in een willekeurige chat in TypingMind in en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek erbij past, laadt het model zelf de volledige instructies — je hoeft de skill nooit handmatig aan te roepen en deze kost pas tokens wanneer je de skill daadwerkelijk gebruikt.

Het model laadt Codex Memory Guard automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Codex Memory Guard niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Codex Memory Guard

Keep tasks small enough to finish before compaction when practical. Persist confirmed critical state when it appears, keep the recovery checkpoint compact, and preserve a raw transcript reference as the final fallback.

This Skill does not prevent compaction or promise lossless retention of every chat detail. It makes confirmed critical decisions, constraints, verified lessons, blockers, and execution state durable, reviewable, and traceable.

Workflow

  1. Apply the task-boundary state machine when the current goal is unfinished. Compare the new input with the current goal before estimating its duration.
  2. Inspect the target project for existing AGENTS.md, memory files, and .codex/hooks.json.
  3. Run scripts/initialize-memory-system.ps1 for the target root. It creates all four memory layers when missing and preserves existing content.
  4. Run scripts/install.ps1 only after the user authorizes global installation. It installs the Hooks and safely upserts a marked policy block in the user's global AGENTS.md without replacing other rules.
  5. Tell the user to review and trust the new handlers through /hooks; never claim they are active before trust is confirmed.
  6. Verify with scripts/test.ps1 in an isolated temporary directory. The test covers multi-task and legacy HANDOFF validation, bounded post-HANDOFF transcript delta review, legacy pending compatibility, scope isolation, ready and recovery-required resume paths, pending closure and cleanup, installation, and scoped uninstall.
  7. After a real compaction, inspect memory/inbox/pending-*.json and the short HANDOFF.md; review the bounded transcript delta after HANDOFF's recorded last write before closure, then widen transcript search only when the checkpoint is insufficient or conflicting.

Task boundary policy

Use these states: ACTIVE, BOUNDARY_CANDIDATE, CONTINUE_CURRENT, SWITCH_RECOMMENDED, and COMPLETED.

For each new input while the state is ACTIVE:

  1. Identify the single current goal from the conversation and short HANDOFF.md when present.
  2. Decide whether the input directly advances that goal.
  3. If it does not, decide whether it is still a goal-related clarification, objection, correction, implementation adjustment, same-deliverable addition, or result check.
  4. If neither applies and the input can open an independent discussion or action direction, enter BOUNDARY_CANDIDATE and give one lightweight reminder. Do this even when the new topic might end within one or two turns; do not require the user to label it as a test.

Treat the following as additional boundary evidence:

  • the project or working directory changes;
  • the final deliverable or acceptance criteria change;
  • two unrelated current goals would be needed in HANDOFF.md;
  • the unfinished current task would be displaced by another multi-turn task;
  • the new work has materially different permissions, risks, or side effects.

Ask whether the user wants a separate Codex task; do not create one without an explicit request. If the user stays, enter CONTINUE_CURRENT for that boundary and do not repeat the reminder unless a distinct boundary appears. If the user chooses a separate task, enter SWITCH_RECOMMENDED. When the current goal is closed, enter COMPLETED and do not warn merely because the next topic differs.

The short-tangent exemption applies only when the tangent is directly related to the current goal. A short but clearly unrelated topic is still a boundary candidate. Do not persist routine state labels; record only a boundary choice needed for reliable resume. For the normative transition table and examples, read references/task-boundary-state-machine.md when implementing, auditing, or testing boundary behavior.

Memory policy

  • Treat the transcript as evidence, not default model context.
  • Write confirmed critical information when it appears; do not wait for compaction. Explicit phrases such as "remember this", "this is final", "use this from now on", or equivalent require immediate persistence and a read-back confirmation with the destination path.
  • Critical information includes confirmed decisions, user constraints, acceptance criteria, verified lessons, active blockers, exact state required to resume, and facts whose loss would cause rework or duplicate side effects.
  • Keep exactly one HANDOFF.md per project. It contains only started, unfinished work that must survive compaction or a window change; the complete backlog belongs in GitHub Issues or the project's chosen tracker.
  • Do not impose a fixed active-task count. For each active task keep a short title, one or two sentences of background, current verified state, one next action, and optional Issue/Spec/report pointer, up to three key files, and the latest relevant Session ID as an evidence locator only. Target 1000-2000 Chinese characters and enforce a 3000-character hard limit.
  • Before editing HANDOFF.md, reread the latest file and update only the matching task entry. Read back after writing; if the file changed concurrently, reread and merge instead of overwriting other tasks. Remove completed, cancelled, or no-longer-resumable tasks promptly.
  • Use DECISIONS.md for confirmed decisions with source and invalidation conditions.
  • Use LESSONS.md only for practices verified in real work.
  • Route unconfirmed observations to memory/YYYY-MM-DD.md.
  • Create all four layers, but load only HANDOFF.md by default. Read other layers only when the current question needs them.
  • Never store credentials, tokens, or secrets in memory artifacts.
  • Preserve conflicting history and mark supersession; do not silently rewrite it.
  • Durable entries use explicit lifecycle states when applicable: active, superseded, archived, or revoked. Only active entries participate in default recovery.
  • Read back every critical-memory write and verify content, source, scope, status, and invalidation or review conditions.

Hook behavior

  • PreCompact validates HANDOFF.md deterministically before writing the pending record. The record includes layout, active-task count, structure and length status, issues, last-write time, SHA-256, project scope, session and transcript evidence pointers, and recovery_required. It does not copy transcript contents or perform semantic summarization.
  • Hooks are opt-in per initialized project: if no ancestor contains MEMORY_WORKFLOW.md, they return without creating files.
  • SessionStart matching compact verifies project root, session, HANDOFF path and transcript pointer before trusting the record. It reads HANDOFF first, then reviews only transcript entries after the recorded HANDOFF last_write_at through the pre-compaction turn so a structurally valid but semantically stale checkpoint cannot silently skip last-minute confirmed state. A failed checkpoint or conflicting delta may require a wider targeted transcript repair.
  • After recovery, run scripts/close-pending.ps1 with the actual sources used. Schema v4 closure requires -DeltaChecked and records the delta turn count, critical updates found, whether HANDOFF changed, processed_at, repair status, resolved issues and final HANDOFF SHA-256. Legacy schema v3 awaiting_extraction records remain compatible. scripts/cleanup-pending.ps1 is dry-run by default and may delete only processed records older than its explicit retention threshold when -Apply is supplied.
  • Keep both hooks synchronous. The default installation timeout is 10 seconds because they perform local small-file operations only.
  • The command hook does not perform semantic extraction itself. Critical state should already be written through when confirmed; the deterministic pre-check and post-compaction closure are the fallback.

Inspect the bounded post-HANDOFF transcript delta:

powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/get-transcript-delta.ps1 -PendingPath C:\path\to\pending.json

The reader returns only user/assistant messages after the recorded HANDOFF write and through pending capture time, capped at 12 messages and 12000 characters by default. If truncated is true, continue with a targeted search before closure.

Deliberate boundaries

Keep this Skill a lightweight, deterministic task-continuity guard rather than turning it into a full memory platform.

  • The bounded transcript delta is a narrow stale-checkpoint safeguard. The Skill does not continuously infer semantic freshness from Git history, remote releases, issue trackers, file meaning, or every conversation turn; those probes add latency and still cannot prove that a checkpoint is semantically complete.
  • Long-term semantic recall through Codex memories, OpenViking, Trellis, vector databases, hybrid search, cloud storage, or custom MCP servers has been considered but is not implemented or required. Those systems solve broader cross-session retrieval and may be layered alongside this Skill when their privacy, operating cost, failure modes, and retrieval quality are acceptable.
  • Do not treat recalled backend content as confirmed project truth. HANDOFF remains the small resumable execution checkpoint; confirmed decisions and verified lessons remain reviewable project files; transcript and Git remain evidence.
  • Preserve offline degradation: if an optional memory backend is unavailable, the core HANDOFF, pending record, bounded transcript review, and closure workflow must still work.

There is currently no backend adapter contract. Do not imply that installing this Skill enables semantic search, vector storage, cross-project recall, or automatic knowledge extraction.

Validate a checkpoint:

powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/validate-handoff.ps1 -Path C:\path\to\project\HANDOFF.md

Close a processed recovery record:

powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/close-pending.ps1 -PendingPath C:\path\to\pending.json -SourcesUsed HANDOFF.md,'bounded transcript delta' -DeltaChecked -DeltaTurnCount 4 -CriticalUpdatesFound 1 -HandoffUpdatedFromDelta

Preview cleanup of processed records older than 14 days:

powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/cleanup-pending.ps1 -ProjectRoot C:\path\to\project

Commands

Initialize one project:

powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/initialize-memory-system.ps1 -Root C:\path\to\project -SingleProject

Initialize every immediate child project:

powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/initialize-memory-system.ps1 -Root C:\path\to\projects

Install global hooks and optionally initialize a project:

powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/install.ps1 -ProjectRoot C:\path\to\project

Remove only this Skill's global hooks:

powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/uninstall.ps1

Uninstall also removes only the marked codex-memory-guard block from global AGENTS.md; it preserves all other global rules and project memory files.

For schemas and acceptance checks, read references/memory-contract.md.

Meegeleverde bestanden

Het model leest deze bestanden wanneer nodig terwijl de skill geladen is. Ze worden beschikbaar gesteld als leesbare bestanden en worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Codex Memory Guard?

Guard task boundaries and preserve confirmed critical project state across Codex compaction. Use when a user wants topic-switch guidance, write-through critical memory, compact HANDOFF checkpoints, PreCompact and compact-resume hooks, four-layer Markdown memory initialization, or memory workflow auditing.

Waarom Codex Memory Guard gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Codex Memory Guard bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model, en je kunt midden in een chat van model wisselen zonder dat de skill niet meer werkt. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Codex Memory Guard in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/wl1650918245/codex-memory-guard/tree/main. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Codex Memory Guard gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Codex Memory Guard gebruiken?

Zoveel als je wilt. Zolang een model skills ondersteunt, kun je Codex Memory Guard ermee gebruiken: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama en meer. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Codex Memory Guard gratis?

Ja. Deze skill is door wl1650918245 op GitHub gepubliceerd onder de licentie MIT. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. Deze volgt het open Agent Skills-formaat: een bestand met de naam SKILL.md met een naam en beschrijving, plus eventuele scripts, sjablonen of referentiebestanden die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇