# Shared memory for AI coding agents

<!--
title: "Shared memory and context for AI coding agents · Cork"
description: "Every agent starts from what the others already learned: a briefing with the exact signatures, callers and recent changes of the code it is about to touch, and notes anchored to that code. Agents read less, so they spend fewer tokens."
canonical: "https://corkcli.com/use-cases/shared-memory-for-ai-coding-agents"
last_updated: "2026-11-15"
-->

Every agent starts from what the others already learned: the exact signatures, callers and recent changes of the code it's about to touch, and the notes left on that code. It reads less, so it spends less.

Install, free and local, no account: `npx corkcli` (or `curl -fsSL https://corkcli.com/install.sh | sh`). MCP only: https://mcp.corkcli.com

## How it works

1. **A briefing per prompt.** Each session and prompt opens with the code it is about: signatures, callers, who changed what and when.
2. **Notes on the code.** `remember` anchors a decision to a function, so the next agent there reads why it is the way it is.
3. **Ask what happened.** `recap` says what changed, why, and what it cost, without anyone digging through git log.

## Measured

**24%** fewer tokens with a single agent; with sixteen at once, 47%. [Method and raw numbers](https://corkcli.com/benchmarks/study-7-scaling-to-sixteen-agents)

## Questions

### Is this a vector database?

No. It is a map of the code's structure (names, signatures, callers and recent changes) that every agent's edits keep current, plus notes anchored to functions. Cork does not keep your source files.

### Does it work across Claude Code sessions?

Yes, and across tools: a note left by a Codex agent reaches the next Claude Code session on that code.

### Why does it save tokens?

Most of an agent's tokens go to finding and re-reading code. A briefing hands it the parts that matter, so it searches less.

## Read more

- [Benchmarks: method and raw numbers](https://corkcli.com/benchmarks)
- [Shared memory with anchored notes](https://corkcli.com/blog/shared-memory-coding-agents-anchored-notes)
- [Share context between Claude Code sessions](https://corkcli.com/blog/share-context-between-claude-code-sessions)
- [Why AI agents reread the same files](https://corkcli.com/blog/why-ai-agents-reread-same-files)
- [MCP tools: remember, recall, recap](https://corkcli.com/docs/mcp-tools)

[All use cases](https://corkcli.com/use-cases.md) · [Cork in Markdown](https://corkcli.com/index.md) · [llms.txt](https://corkcli.com/llms.txt)

This page in HTML: https://corkcli.com/use-cases/shared-memory-for-ai-coding-agents
