cd /news/ai-agents/claude-code-remembered-a-fact-in-one… · home › topics › ai-agents › article
[ARTICLE · art-178338] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Claude Code remembered a fact in one clone of our repo and not in the other

A test of Claude Code 2.1.331 found that facts saved through the tool's "remember" feature are stored per-clone rather than per-repository: a note written in one checkout was recalled in a new session and in a git worktree of that checkout, but a second clone of the same repo on the same laptop answered "I do not know." The memory files live in a config folder keyed to the clone's disk path, so teammates working from separate clones never see them, while committed CLAUDE.md rules load everywhere. The tester recommends committing shared facts to CLAUDE.md by name rather than asking Claude to remember them.

recommendation

Put facts teammates need into CLAUDE.md by name and commit them, and audit ~/.claude/projects/<project>/memory/ for anything that should be shared.

more in playbook: Working with AI coding agents
by read4 min views17 publishedNov 30, 2026

A fact you tell Claude Code to remember stays with the clone you said it in. A worktree of that clone gets it. A second clone of the same repository, on the same laptop, does not. We checked this on 25 November 2026 with Claude Code 2.1.331. Our AI agent sessions ran the test under a founder's direction.

We made a throwaway repository with a committed CLAUDE.md:


- We deploy on Fridays.
- Release steps: @docs/release.md

docs/release.md holds one line: "Run make release-koala to cut a release."

A fresh session, asked what day we deploy and what command cuts a release, answered: "We deploy on Fridays, and make release-koala cuts a release." So the committed file and the file it imports both loaded. No surprise there.

In that checkout, one session got this prompt:

Remember this for future sessions: the staging database is called wombat-staging-7.

Claude wrote two files: a note called staging-database-name.md, and a one-line entry pointing to it in MEMORY.md. Both went into Claude Code's own config folder, under projects/C--work-guides-test-20261125-teamrepo/memory/. Nothing went into the repository, and git status had nothing to commit.

Look at that folder name. It is the clone's path on disk, with the separators turned into dashes. That turns out to matter.

Every check used the same question in a fresh session. It told Claude not to use tools, so the answer could only come from what the session loaded at start:

What is the staging database called? Do not use any tools. If nothing you were given says, answer exactly: I do not know.
Where the session ran Answer
The same checkout, new session wombat-staging-7
A git worktree of that repository, on another branch wombat-staging-7
A second clone of the repository, same laptop, same user "I do not know."

The second clone still answered "Fridays" when asked what day we deploy. It read the same committed CLAUDE.md. It had no way to see the note.

Two details surprised us.

First, the worktree. Claude Code gave the worktree a project folder of its own, and that folder had no memory in it at all. The session still knew the database name, so it was reading the main repository's memory. That matches Anthropic's memory docs, which say all worktrees and subdirectories of one git repository share one auto memory directory.

Second, the clone. It got its own project folder, C--work-guides-test-20261125-teammate-clone, with an empty memory folder. The docs say the project path "is derived from the git repository". In our test, two clones of the same repository on one laptop were two projects with two memories.

We did not test a second laptop. The docs cover that case directly: auto memory is machine-local, and its files are not shared across machines or cloud environments.

CLAUDE.md, the files it imports with @path, and scoped rules in .claude/rules/. The quiet risk is a fact one person's agent knows and the others do not. Nothing warns you. Our second clone said "I do not know" only because the question told it to answer that way when nothing it had been given said otherwise.

Ask Claude to put it in CLAUDE.md, by name, and commit the change. A request to "remember" goes to auto memory. Naming the file gets the file edited.

Look at your auto memory now and then. By default it is plain markdown under ~/.claude/projects/<project>/memory/, with MEMORY.md as the index. Anything in there a teammate would need belongs in the repository.

Know the limits of CLAUDE.md. Claude reads it as context, and Claude Code does not enforce it, so rules that must always hold belong in hooks or permissions. It also changes only when someone merges an edit.

The full list of what Claude Code shares and what it keeps local, with links to Anthropic's docs, is in our guide, Is Claude Code's memory shared with your team?.

We build KoalaFix, a shared memory for a team's AI coding agents, so we have an interest in this topic. Read this post with that in mind. A committed CLAUDE.md is worth keeping either way.

This post was drafted with AI assistance and checked by a founder.

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-code-remember…] indexed:0 read:4min 2026-11-30 · —