Claude Code auto memory, CLAUDE.md, Copilot Memory and threadctx compared
Four ways coding agents remember a repository: what each stores, where it lives, who shares it, how it expires, and whether anything checks it against the code.
Updated 2026-12-02
Coding agents now remember in several ways, and the differences matter more than the feature names. The questions worth asking of any agent memory: who writes it, who else gets it, what it costs per session, when it expires, and what happens when it is no longer true.
| CLAUDE.md | Claude Code auto memory | GitHub Copilot Memory | threadctx memory | |
|---|---|---|---|---|
| Written by | You | Claude | Copilot | The agent (memory_write) or you (CLI) |
| Lives in | The repository (or your home directory) | ~/.claude/projects/<project>/memory/ on your machine | GitHub | Personal: ~/.threadctx/local.json. Team: .threadctx/memory.json in the repository |
| Shared with the team | Through git | No; machine-local | Repository facts are shared with collaborators | Team notes through git, reviewed in pull requests |
| Loaded | In full at every session start | First 200 lines or 25 KB of MEMORY.md at session start; topic files on demand | When Copilot finds a relevant fact | Only when the agent queries; only matching notes |
| Checked against the code | No | No; documented as context, not enforced | Copilot checks a fact’s citations against the current branch; GitHub describes this as Copilot’s judgment, not a guarantee | Every recall: files, scripts, commands, package manager, runtime versions and secrets, checked deterministically |
| Expiry | None | None documented | 90 days by default, adjustable by organisation owners | Optional per note; flagged for review after 90 days; superseded notes hidden |
| Works with | Claude Code | Claude Code | Copilot surfaces (CLI, code review, cloud agent and others) | Claude Code, Cursor, VS Code, Codex, Gemini CLI, any MCP client |
Sources, checked on 2026-12-02: code.claude.com/docs/en/memory and docs.github.com/en/copilot/concepts/agents/copilot-memory. Features change; check the current documentation before relying on a detail.
When to use which
- CLAUDE.md or AGENTS.md: rules every task needs. Keep them short, because every session pays for them.
- Claude Code auto memory: your personal preferences on your machine.
- Copilot Memory: if your team works in Copilot's own surfaces, it remembers repository facts there with citations.
- threadctx: repository knowledge that should reach every teammate and every agent, stay reviewable in pull requests, and be checked against the code each time it is used.
They are not exclusive. A common setup is a short AGENTS.md, auto memory left on for preferences, and team facts in threadctx so they work in Claude Code, Cursor and VS Code alike.
Why checking matters
A memory is an instruction the agent will follow later, written by an agent, often without review. If it names a file that was deleted, or tells the agent to use npm in a pnpm repository, the agent acts on it. threadctx treats memory like any other agent instruction: it is checked for dead paths, undefined scripts, a changed package manager, secrets and download-and-run commands before the agent sees it, and the agent is told what failed.
npx threadctx setupQuestions
Can I use threadctx and Claude Code auto memory together?
Yes. They store different things in different places. Auto memory keeps your preferences on your machine; threadctx keeps repository knowledge, shared through git and checked against the code.
Does threadctx replace CLAUDE.md?
No. CLAUDE.md is for rules every task needs. threadctx keeps situational knowledge out of it, which makes CLAUDE.md shorter, and also grades CLAUDE.md and AGENTS.md for problems.
Does threadctx send my memory anywhere?
No. It runs locally. Personal notes stay on your machine and team notes in your repository.