Skip to main content

Your coding agents forget your repo every time you switch. What a shared memory layer should do

Steven Liechti

Steven Liechtifounder of Koru

8 minute read
Two black microchips resting on a glossy blue surface, for memory that coding agents can share.

Short answer

A memory layer for coding agents keeps your repo's conventions, decisions and preferences in one place, so you save them once and every assistant can reuse them across sessions, devices and projects. A good one keeps project memory scoped to its repo, lets you choose who and what reads each part, asks before sharing and stays private by default.

I switch between coding agents all day: Claude Code in one terminal, Codex in another, Cursor in the editor, ChatGPT to think a design through. None of them knows what the others learned, and a new session often doesn't know what the last one learned either. So I explain the repo again: the build commands, the conventions, why we picked this crate, the mistake I never want to see twice.

This post covers what the tools offer today, from their own docs, where that runs out, and what I think a shared memory layer for coding agents should do. At the end I'll explain how we're approaching it with Koru Connect, which is in development.

Why do coding agents forget your repo?

Because they start from nothing. Claude Code's docs say each session begins with a fresh context window, and Cursor's say large language models don't retain memory between completions. Whatever an agent knows about your project has to be loaded from somewhere, and each tool has built its own somewhere.

Agents read the code well. What gets lost is everything the code doesn't say:

  • Conventions the linter doesn't enforce: naming, where new modules go, which patterns are on their way out.
  • Decisions and their reasons: why one library and not the obvious alternative, and what was tried and dropped.
  • Preferences: how you write commits, when to run the tests, how much explanation you want.
  • Where the work stands: what's half done, what's blocked, what you agreed to come back to.

The code tells an agent what the project is. It doesn't tell it what you've already decided.

What do CLAUDE.md, AGENTS.md and Cursor rules already do?

A lot, and it's worth knowing first. Each tool loads instruction files at the start of a session, at more than one scope:

ToolFor one projectFor you, in every project
Claude CodeCLAUDE.md in the repo, shared through source control, and a gitignored CLAUDE.local.md for your own notes. Auto memory: notes Claude writes itself, kept per repository.~/.claude/CLAUDE.md
CodexAGENTS.md files from the project root down to the current directoryAGENTS.md in ~/.codex
CursorProject rules in .cursor/rules, version-controlled, and AGENTS.mdUser Rules, set in Cursor
ChatGPTNot a repo toolMemory: preferences and details remembered from your chats, managed under Settings, Personalization, Memory
From each tool's own documentation, checked October 21, 2026. See the sources below.

AGENTS.md deserves a special mention. It's an open format, described on its site as a README for agents, and it's now stewarded by the Agentic AI Foundation under the Linux Foundation. Codex reads it before doing any work, Cursor supports it, and Claude Code reads it in place of CLAUDE.md when the repo has no CLAUDE.md. If you take one practical thing from this post, put your build commands and conventions in an AGENTS.md today.

Claude Code lets you browse and edit its memory with /memory, and ChatGPT lets you review, correct and delete what it remembers. Seeing what an assistant was told is the right default.

Where do memory files and rules files run out?

They give one tool instructions for one repo, and they do that well. The gaps show up when you work across tools:

  • Each tool reads its own copy. Your personal preferences live in ~/.claude/CLAUDE.md, in ~/.codex/AGENTS.md and in Cursor's User Rules. Say it once per tool, then keep the copies in sync by hand.
  • Project files are shared with everyone who clones. That's what they're for: Claude Code's docs describe the project CLAUDE.md as team-shared instructions and point personal, per-project notes to a gitignored CLAUDE.local.md. It's the right home for conventions and the wrong one for anything private.
  • Learned memory stays on one machine. Claude Code's docs say auto memory is machine-local and isn't shared across machines or cloud environments.
  • Files are scoped by path, not by reader. Any agent you run in a repo can load what is in it. There is no way to say that one assistant may read the project brief while another may not.
  • Decisions need someone to write them down. The reasoning behind a choice usually lives in a chat with one tool, and it stays there.

How do you keep Claude Code memory across sessions?

Today, with two mechanisms. CLAUDE.md is what you write: the docs call it the place to write down what you'd otherwise re-explain. Auto memory is what Claude writes: your corrections and preferences, and project context it can't get from the code. Both load at the start of each session, and /memory shows you both.

The limit is that both belong to Claude Code. Open the repo in Codex the next morning and yesterday's decision isn't there unless you copied it into AGENTS.md. A memory layer should make that copy unnecessary: save a decision once, and the next session gets it whichever assistant opens it.

It should also stay readable. Memory an agent writes for itself can be wrong, and a wrong memory is worse than none, because the next session trusts it. You should be able to see it, fix it and delete it.

Can your agents' memory follow you across devices?

Partly. Anything committed to the repo travels with git, so a second machine gets your AGENTS.md and project CLAUDE.md on the next pull. Your user-level files live in the home directory of the machine you wrote them on, and Claude Code's auto memory, by its own docs, doesn't leave that machine. On a new laptop you start with the team's instructions and none of your own.

A memory layer should follow you from desk to laptop without making a cloud upload the price. Moving context between your own devices doesn't need a third party to hold a copy, and when a copy does go to a server, that should be your choice, not the default. Koru Workspace already syncs devices directly with each other, so I know the direct route can be built.

What should follow you across projects, and what should stay in one repo?

The tools already split this the right way. Claude Code's ~/.claude/CLAUDE.md holds personal preferences for all projects, every repository inherits Codex's global AGENTS.md, and Cursor's User Rules apply across all projects. Project files stay with their repo. The problem is only that the personal layer exists once per tool.

A memory layer should keep the two scopes explicit:

  • Project memory belongs to one repo: build commands, architecture decisions, the constraints a client gave you. It should never show up in another project.
  • Personal memory follows you everywhere: how you write commits, the languages you prefer, how you like code reviewed.

If you do client work, this matters: one client's decisions must not leak into another client's repo.

What should a shared memory layer for coding agents do?

Search for shared memory for AI agents and you mostly find papers on how agents share state. For a developer, the first question is simpler: who can read what? Here is my list:

  • Save once, reuse it. A decision you explain to one assistant reaches the next without retyping.
  • Work across sessions, devices and projects, the three places context gets lost today.
  • Keep project memory scoped. What belongs to one repo stays there. What belongs to you follows you.
  • Let you choose who reads what, per assistant and per person.
  • Ask before sharing anything sensitive.
  • Show you what's stored, and let you edit it.
  • Private by default. Nothing is shared until you share it.
  • No cloud upload by default. Your context stays on your devices unless you choose otherwise.
  • Readable and portable. You can read it, export it and take it with you.
  • Open standards. Connect through MCP, an open-source standard for connecting AI applications to external systems, and respect formats like AGENTS.md.

How are we approaching this with Koru Connect?

Koru Connect is our attempt at this layer, and it's in development: it isn't available yet. Its page says what it's for in a few lines: your plans, preferences and project details, saved once and shared with the people and AI assistants you choose, with the rest kept private.

Connect is designed to keep the information you choose to save in one place, where you can read and update it, and to let you select which people and supported assistants may access particular details. The planned controls for an assistant's request are share selected details, ask me first and keep private. A planned sharing history shows what Connect shared and with whom, so you can remove access for future requests. We'll publish the supported assistants and setup instructions as connections are tested.

Some of my principles above are open questions for Connect, and I'd rather say so. Local control is a design goal, but storage and hosting options are still being decided, and we'll explain them before testing opens. Removing access will stop future sharing through Connect; it can't take back what a person or service has already received.

Connect is being designed as part of Koru, next to Koru Workspace, our free, open-source (MPL-2.0) notes app that works offline, with a local database and a local MCP server. We're exploring how the two will work together.

If you're tired of explaining your repo again, join the Koru Connect waitlist for updates and to hear when testing opens. Joining doesn't give access yet.

If you're curious how we build Koru itself, read how Koru is built: a native Rust app, not Electron. I post about what we're building on X as @liechti_dev.

Frequently asked questions

Does Claude Code remember things across sessions?

Yes. CLAUDE.md files hold instructions you write, and auto memory holds notes Claude writes itself from your corrections. Both load at the start of every session, and /memory lets you view and edit them. Both are specific to Claude Code.

How do I keep coding agent memory across devices?

Commit project instructions, such as an AGENTS.md, so they travel with git. User-level files stay on the machine where you wrote them, and Claude Code's docs say its auto memory is machine-local, so you copy personal context yourself.

What belongs in project memory and what belongs in global memory?

Project memory is for one repo: build and test commands, conventions and architecture decisions, in the repo's AGENTS.md or CLAUDE.md. Global memory is for your own preferences in every project, in files such as ~/.claude/CLAUDE.md or ~/.codex/AGENTS.md, or Cursor's User Rules. Keep anything private out of committed files.

Can I use Koru Connect today?

Not yet. Koru Connect is in development. Join the early access list on the Koru Connect page for development updates and to hear when testing opens.

Drafted with help from AI tools, edited and fact-checked by Steven Liechti.

  • AI agents
  • Claude Code
  • MCP

Subscribe to receive notifications of new posts

We'll never share your email address.

Privacy choices

Choose which optional tools Koru may use on this site. Your choice is saved in a cookie in this browser for 12 months. Privacy policy

Privacy choices

Keep you signed in, protect forms and remember your language and this choice.

Always on

PostHog and Google Analytics 4 measure page views and actions such as downloads, using cookies or local storage.

PostHog records how pages are used, with form inputs masked and private pages excluded. Needs Analytics.

Ahrefs Web Analytics measures visits and where they come from, and Google Ads measures whether our ads led to a visit or download.