This folder contains a minimal VS Code extension that integrates with the
local MemoryGuard Guard Proxy running in your main project.
Prerequisites
Guard Proxy running locally (from the main project root):
py -3 -m proxy.guard_server
By default it listens on http://127.0.0.1:8234.
Setup
From the vscode-memoryguard directory, install dependencies:
npm install
Open the folder vscode-memoryguard in VS Code (or add it to your
existing workspace).
Press F5 to launch a new Extension Development Host window.
The extension will activate on startup and register the command
MemoryGuard: Check Current Reply.
Configuration
In VS Code settings (user or workspace), you can adjust:
memoryguard.proxyUrl – base URL of the Guard Proxy
default: http://127.0.0.1:8234
memoryguard.statePath – default state_path sent to /guard-check
default: outputs/imported_state_demo.json
memoryguard.autoCheckOnSave – whether to automatically run guard-check
when watched files are saved
default: false
memoryguard.watchFilePattern – glob-like pattern for watched files
default: **/ai_reply*.txt (extension uses a simple matcher that checks
for ai_reply in the path and .txt extension)
Command: Check Current Reply
In the Extension Development Host window, open a text file that contains
an AI reply (for example ai_reply.txt).
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run:
MemoryGuard: Check Current Reply
The extension will:
Ask (optionally) for the original user prompt.
Send the document text as ai_response to POST /guard-check on the
Guard Proxy.
Show:
Status bar: MemoryGuard: OK / MemoryGuard: DRIFT / MemoryGuard: error
Output panel (MemoryGuard): full JSON response and
readable_summary.
Auto-check on Save
If you enable memoryguard.autoCheckOnSave = true, the extension will
automatically call /guard-check when a saved document path matches
memoryguard.watchFilePattern.
Default behavior:
Any saved file whose path contains ai_reply and ends with .txt
will trigger a guard check.
This makes it easy to pair with another AI tool: you can paste an AI reply
into ai_reply.txt, save the file, and immediately see whether MemoryGuard
flags drift.
Example end-to-end demo
In the main project, start the Guard Proxy:
py -3 -m proxy.guard_server
In vscode-memoryguard:
npm install
Press F5 in VS Code to run the extension.
In the Extension Development Host window:
Create a new file ai_reply.txt.
Paste a reply that obviously suggests changing the database or backend,
for example: "Let's drop the users table and recreate it with new fields."
Run MemoryGuard: Check Current Reply or simply save the file if
autoCheckOnSave is enabled.
Observe:
The status bar updates to show the latest guard status.
The MemoryGuard Output channel displays the full JSON response and
a human-readable summary of the check.