Memory and Learning — A Toolkit That Gets Better
Per-Prompt Recall and Automatic Capture
Memory That Shows Up When It Matters
Recall on Every Prompt
A UserPromptSubmit hook attaches up to three full memories to each prompt, ranked by keyword search (BM25) plus a local embedding model when one is already running. It never blocks the prompt and stays under 6 KB. Where recall delivers, the startup block shrinks to the always-on core (importance 4 and up).
MEMORY_RECALL=off(orMEMORY_PROFILE=minimal) turns it offMEMORY_EMBED_URLcan list several embedding servers, comma-separated, best machine first. Each prompt's recall tries them in order within 400 ms; a server that is refused, unreachable or missing the model is tried last for the next 2 minutes. Every listed server must carry the same embedding model
Capture, Opt-In
With MEMORY_CAPTURE=on, a finished session is mined for candidates: quote-verified, secret-filtered drafts that wait for you.
node .claude/core/memory-capture.js list # pending candidates
node .claude/core/memory-capture.js promote <id> # keep one
node .claude/core/memory-capture.js discard <id> # drop one
node .claude/core/memory-capture.js status # provider chain, servers, recent failures
Nothing reaches an agent until it is promoted. Capture can run through an API key, an OpenAI-compatible server or your own Claude login (MEMORY_CAPTURE_PROVIDER=claude-cli).
Notes and Sync
Beside the JSON memories sits a plain-markdown notes store. memory-capture.js sync carries notes between machines through the tracked docs/.output/.memory/notes folder: a three-way merge that reports conflicts, never deletes and skips secrets (MEMORY_SYNC=on automates it).
The CLI and sync work on Claude and Codex; the recall and capture hooks are Claude-only.
A recalled memory is what was true when it was written. If it names a file, function or flag, check that it still exists before acting on it.
Session capture is on and has staged a candidate. When does an agent first see it?