How to give Claude Code, Codex, and Cursor the same memory: a 5-layer shared context setup
Arindam_1729 · x · 2026-10-22
A practical 5-layer setup for sharing context across Claude Code, Codex, Cursor, and OpenCode. Key insight: AGENTS.md unified the rules file, but knowledge—the retry policy, API quirks, why a decision was made—doesn't fit in it, and built-in memory stays on one machine with one tool.
Test: ask Claude Code in one repo and Codex in another the same question. If they don't cite the same file, they share a naming convention, not memory.
The layers:
- AGENTS.md holds rules only, under 200 lines, plus a pointer to where knowledge lives
- Write docs for grep, not browsing: one topic per file, keywords in the first lines
- One server every agent reads from, instead of copies going stale per repo
- Agents read-only by default; writes go into a human-reviewed inbox
- The diagram shows OpenLore (identity + grants + in-memory shell with cat/grep/find/jq) accessed via MCP :8080, SSH-mounting a docs/ tree (how-to, architecture, api, incidents), with humans and CI jobs also connected
More from coding & agent
- Open-source AI video previz tool CozyClay gets a deep-dive demo — cocktailpeanut · 2026-10-23
- Supabase adds one-command MCP servers so ChatGPT and Claude can drive your app — dshukertjr · 2026-10-23
- Grok Bot ships with its own cloud computer: browser, terminal and filesystem to finish tasks — nima_owji · 2026-10-23
- Neon ships official AI Gateway adapter for TanStack AI with single-credential multi-model access — matei_zaharia · 2026-10-23
- Reflection AI's Beam agent auto-builds a Gemma-4 fine-tuning notebook, boosting accuracy 66.5% — danielhanchen · 2026-10-23
- Cua Spaces SDK lets Hermes and other agents run in sandboxes on your own hardware — Teknium · 2026-10-23