Context Sync
Render approved project memory into the files that coding agents and editors already inspect.
What it writes
Context Sync writes managed blocks to:
AGENTS.mdCLAUDE.md.github/copilot-instructions.mdMEMORY.md.cursor/rules/memoryguard.mdc
These are the same files your coding tools already read. MemoryGuard does not introduce a new file format; it keeps the familiar ones aligned with approved project memory.
Basic flow
memoryguard remember "Package manager: pnpm." memoryguard remember "FastAPI was superseded by Flask." memoryguard sync memoryguard status
memoryguard sync generates a context diff, writes the pending plan, and applies it in one step. memoryguard context generate shows the diff and waits formemoryguard context approve if you want a two-step flow.
Watch for drift
memoryguard context watch polls the project and either applies the diff (--yes) or prints a pending diff for you to approve.
# print a pending diff whenever memories change memoryguard context watch # apply immediately when changes are detected memoryguard context watch --yes --once
Supersession
Projects change. MemoryGuard is designed to preserve that change instead of hiding it. When a newer approved memory replaces an older one, generated context can show the current fact while keeping useful history such as “FastAPI was previously used; superseded by Flask.”
Mark a superseded relationship explicitly with memoryguard resolve:
memoryguard resolve <old_memory_id> --superseded-by <new_memory_id>
Managed blocks
MemoryGuard writes managed context blocks bounded by <!-- memoryguard:context:start --> and <!-- memoryguard:context:end --> markers. Rerun memoryguard sync whenever the truth of your project changes, and the managed section refreshes in place.
Review before publishing
Treat generated context as code-adjacent output. Review AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, MEMORY.md, MEMORY.md, and the Cursor rules before committing or sharing them.