Blog · Guide · 25 November 2026

Agent Memory vs Shared State: Two Different Problems

"Memory" has become the word for anything an agent knows that is not in its prompt. That covers two problems that look alike and need different solutions.

Agent memory is what one agent carries from yesterday into today: what it learned about the codebase, which approach failed, what the user prefers. It is about the past, and it belongs to the agent.

Shared state is what many agents need to know about each other right now: who is editing which file, which question is still open, which handoff has arrived, whether the change one agent is making will merge with another's. It is about the present, and it belongs to nobody in particular.

A team of agents can have excellent memory and still collide on every file. This post explains why, using what Anthropic and the CooperBench authors published, and sets out what shared state has to hold.

What agent memory is

Anthropic's "The components of agent memory" (Lance Martin, 6 November 2026) is a clear account of the first problem. It names four layers:

  1. Transcripts: a searchable log of the agent's work, the base layer. "Agents capture much of their work in logs or transcripts."
  2. Memory notes: observations the agent writes to a store, such as a folder of files.
  3. Memory representations: structured forms built from experience, such as a wiki with linked pages.
  4. Injected context: a small layer loaded into every session at the start.

It also describes "dreaming", an offline process that reorganizes memory across these layers: "Dreaming gives Claude a way to test its notes against the original transcripts."

Every layer answers the same question: how does an agent come back to work knowing what it, or agents before it, already learned? That question matters. It is also a question about one line of work moving forward through time.

Where memory meets many agents

The same post has a passage that shows the second problem. While a wiki was being built, "several agents wrote to a shared table of contract terms at the same time." A brief generated from that wiki included "only 41 of the 57 facts (72%)." The fix was ownership: "Each contract got its own page in the wiki, written by a single agent," which "quoted the terms word for word rather than summarizing them into a shared table." With that change, "100% of the criteria could be met, up from 72%."

Notice what fixed it. The agents did not get better memory. Each piece of shared output got one writer. That is a coordination fix, and it is the same fix that works for code: one owner per file.

The post also mentions, in passing, that sessions built on each other's progress "using a shared log to coordinate work." That shared log is shared state, not memory. It is a record that several agents read and write so that each knows what the others have done.

Why teams of agents fail

CooperBench (Stanford and SAP Labs, January 2026) gave two coding agents one feature each from the same codebase and checked whether their work fit together. The authors reviewed 50 failed runs by hand and sorted the causes:

  • Expectation (42%): an agent was wrong about what its peer was doing.
  • Commitment (32%): an agent did not do what it said it would.
  • Communication (26%): messages were missing, vague or ignored.

None of the three is a memory failure. In each case the agent's knowledge of its own past was fine. What it lacked was an accurate picture of its peer's present: what the other agent was editing, whether it had kept its promise, whether its change was finished.

Better memory does not help an agent that is wrong about another agent's current work. Neither do more messages. CooperBench found that communication between the agents did not significantly change success, though it reduced naive merge conflicts. In our own CooperBench runs, one agent wrote "I won't modify routeHTTP() in mux.go … No conflicts expected" and then modified it. Its memory was intact. Nothing outside the agent held it to the promise. See two coding agents, one function.

What shared state has to hold

If memory is what an agent knows, shared state is what is true whether or not any agent remembers it. For a team of coding agents it needs at least these:

Who owns which files. A claim on a path, held by one agent, with an expiry. Another agent's claim on an overlapping path is refused and names the holder. The edit is checked against the claims before it happens, so nobody has to rely on a promise. This answers expectation failures directly: an agent does not have to guess what its peer is editing.

What each agent is doing and waiting for. One record per agent session with a state (working, waiting, review, blocked, idle, resolved), the commands it ran and the files it changed, written as they happen. The agent's own summary at the end is not this record, because the agent wrote it about itself.

Open questions and who must answer them. A question has an owner and an age. One nobody answers is escalated to a person. A question in an agent's memory is invisible to everyone else.

Handoffs that arrived. A finished worker's result, delivered to its planner and marked read when read. The planner does not have to remember to look.

Each agent's actual change. The diff itself, compared with peers' diffs, so a conflict is found before the agents stop. This answers commitment failures: an agent that agreed to make an edit and then dropped it is caught by comparing what it changed, not what it said.

Decisions by people. Which command was allowed, by whom, for how long. A permission granted on one laptop is useless to an agent on another unless it is recorded where both can see it.

The properties that differ

The two problems need different properties.

Agent memory Shared state
Question it answers What did I learn? What is true now, for everyone?
Time Past, carried forward Present, changing
Owner One agent or line of work Nobody in particular; many readers and writers
Wrong answer costs A repeated mistake A collision, a broken promise, a lost answer
Must be Relevant and compact Current, consistent and enforced
Concurrency Rarely an issue The whole point

The last row matters most. Memory can be summarized, reorganized overnight and compressed, because it is read by one agent at the start of its work. Shared state is read and written by many agents at once, so it needs what databases need: one writer wins, a stale write is refused, an expired claim is released. Anthropic's 41-of-57 result is what happens when shared output is treated like a notebook that anyone can scribble in.

Where Forkit fits, and where it does not

Forkit is built for the second problem. Its file claims, threads with states, typed messages and handoffs, permission decisions and merge check are all shared state, held by a server that every agent and person reads from. The rules are enforced on that server, where no prompt can talk them away.

Forkit does have one memory feature, a session summary tool that writes a short Markdown digest of finished work. It is a small part of the product. For memory in the sense Anthropic describes, use the tools your agents already have: Claude Code's memory files, a project's notes, or a memory layer built for it.

The two fit together. An agent comes back with its memory of what it learned, and checks the shared state for what changed while it was gone: whose claims expired, which questions were answered, which handoffs arrived.

Related: agent handoff notes, file locking for AI agents, A2A vs MCP and what is agent orchestration.

About Forkit

Forkit is the coordination system for agent teams: plans, handoffs, file claims and decisions, shared by every agent and the people behind them. It does not run agents. It is free to try at forkit-mcp.com.

Sources