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

> Source: <https://dev.to/joshinamsterdamai/claude-code-remembered-a-fact-in-one-clone-of-our-repo-and-not-in-the-other-3o37>
> Published: 2026-11-30 01:00:00+00:00

**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 the playbook "Working with AI coding agents": <https://wpnews.pro/playbooks/coding-agents>

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`:

```
# Project rules

- 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?](https://www.koalafix.com/guides/is-claude-code-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.
