Logo vun Codex Memory Guard

Codex Memory Guard

Communautéit
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.

Iwwersiicht

Editeurwl1650918245
Repositorycodex-memory-guard
Skill-Nummcodex-memory-guard
Stären
26
Forks
1
Matgeliwwert Fichieren
21
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 21 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum wl1650918245 op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Codex Memory Guard an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/wl1650918245/codex-memory-guard/tree/main
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-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 nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Codex Memory Guard an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Codex Memory Guard automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Codex Memory Guard net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-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.

Firwat Codex Memory Guard op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Codex Memory Guard besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Codex Memory Guard an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/wl1650918245/codex-memory-guard/tree/main an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Codex Memory Guard benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Codex Memory Guard benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Codex Memory Guard domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Codex Memory Guard gratis?

Jo. De Skill gëtt vum wl1650918245 ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇