Codex CLI stores project memory
The demo writes a checkout-service decision and preference through EngramAccessService.memoryStore().
A five-minute, source-checkout demo that stores a real Remnic project decision, switches agent sessions, recalls the correct scoped context, and prints the X-ray reason for every memory that surfaced.
codex-cli:session-a
memoryStore(namespace="project-checkout-service") Decision and preference are persisted as real Remnic memory files.
claude-code:session-b
recallXray(includeRecall=true) Only checkout-service memories return. Marketing-site stays out.
why it surfaced
scope=namespace:project-checkout-service servedBy=recent-scan What it proves
The demo is intentionally small: store a preference and decision in one tool, switch sessions, then ask the second tool to recall the same project context with an explanation.
The demo writes a checkout-service decision and preference through EngramAccessService.memoryStore().
The active identity switches from codex-cli:session-a to claude-code:session-b.
The second session queries project-checkout-service and does not receive the unrelated marketing-site decision.
Each surfaced memory includes namespace scope and retrieval provenance so the agent can inspect why context appeared.
Five-minute walkthrough
It works locally from the open-source repo. By default it disables OpenAI, QMD, embeddings, local LLMs, and direct-answer annotation, so no private API keys are required.
git clone https://github.com/joshuaswarren/remnic.git cd remnic pnpm install pnpm run demo:coding-agent-memory pnpm run test:coding-agent-memory-demo Expected output
The important lines are the scoped write, the cross-session recall, the X-ray reason, and the scope check that confirms unrelated memory did not leak in.
$ pnpm run demo:coding-agent-memory
Remnic coding-agent memory demo
engine: real @remnic/core Orchestrator + EngramAccessService
apiKeys: none (OpenAI disabled, QMD disabled)
1) codex-cli / session-a stores real Remnic memories via memoryStore()
stored decision "checkout retry-policy decision" -> namespace=project-checkout-service status=stored
stored preference "checkout change-note preference" -> namespace=project-checkout-service status=stored
stored decision "marketing-site unrelated decision" -> namespace=project-marketing-site status=stored
2) switch to claude-code / session-b and recall through recallXray(includeRecall=true)
active namespace: project-checkout-service
query: payment retry policy decision and change notes
recalled 2 real Remnic memories
- preference
why: scope=namespace:project-checkout-service; servedBy=recent-scan; served-by=recent-scan
- decision
why: scope=namespace:project-checkout-service; servedBy=recent-scan; served-by=recent-scan
3) scope check
marketing memory surfaced: no
result: PASS - claude-code:session-b recalled checkout-service context written by codex-cli:session-a using real Remnic storage and recall.
The script creates a real @remnic/core orchestrator,
writes through EngramAccessService.memoryStore(), and
recalls through EngramAccessService.recallXray().
It is in-process so you can run it from a checkout without starting
the daemon, but it uses the same access-service path.
Checkout-service memories are written to
project-checkout-service. The unrelated
marketing-site decision is written to
project-marketing-site. The recall query runs only in
the checkout namespace and reports the namespace in its X-ray.
The generated memory files live under the demo directory, are gitignored, and can be reset safely. The smoke test asserts the output, persisted markdown, tilde expansion, and reset guard rails.