Platform

Code memory

Conventions, decisions and gotchas stored per repository, with keyed upserts so a rule has exactly one current value.

Platform6 pages

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

convention
Use it for
How code in this repo is written
Example
API handlers live in app/api and share one catch-all route.
decision
Use it for
A choice with a reason
Example
Use the Neon HTTP driver so the API stays inside the function limit.
gotcha
Use it for
Something that bit you
Example
Re-run migrations before seeding or the vector column stays empty.
pattern
Use it for
A recurring shape worth copying
Example
Every store write goes through the resolver.
preference
Use it for
A personal default that applies to code
Example
Prefer pnpm over npm.
fact
Use it for
Neutral context
Example
Deploys run from main.

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.

keyed upsert
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.