Work with agents
Share what your agents learn
Your coding agent learns how your repository works: a pitfall, a rule of the team, where the deploy logs are. That knowledge stays on your computer, so the next agent, yours or a teammate's, learns it again. Agent memories keep it on TanStack Source, with the repository, so every agent of the team reads it before it works.
4 min read
A memory is a short markdown note with a name, a one-line description and a type. It lives outside git: it is never in a commit or a clone. Claude Code, Codex, Cursor and every other agent read and save memories with src, the forge's MCP server or REST.
You need write access to the repository, and src with its skill on your computer.
1. Give your agents the skill
src auth login --web
src agent setup
src agent setup gives your coding agents the source skill. The skill tells them to read the memories when they start, and when to save one. Start a new session of each agent after it.
2. Let your agent read the memories
An agent reads the memories when it starts on a repository. src agent context ends with their index: the newest 100, each with its name, type, description, author and date. The agent reads the memories that fit its task:
src agent context
src memory list
src memory view merge-window
Over MCP, get_agent_context has the same index, and get_memory reads one.
3. Save a memory
When your agent learns something that the next agent here should know, and that the code, its history and AGENTS.md do not say, it saves a memory. You can ask it to, or save one yourself:
src memory save merge-window --type feedback \
--description "Merge only when main has no CI run in progress" \
--body-file notes.md
Pick the type that fits:
| Type | What it holds |
|---|---|
project | Ongoing work, a decision and its reason, a goal or a constraint |
feedback | How to work here: a correction, or an approach that worked |
reference | A pointer to an outside resource, such as a dashboard or a board |
src memory save --file reads a memory file with front matter, such as a memory file of Claude Code, so your agent can share a memory that it keeps on your computer.
Warning
Never save a secret or a note about one person. The forge removes known secret formats from each memory, but not names, emails or other personal data. It refuses the type user: notes about one person stay in that person's own agent memory.
4. Look at the memories on the web
Open the repository, click Agents, then Memories. Each memory opens to its text. With write access, you add a memory with New memory, and change, restore or delete one.

Done
Every agent of your team now starts with what the agents before it learned, whichever agent it is.
Notes, not instructions
A memory can go out of date. The skill tells agents to check a memory against the code before they rely on it, and to follow the person and AGENTS.md when they disagree. When a memory turns out wrong, fix it, or delete it with src memory delete <name> --yes.
Versions
A save under the name of a memory adds a version, and the forge keeps the newest 20. A save with no change adds none. A save with no --type keeps the type of the memory.
src memory versions merge-window
src memory view merge-window --version 2
src memory restore merge-window 2
On the web, click History on a memory.
Who reads the memories
- People with write access, and their agents, read and save them.
- A repository admin can let everyone who reads the repository read them. See Choose who reads agent memories. Saving and deleting always need write access.
- In an agent session, every profile reads them, and only
fixersaves and deletes them. - CI jobs and apps never read them.
- The built-in factory agents that work on issues and pull requests, such as triage, review and the fixer, read them only when everyone who reads the repository may read them, because everyone who reads an issue or a pull request reads what those agents write. They never save memories.
Limits
- A name is up to 64 lowercase letters, digits and dashes, like
merge-window. It is unique in the repository. - A description is one line of up to 300 characters.
- A body is markdown, up to 16 KiB.
- A repository holds at most 500 memories.
From REST or MCP
REST and MCP have the same features as src memory, with the same rules:
- REST, under
/api/v1/repos/{owner}/{repo}:GET /memories,GET,PUTandDELETE /memories/{name},GET /memories/{name}/versions, andGETandPUT /memory-readers. - MCP:
list_memories,get_memory,save_memory,delete_memory,memory_versions,get_memory_readersandset_memory_readers.
/llms.txt has the fields of each.