[KongchangAI]
· 3 min read· 1,889 words

CLAUDE.md Is Not Memory: Why Team Agent Memory Fails

CLAUDE.md Is Not Memory: Why Team Agent Memory Fails

CLAUDE.md and similar files aren't memory — just fully-loaded sticky notes. Teams need recallable shared memory.

The article argues that many teams mistake Claude Code, Cursor, and Codex's memory or rules for agent memory, but these mechanisms are essentially markdown files loaded entirely into context with no search or recall. Failure modes appear even for solo devs (file bloat, stale entries, cross-tool memory islands) and amplify at the team level: knowledge can't cross people, shared files grow to thousands of lines, merge conflicts go unowned, and departing members take memory with them. The author offers six improvements: keep rules files rules-only, record decisions with reasons and "revisit if" lines, write investigation notes and have agents search them first, put memory edits through review, prune aggressively on a schedule, and write memory for the next person rather than yourself. The ultimate gap is cross-developer, cross-tool shared memory — letting any agent ask "have we seen this before?" and get an answer.

Why "We Already Have Agent Memory" Is an Illusion

Many teams say: "We already have agent memory." Claude Code has a memory layer, Cursor has rules, Codex reads AGENTS.md, and most teams maintain a CLAUDE.md that agents update themselves. The underlying mechanism is the same everywhere: a markdown file loaded into context.

That's a reasonable starting point, but treating it as memory doesn't hold up — even for a single developer, and at the team level the cracks really show.

CLAUDE.md is not memory, just an ever-growing sticky note

Agent memory has no universal industry definition, but it usually refers to an agent's ability to persist information across sessions, retrieve it on demand, and reuse past knowledge. It has at least three layers: storage (where information is written), recall (how relevant information is found when needed), and forgetting/pruning (how stale content is eliminated). The so-called memory offered by today's mainstream tools (Claude Code, Cursor, Codex) is essentially just the storage layer — cramming the full markdown file into the context window at the start of every session. There's no semantic search, no relevance ranking, no automatic pruning. Calling this "memory" makes people think the problem is solved, when in fact only persistence is solved; recall and pruning still rely entirely on humans. Understanding this distinction is the prerequisite for judging the team failures described below.

It Breaks Down Even for a Single Person

Before we talk about teams, just look at you and your agent after a few months together:

  • The file grows, but it's loaded in full every session. Every line consumes context, whether or not it relates to today's task. More noise, less space for critical code, and the one line you actually need gets buried.
  • No search and no recall, just one big blob. Real memory lets you ask "have I seen this before?" A markdown file is either read start to finish or not at all.
  • Past investigations and dead ends vanish. Last month your agent spent an hour ruling out the connection pool. That rarely makes it into the file, so next time it rules it out all over again.
  • Switching tools tears memory apart. Claude Code in the morning, Cursor in the afternoon, Codex for a quick bug fix — three tools, three memory islands, and that's just one person. They have no idea what the others learned.
  • Stale entries mislead silently. The file says "use the v2 client," but the v2 client was removed in June. The agent trusts the file, because that's what the file is for.

Multiply this by team size and the problems get worse.

The context window is the maximum number of tokens an LLM can process in a single inference pass, including the system prompt, memory file, conversation history, and current task code. It's a fixed budget — when one part takes up too much, the others get squeezed. Every line of the memory file consumes that budget, and it's loaded unconditionally regardless of today's relevance. When the file balloons to thousands of lines, the model's attention to mid-context information drops noticeably in long contexts (often called "lost in the middle"), so the truly critical line gets ignored. That's why "load the whole markdown file" can't mechanically replace "recall on demand": the former is a fixed cost, the latter scales with relevance.

Scenario 1: A Bug a Teammate Already Solved

Tuesday afternoon, Ana spends two hours with Claude Code chasing a flaky checkout test. The root cause is a timezone default in the test fixture, and it only triggers after 22:00 UTC. Her agent logs a note in local memory, and she fixes the fixture on her branch.

Wednesday morning, Ben hits what looks like a different failure in the billing job. Same root cause. His Cursor session has no idea what Ana's agent learned yesterday. It starts from scratch, reads the same files, forms the same wrong hypotheses, and takes 90 minutes to find the answer.

The sentence that would have saved him is the one a human teammate would typically say: "Wait, Ana looked at something like this yesterday — let me check if it's the same root cause."

Per-developer memory can't say that sentence. The knowledge is right there, just stored in the wrong head.

Scenario 2: The File That Eats the Context Window

To fix Scenario 1, the team commits the memory file to the repo. Now everyone's agent writes to the same CLAUDE.md. Three months later:

  • It's 1,400 lines long
  • Half of it describes code that no longer exists
  • Two sections contradict each other ("always use the v2 client" vs. "v2 client is deprecated, use the SDK")
  • Every session burns a chunk of context loading it, and the agent still misses the critical line

Memory files only grow. Agents are great at appending and terrible at deleting, because deletion requires judging what's still true. Nobody owns pruning, so nobody prunes.

Scenario 3: Merge Conflicts in the Agent's Brain

Four developers, each running a "helpful" agent that updates AGENTS.md. Every PR touches the same file. You get conflicts nobody wants to seriously resolve, so everyone accepts both sides and contradictions pile up. Or you accept only your side, and someone else's hard-won lesson quietly disappears.

Code gets review. Memory files mostly don't, because they feel like notes, not code. But they shape every line the agent writes.

Memory file merge conflicts are harder to handle than code conflicts because they lack the "executable verification" that code has. Resolve a code conflict wrong, tests fail; resolve a memory conflict wrong, and no automated signal tells you which side is right. Worse, memory entries are often natural-language lessons, and two seemingly contradictory pieces of advice may each hold under specific conditions — but the conditions are lost in the file. The common "accept both" strategy creates a self-contradictory instruction set, letting the agent choose at random at runtime and making behavior unpredictable. To mitigate this, memory entries need to be structured (with dates, applicability conditions, and deprecation markers), and reviewed and tested like code — for example, using "can a new agent make the right decision from this?" as a regression test.

Scenario 4: Rules Without Reasons

Look at a typical memory file and you'll see lots of rules and very little reasoning:

- Don't use Redis for the job queue
- Keep retries at 3

Why not Redis? Cost, operational burden, an incident, a customer requirement? Does that reason still hold? An agent that sees only the rule either obeys blindly or, worse, "improves" it when something feels off in context. A new teammate can't challenge it either, because the reasoning is gone.

Rules tell the agent what. Decisions need why, and why is exactly what .md files lose most easily.

Scenario 5: Someone Rotates Off the Team

Chen transfers to another project. His local agent memory — eight months of "this service lies in its status codes," "the staging DB is shared with QA, don't truncate" — leaves with him. It never made it into the repo; it just lived in ~/.claude on his laptop.

In human teams we call this the bus factor problem. With agents it's the same problem, just quieter, because nobody notices until the agent confidently repeats mistakes Chen's agent learned to avoid long ago.

If You're Going to Use Files Anyway, at Least Do This

If all you have right now is .md files, here's how to make them hurt less. It works for solo devs and teams, and you can start this week.

What goes where: rules, decisions, investigations, deletions

1. Keep CLAUDE.md / AGENTS.md as Rules Only

Short, stable, imperative. Build commands, conventions, hard "never do X." The goal is a two-minute human read. If it exceeds roughly 200 lines, it's doing too much.

2. Record Decisions with Reasons in Separate Files

Use a docs/decisions/ folder, one small dated file per decision:

# 2026-09-14: No Redis for the job queue
Context: we run on a single managed Postgres, no ops person.
Decision: use Postgres SKIP LOCKED queue.
Why: one less service to run; volume is ~2k jobs/day.
Revisit if: volume > 50k/day or we hire ops.

Then link from the rules file: "Job queue: Postgres, see docs/decisions/2026-09-14." Your agent gets the rule cheaply and can read the reasoning when needed. The "Revisit if" line is exactly what stops future agents from blindly obeying or blindly reverting it.

3. Write Down Investigations, Not Just Fixes

When an agent session finds a non-obvious root cause, have it write a five-line note: symptom, root cause, how it was confirmed, fix, location. Put these somewhere shared and searchable (a docs/investigations/ folder is enough). Then add a rule to CLAUDE.md:

Before debugging, search docs/investigations for similar symptoms.

That one line delivers a surprisingly strong version of the "teammate saw this yesterday" effect.

4. Make Agent Edits to Memory Files Go Through Review

Treat changes to the rules file like code: small diffs, one reviewer, reasoning in the PR. If the agent proposes a memory change, let it propose, not commit.

5. Prune Regularly

Once a month, have someone (or an agent with human oversight) go through the rules file and ask of every line: is this still true? Would we miss it if we deleted it? Delete aggressively. Stale memory is worse than no memory, because the agent trusts it.

6. Write Memory for the Next Person, Not Yourself

A good test: would a new teammate's agent make a better decision on day one because of this note? If the note only makes sense in your own head's context, it belongs in your head, not in shared memory.

The Real Gap

Per-developer .md memory solves "my agent forgot what I told it." That's a real problem, and current tools handle it decently.

The next problem teams hit is different: my agent doesn't know what my teammate's agent learned. Different tools, different laptops, different sessions, same codebase. The advice above makes files hurt less, but they're still files: no recall, no search, one big blob per tool. Real memory should let any agent — yours or a teammate's — ask "have we seen this before?" and get an answer.

How does your team handle this? Still using files, or have you switched to something else? I'd love to hear what actually works.

The original author is building an open-source shared team memory solution for agents: palacememory.com (GitHub).

Cross-developer shared memory and "syncing personal memory files to Git" are two different things. The latter just shows everyone the same blob, still with no retrieval capability; the former requires a queryable memory layer: searchable by semantics or keyword, returning relevant snippets instead of the full text, tagging sources and timeliness, and supporting concurrent writes from multiple agents without conflict. Such systems typically need vector retrieval, structured metadata, write conflict resolution, and access control. The core problem it solves is the one this article keeps coming back to — "have we seen this before?" — a recall request across people, tools, and sessions. That's the most fundamental gap between today's various .md approaches and true team memory: not where it's stored, but the recall interface.

#agent memory#CLAUDE.md#AGENTS.md#team memory#AI coding agents#context window
Share:

Related articles