MemoryLake
Back to all articles
TutorialJuly 30, 2026·7 min read

How to Migrate From GitHub Copilot to Claude Code Without Losing Context (2026)

You have decided to move your daily coding work from GitHub Copilot to Claude Code. The install takes minutes. The part nobody warns you about is that everything Copilot had absorbed about your codebase — your conventions, the reasons behind three architectural decisions, the modules that are safe to refactor and the one that absolutely is not — does not come with it.

Here is the direct answer: there is no export button, because most of what you are trying to move was never stored as data you own. Copilot's durable layer is a small set of instruction files in your repository, and those port over in an afternoon. The rest lived in chat sessions that end when you close them. So a clean migration means porting the files, deliberately rewriting the tacit knowledge, and then — the part that actually saves you from doing this again — putting that knowledge somewhere neither tool owns.

This guide covers all three, in order.

Why switching coding agents loses your context

Copilot's memory is thinner than it feels

After months of use, Copilot feels like it knows your project. What it actually has, per session, is the files you have open, what it can retrieve from the repository, and your instruction files. Repository-level custom instructions — .github/copilot-instructions.md and the per-scope instruction and prompt files alongside it — are real, portable, and version-controlled. Everything else is inference performed fresh, plus a chat history that is a transcript, not a knowledge base. Developers hit the edges of this constantly; the mechanics are covered in why GitHub Copilot forgets your codebase context.

The valuable part was never written down

The expensive knowledge is the kind you only produced in conversation: why the payments module tolerates duplicate writes, which test suite lies, that the previous attempt at extracting the auth service failed and why. You explained those things to Copilot in chat. There is no file to copy, and no export format that would capture them if there were.

Claude Code is stateless too

This is the part most migration guides skip. Claude Code starts every session as a blank slate. It reads CLAUDE.md at your project root and your user-level ~/.claude/CLAUDE.md, and it can reach whatever tools you connect over MCP — but the session itself accumulates nothing that survives it. If you switch tools without changing how your context is stored, you will meet the same problem with a different UI, as Claude Code forgetting project context describes in detail.

Switching tools is a change of interface. Only changing where your context lives is a change of situation.

The manual migration

Step 1: Collect what Copilot actually holds

Work through your repository and gather the portable pieces:

  • .github/copilot-instructions.md — your repository-wide instructions
  • Any scoped instruction files and reusable prompt files you have accumulated
  • Editor settings that encode conventions, such as lint and formatter configuration
  • Anything you have pinned in a wiki, ADR folder, or onboarding doc

Then do the harder inventory. Open your last two weeks of Copilot chats and write down every piece of context you had to explain more than once. That repetition is your memory audit: whatever you kept re-typing is precisely what was never stored.

Step 2: Rebuild it where Claude Code will read it

Claude Code reads CLAUDE.md, so start there. Port the instruction content, then structure it so it stays useful as it grows:

  • Project shape: what the services are, what talks to what, what is deprecated
  • Conventions: naming, error handling, test expectations, commit and review norms
  • Decisions with reasons: not "use Postgres" but "Postgres, because queue-mode workers broke in-process state"
  • Traps: the flaky suite, the module with hidden coupling, the migration that must run in order

Keep user-level preferences in ~/.claude/CLAUDE.md and project facts in the repository file, so teammates inherit the project half without your personal half.

This gets you a working Claude Code setup, and it is genuinely better than starting cold. It also has a ceiling: a single markdown file is a briefing document, not a memory. It does not grow on its own, nobody updates it after a hard debugging session, and nothing in it reaches the assistant you use for incident reviews or the agent you route to a cheaper model next month. Six months in, CLAUDE.md is either stale or enormous.

The Better Way: One Memory Layer, Either Tool

The fix for repeating this migration is to stop storing project knowledge inside whichever agent you happen to use. MemoryLake sits outside your tools: your architecture notes, decisions, and repository context live in one memory layer, and Claude Code reads from it over MCP. If you later add Codex, keep Copilot for autocomplete, or hand work to a second agent, they read the same source instead of each rebuilding a private copy.

Step 1: Create an API key

Generate a key and make your first request in about 30 seconds.

Create a MemoryLake API key
Create a MemoryLake API key

Step 2: Upload your first memories

Drop in the documents, images, and files that carry your project's real context — the CLAUDE.md you just wrote, architecture diagrams, ADRs, runbooks, incident write-ups, API specs. This is the material that used to exist only in chat.

Upload your first memories to MemoryLake
Upload your first memories to MemoryLake

Step 3: Connect your AI & agents

Give Claude, Codex, OpenClaw, and your other agents access to that memory via MCP or the API. For the Claude Code specifics, see how to add memory to Claude Code. From then on, a new session starts with your project already loaded, and the next tool change is a configuration edit rather than a migration.

Connect your AI and agents via MCP
Connect your AI and agents via MCP

What the move actually costs you — and saves

Price the manual path honestly. Porting instruction files: under an hour. Reconstructing tacit knowledge into CLAUDE.md: half a day if you are thorough. Then the recurring cost: suppose your standing project context is 2,000 tokens and it gets restated 20 times a day across sessions and agents. That is roughly 1.2M tokens a month spent repeating yourself, and four or five minutes of re-briefing every time you open a session.

The one-time write into a shared memory layer replaces the recurring half of that. It also changes what happens on your next tool evaluation: today, trying Codex or a new agent means paying the context-rebuilding cost again, which is exactly why teams stay on tools they have outgrown. When memory is external, evaluating a tool costs an afternoon instead of a month.

Best practices for the switch

Migrate decisions, not transcripts

Do not dump chat logs into your new setup. Extract the conclusions — the choice, the reason, the date — and store those. Conclusions retrieve well; transcripts bury the signal and cost tokens to read.

Run both tools for two weeks

Keep Copilot's autocomplete while Claude Code takes agentic work. Overlap surfaces the context you forgot to port, because you will notice yourself explaining something twice.

Write memory once, read it everywhere

Every time you explain something to an agent that you will need again — a convention, a constraint, a post-mortem finding — put it in the shared layer rather than the session. That habit is what makes the third migration trivial. It is the same principle behind migrating from Cursor to Claude Code and moving off Codex without starting over.

Conclusion

Moving from GitHub Copilot to Claude Code is two migrations wearing one name. The first is mechanical: instruction files to CLAUDE.md, done in an hour. The second is the one that hurts — the months of context you explained in chat, which has no export path because it was never stored.

You can rebuild that by hand, and you should, once. But if you rebuild it inside Claude Code, you are storing it in the next tool you will leave. Keep your project's memory in a layer your agents read from, and the question stops being "how do I move my context to Claude Code" and becomes "which agent should read it today."

Frequently asked questions

Can I export my GitHub Copilot chat history to Claude Code?

There is no supported export that carries Copilot chat history into Claude Code in a usable form, and even a raw transcript would be the wrong shape — Claude Code reads instructions and connected memory, not other tools' logs. Port your instruction files, then extract the durable conclusions from those chats by hand.

What is the Claude Code equivalent of `.github/copilot-instructions.md`?

CLAUDE.md at your project root, with user-level preferences in ~/.claude/CLAUDE.md. Both are plain markdown and both belong in the same review discipline as code, since a stale instructions file quietly misleads every session that reads it.

Will Claude Code remember my project between sessions?

Not on its own. It re-reads your CLAUDE.md files each session and can reach anything you connect over MCP, but the session itself keeps nothing. Persistence comes from what you connect it to.

Should I keep using Copilot after migrating?

Many teams do — Copilot for inline completion, Claude Code for multi-file agentic work. That combination is only comfortable when both are pointed at the same context, otherwise you maintain two divergent sets of project knowledge.

How do I avoid doing this migration again?

Store project context outside the agent. When conventions, decisions, and traps live in a memory layer your agents read over MCP or an API, switching or adding tools is a connection change, not a knowledge-rebuilding project.