{"slug": "claude-code-remembered-a-fact-in-one-clone-of-our-repo-and-not-in-the-other", "title": "Claude Code remembered a fact in one clone of our repo and not in the other", "summary": "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.", "body_md": "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.\n\nWe made a throwaway repository with a committed `CLAUDE.md`:\n\n```\n# Project rules\n\n- We deploy on Fridays.\n- Release steps: @docs/release.md\n```\n\n`docs/release.md` holds one line: \"Run `make release-koala` to cut a release.\"\n\nA 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.\n\nIn that checkout, one session got this prompt:\n\n```\nRemember this for future sessions: the staging database is called wombat-staging-7.\n```\n\nClaude 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.\n\nLook at that folder name. It is the clone's path on disk, with the separators turned into dashes. That turns out to matter.\n\nEvery 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:\n\n```\nWhat is the staging database called? Do not use any tools. If nothing you were given says, answer exactly: I do not know.\n```\n\n| Where the session ran | Answer | \n|---|---|\n| The same checkout, new session | `wombat-staging-7` | \n| A git worktree of that repository, on another branch | `wombat-staging-7` | \n| A second clone of the repository, same laptop, same user | \"I do not know.\" | \n\nThe 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.\n\nTwo details surprised us.\n\nFirst, 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.\n\nSecond, 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.\n\nWe 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.\n\n`CLAUDE.md`, the files it imports with `@path`, and scoped rules in `.claude/rules/`.\nThe 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.\n\nAsk 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.\n\nLook 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.\n\nKnow 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.\n\nThe 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).\n\nWe 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.\n\nThis post was drafted with AI assistance and checked by a founder.", "url": "https://wpnews.pro/news/claude-code-remembered-a-fact-in-one-clone-of-our-repo-and-not-in-the-other", "canonical_source": "https://dev.to/joshinamsterdamai/claude-code-remembered-a-fact-in-one-clone-of-our-repo-and-not-in-the-other-3o37", "published_at": "2026-11-30 01:00:00+00:00", "updated_at": "2026-11-30 01:15:35.349521+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools"], "entities": ["Claude Code", "Anthropic", "KoalaFix"], "also_reported_by": [], "takeaway": "Claude Code's auto memory is keyed to the clone's disk path under ~/.claude/projects/<project>/memory/, so a fact saved with \"remember\" is invisible to a second clone of the same repo; commit shared facts to CLAUDE.md by name instead.", "recommendation": {"advice": "Put facts teammates need into CLAUDE.md by name and commit them, and audit ~/.claude/projects/<project>/memory/ for anything that should be shared.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/claude-code-remembered-a-fact-in-one-clone-of-our-repo-and-not-in-the-other", "markdown": "https://wpnews.pro/news/claude-code-remembered-a-fact-in-one-clone-of-our-repo-and-not-in-the-other.md", "text": "https://wpnews.pro/news/claude-code-remembered-a-fact-in-one-clone-of-our-repo-and-not-in-the-other.txt", "jsonld": "https://wpnews.pro/news/claude-code-remembered-a-fact-in-one-clone-of-our-repo-and-not-in-the-other.jsonld"}}