← Practical guides to AI coding memory

Guides

How do I give GitHub Copilot in VS Code memory across chats?

Use Copilot instructions, native memory and hosted MCP memory in VS Code, with setup steps and a fresh-chat check.

By: Cairn

Updated:

Published:

Yes. Give Copilot reviewed project instructions in .github/copilot-instructions.md, use native Copilot Memory for learned preferences and repository facts, or connect an MCP memory server for context shared with other tools. In VS Code, Cairn.ink Memory connects through a hosted HTTP server and browser sign-in; you ask its tools to save and retrieve context.

Which kind of memory do you actually need?

Start with the thing you keep repeating. A build command belongs beside the code so everyone can review it. A personal preference, such as how you like review summaries, belongs in a personal store. The reason you rejected an architecture can be useful in a later conversation, particularly when you switch assistants.

What you want to keepA useful starting point
Reviewed repository conventions.github/copilot-instructions.md
Rules for particular files.github/instructions/*.instructions.md
A reusable task you deliberately invokeA skill, or a supported prompt file
Learned context within supported Copilot experiencesCopilot Memory
Private context read by several AI toolsAn MCP memory server such as Cairn.ink Memory

Use the smallest option that covers your workflow. If you work entirely in Copilot and its memory meets your needs, that is a good place to start. An external store becomes useful when another assistant also needs to retrieve what you saved. The MCP memory introduction explains the client and server roles.

How do instruction files carry context into a new chat?

VS Code's instruction reference lists .github/copilot-instructions.md for Copilot project guidance, with targeted files beneath .github/instructions. These files are ordinary Markdown kept with your repository. Write a few stable conventions, review them and commit them through your team's usual process.

For example, useful guidance might say to reuse existing test fixtures and check accessibility when changing a form. Put the exact test commands from your own repository beside those rules. Short, maintained instructions are easier to review when the project changes.

For targeted instructions, the reference documents applyTo patterns in an .instructions.md file. A testing rule can apply to test files while the main instruction file holds project-wide guidance. The selected agent harness, meaning the runtime driving the session, determines which formats it reads; choosing a different language model keeps that runtime choice intact.

The instructions walkthrough recommends testing a new convention in a fresh chat. Ask Copilot to explain the applicable rule, then use a small real task to see how it affects the work. For the broader distinction between maintained rules and evolving context, see instruction files versus AI memory.

Are prompt files another form of memory?

Prompt files package a task as Markdown that you invoke in chat, often as a slash command. They are useful for a repeatable review request or a particular planning routine. Their role is to carry the same request into another session.

Current VS Code docs restrict prompt-file execution to the deprecated Local harness, scheduled for removal in February 2027, and recommend skills for new reusable workflows. Keep this compatibility detail with the prompt-file decision. Learned preferences fit memory; a maintained sequence of work fits a reusable prompt or skill.

What does native Copilot Memory support today?

The current VS Code memory guide describes cloud-backed Copilot Memory in local Copilot harness sessions. GitHub's Copilot Memory overview lists availability for all paid Copilot plans. Account settings, repository access and organization policies determine which memory scopes you can use.

Repository facts belong to the repository and can be shared with eligible collaborators. User preferences follow your own supported Copilot interactions across repositories. Keep team rules in reviewed instructions, and use personal preferences for the way you want to work.

To check the native setup, sign in to GitHub Copilot, enable Copilot Memory in your GitHub personal settings, and check chat.copilot.memory.enabled in VS Code. Create or resume a session after changing it. Ask Copilot to remember a harmless preference with an explicit scope, then review it in GitHub's memory settings.

The standard path described today is cloud-backed; repository-local storage is separately marked Experimental. For cloud deletion, use GitHub's memory settings: the VS Code guide says an agent's forget request downvotes the item, while permanent deletion uses the settings interface.

How do I connect Cairn.ink Memory in VS Code?

VS Code's official MCP guide supports adding a publisher's remote URL through the Command Palette. Cairn.ink Memory's connection flow uses that path:

  1. Open the Command Palette with Cmd/Ctrl+Shift+P and run MCP: Add Server.
  2. Choose HTTP.
  3. Enter https://cairn.ink/api/mcp.
  4. Name the server cairn.
  5. Press Start and accept the server trust dialog.
  6. Complete the browser sign-in and approve the connection.
  7. Run MCP: List Servers and check that cairn is running.

Choose the configuration destination appropriate to your use: personal configuration for your own work, or an approved workspace configuration for the repository. Review the available tools in Copilot Chat. Starting the server is part of setup because it initiates authorization.

This hosted connector saves and retrieves context when asked; the Claude Code and Codex installer's automatic conversation capture is a separate integration. Ask Copilot to use the connected Cairn.ink Memory tools explicitly for the first test.

How do I verify that a fresh chat can retrieve it?

Save a harmless preference about a fictional project. Ask Copilot to save this privately to Cairn.ink Memory: “For the fictional Cedar demo, I prefer review summaries to begin with test results.” Inspect the actual tool response and keep the returned identifier.

Open a fresh chat and ask it to search Cairn.ink Memory for the Cedar review-summary preference, without supplying the answer. Expand the tool activity and compare the returned record with the save. A Memory's Source Receipt is its saved source excerpt and client context; read it alongside the result.

Then try the same query in another client connected to the same Cairn account. If you use Cursor, the Cursor memory guide covers its separate connection. Resolve an authentication error before retrying the save, and check the account and scope when a lookup is empty. Keep reviewed repository rules in version control while using the shared store for the private context you choose to retain.

Connect VS Code using the Cairn.ink Memory connection guide.

Frequently asked questions

Which file gives Copilot persistent project instructions?
Use .github/copilot-instructions.md for project guidance. Targeted .instructions.md files under .github/instructions can apply to matching files. Keep these reviewed conventions in version control.
Does VS Code have native Copilot Memory?
Yes. Current VS Code documentation describes cloud-backed Copilot Memory for local Copilot harness sessions, controlled by chat.copilot.memory.enabled and GitHub account policies. GitHub lists eligibility for paid Copilot plans.
Does connecting Cairn.ink Memory save every Copilot chat?
The hosted VS Code connector provides tools to save and retrieve context when asked. The automatic conversation capture documented for the Claude Code and Codex installer is a separate integration.

Sources