Code memory answers the question every coding agent asks silently: how does this project actually work? Which package manager, which command, which table is off limits, what broke last time.
It is organised by repository. Claude Code, Cursor, Codex and any other MCP client read the same store, so a rule learned in one tool applies in all of them.
What belongs there
Keys make rules current
A code memory with a stable key is an upsert. The key is the identity of the rule, not of the sentence, so saving the same key again replaces the value instead of adding a second opinion.
memory_add({
kind: "code",
repo: "acme/memo",
type: "convention",
key: "deploy:checks",
content: "Deploy only after typecheck and the full test suite pass."
})
// Later, the rule changes:
memory_add({
kind: "code",
repo: "acme/memo",
type: "convention",
key: "deploy:checks",
content: "Deploy only after typecheck, tests and a production build pass."
})
// One row remains, with the new value.Use a key when the rule has one current answer — commands, paths, environment variables, the package manager. Leave the key off when each statement stands alone, such as separate gotchas discovered on different days.
Scopes and ranking
scope is global, repo or branch. When an agent searches with a repository and the files it is editing, memories that match the path rank higher, then narrower scopes, then confidence, then recency. A global preference still appears, just below a repository-specific rule.
Repositories
The Code page groups memory by repository, with counts for conventions and gotchas. Filters cover repository, type and free text. Deleting a memory removes it for every member of the repository.
Sharing
Repository owners can invite teammates; members read and write that repository's memory through their own tokens. See Team repositories. Personal memory is never part of a share.