AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Combining Pieces and GitHub Copilot for Persistent Code Context Across IDE Sessions

Solène Génard · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

GitHub Copilot is exceptional at predicting what you want to type in the next three seconds. It scans your open tabs, reads the surrounding syntax, and autocompletes functions with eerie precision. But close your editor, switch to an adjacent microservice repository, or come back on Monday morning, and it forgets almost everything. Modern IDE AI has a goldfish memory.

At 365Finds, we find this constant session amnesia exhausting. Developers do not solve problems in isolated file buffers; they jump between terminal outputs, documentation tabs, Slack threads, and scratchpad scripts. When you feed that scattered knowledge into a fresh Copilot session manually, you waste hours repeating yourself. Pairing GitHub Copilot with Pieces bridges this exact fault line: Copilot provides the real-time code generation muscle, while Pieces acts as the persistent, cross-session context engine.

Here is how to set up the workflow, where the pairing excels, and where it still rubs against practical limits.


Why 365Finds Favors This Combination

Copilot is built for velocity in the immediate workspace. It is not designed to be your personal engineering archive. Pieces, built around its local Pieces OS runtime, specializes in capturing snippets, terminal traces, and browser-sourced architectural notes without leaving your local drive.

DimensionGitHub CopilotPiecesCombined Workflow
Primary StrengthInline completions, localized refactoringLong-term memory, cross-repo snippet indexingAutocomplete powered by multi-week developer history
Context ScopeCurrent repository and open filesEntire machine activity: terminal, browser, past chatsRepo-agnostic context piped directly into active editor
Data StorageCloud-based telemetry and prompt processingLocal-first vector store via Pieces OSPrivate long-term retention with cloud generative speed
Session BoundaryResets with chat thread or workspace closePersists indefinitely across reboots and projectsZero-reset continuity across Monday restarts

We prefer this hybrid approach because it avoids vendor lock-in. Instead of trusting a single vendor to index our entire machine into their cloud, Pieces OS keeps the memory layer on local disk, while GitHub Copilot handles code authoring in the editor.


Architecture: The Model Context Protocol Bridge

The glue connecting Pieces and GitHub Copilot is Anthropic's open-standard Model Context Protocol (MCP). Rather than copying snippets by hand from a Pieces window into Copilot Chat, Pieces OS runs a local MCP server over Server-Sent Events (SSE).

When you configure GitHub Copilot in VS Code to recognize Pieces as an MCP tool provider, Copilot gains permission to query your Pieces Long-Term Memory (LTM) database on demand. When you ask Copilot why a specific legacy API client failed two weeks ago, it queries Pieces behind the scenes, pulls the indexed snippet or terminal trace, and incorporates it into the prompt context.


Step-by-Step Configuration Guide

Connecting Pieces to GitHub Copilot requires running the local background daemon and updating your editor's MCP registry.

1. Ensure Prerequisites Are Running

2. Retrieve the Local Pieces MCP Endpoint

  1. Open the Pieces Desktop App.
  2. Navigate to your User Profile (top left) → Settings → MCP.
  3. Under the Available Servers tab, locate the SSE URL. By default, Pieces OS serves MCP at:
    http://localhost:39300/model_context_protocol/2024-11-05/sse
    
  4. Copy this endpoint URL.

3. Register the Server in Visual Studio Code

You can add Pieces through the VS Code Command Palette or directly via configuration files.

Method A: Command Palette

  1. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS).
  2. Type and select MCP: Add Server.
  3. Choose HTTP (sse) as the transport type.
  4. Enter http://localhost:39300/model_context_protocol/2024-11-05/sse when prompted for the URL.
  5. Name the connection Pieces.
  6. Select User Settings so the bridge remains available across every project workspace you open.

Method B: Manual Settings Configuration

Alternatively, add the server directly into your VS Code settings.json or project .vscode/mcp.json:

{
  "mcp.servers": {
    "Pieces": {
      "type": "sse",
      "url": "http://localhost:39300/model_context_protocol/2024-11-05/sse"
    }
  }
}

4. Verify Connection in GitHub Copilot Chat

Open the Copilot Chat panel in VS Code and switch the input mode to Agent. Click the tools icon at the base of the chat window. You should see Pieces listed with active tools for querying snippets and search history. If the indicator shows an error, restart VS Code to reinitialize the SSE handshake.


Practical Daily Workflow: Cross-Session Context in Action

Once connected, your development pattern changes. Instead of copy-pasting code blocks from past projects, you query your personal archive directly inside GitHub Copilot Chat.

Scenario A: Reusing Patterns Across Different Repositories

You wrote a custom JWT authentication middleware in a different backend repository three weeks ago. Now you are scaffolding a new microservice in an empty workspace.

Scenario B: Reviving Debugged Terminal Errors

You solved an obscure gRPC serialization bug yesterday that dumped a stack trace into your terminal. Pieces OS automatically captured that terminal output.


What 365Finds Dislikes and What to Watch For

This setup is powerful, but it is not seamless. Several friction points require discipline:

  1. Background Resource Overhead: Pieces OS is a standalone runtime executing local indexing and embedding models. On developer machines with 16 GB of RAM already stressed by Docker and VS Code, running Pieces OS alongside GitHub Copilot can push memory usage uncomfortably high.
  2. Context Pollution and Noise: If you enable unconstrained background capture in Pieces, its Long-Term Memory indexes everything—including broken draft snippets, throwaway shell commands, and random web pages. When Copilot performs a broad MCP retrieval, it can ingest outdated or flawed snippets into the prompt window, leading to hallucinated or deprecated recommendations.
  3. Protocol Stability: MCP over SSE is functional but occasionally brittle. If Pieces OS restarts or sleeps during system suspend, the SSE stream can break silently, requiring a VS Code window reload (Developer: Reload Window) to reconnect.

The 365Finds Verdict

Do not choose between Pieces and GitHub Copilot. They operate on two distinct layers of developer cognition. Copilot is the autocomplete engine for the active buffer; Pieces is the externalized long-term memory for everything surrounding that buffer.

365Finds recommends this combination specifically for senior developers and consultants working across multiple client repositories, where tribal knowledge and custom configuration snippets are perpetually scattered. The five minutes spent configuring the local MCP SSE endpoint permanently fixes Copilot’s context amnesia without shipping your proprietary snippet history to a third-party cloud.

The current local MCP endpoint configuration in Pieces OS remains at http://localhost:39300/model_context_protocol/2024-11-05/sse.


References