AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Use Pieces to Capture and Share Context Alongside GitHub Copilot

Silja Naumann · 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 exceptionally good at finishing your sentences inside an open file, but it suffers from persistent workspace amnesia. The moment your problem spans three different microservice repositories, a Stack Overflow thread you read twenty minutes ago in Chrome, and a terminal error you debugged last Tuesday, Copilot's context window runs out of room. You find yourself manually copying snippets back and forth just to prompt the model.

At 365Finds, we look at developer tools through a pragmatic lens: we dislike unnecessary friction, and we hate tools that demand you dump your entire proprietary codebase into yet another third-party cloud. That is why pairing Pieces with GitHub Copilot has become one of our favorite setups. Pieces acts as a local-first long-term memory engine (via PiecesOS), continuously capturing code snippets, browser research, and terminal outputs. Instead of replacing Copilot, Pieces feeds external context directly into Copilot Chat through the Model Context Protocol (MCP), while giving your team shareable, enriched links for institutional knowledge.

Here is exactly how to set up, capture, query, and share context between Pieces and GitHub Copilot without bloating your workflow.


Understanding the Division of Labor

Before touching any configuration file, you need to understand how the two tools divide responsibilities:

Instead of forcing Copilot to guess based only on the current tab, this architecture lets Copilot ask PiecesOS: "Did the developer solve this specific database migration error earlier, and what was the snippet?"


Step 1: Install PiecesOS and Enable Long-Term Memory

Pieces requires two core desktop components: the PiecesOS background daemon and the Pieces Desktop App.

  1. Download and install PiecesOS and the Pieces Desktop App for your operating system (macOS, Windows, or Linux).
  2. Launch PiecesOS and verify it is running in your system tray or menu bar. PiecesOS handles local indexing, OCR, and the MCP server.
  3. Open the Pieces Desktop App or the PiecesOS quick menu, navigate to settings, and confirm that Long-Term Memory (LTM) is enabled. LTM continuously builds a chronological timeline of technical context across your machine, running local embeddings so your code never leaves your workstation.

Step 2: Retrieve the Pieces MCP Server Endpoint

To allow GitHub Copilot to read from Pieces, you must expose Pieces as an MCP context provider:

  1. Open the Pieces Desktop App and click the gear icon to access Settings.
  2. Select the Model Context Protocol (MCP) tab.
  3. Locate your local Server-Sent Events (SSE) endpoint. It typically resembles:
    http://localhost:39300/model_context_protocol/2024-11-05/sse
    
    (Note: The exact port number may vary depending on your local installation; always copy the specific URL shown in your Pieces settings.)
  4. Keep this URL on your clipboard.

Step 3: Connect Pieces to GitHub Copilot in Visual Studio Code

GitHub Copilot Chat in Visual Studio Code supports MCP servers to expand its reasoning context beyond the active workspace.

  1. In VS Code, ensure both the GitHub Copilot and GitHub Copilot Chat extensions are updated to the latest release.
  2. Open your VS Code command palette (Cmd+Shift+P on macOS or Ctrl+Shift+P on Windows/Linux) and locate your MCP configuration file (or open your user/workspace settings.json / mcp.json file depending on your editor configuration).
  3. Add the Pieces MCP server definition to your mcpServers configuration block:
    {
      "mcpServers": {
        "pieces": {
          "type": "sse",
          "url": "http://localhost:39300/model_context_protocol/2024-11-05/sse"
        }
      }
    }
    
  4. Save the configuration and reload VS Code. When GitHub Copilot Chat initializes, it connects to your local PiecesOS instance.

Step 4: Capture Context Across Your Daily Workflow

Context is only useful if you capture it cleanly. Pieces automates context capture through three distinct mechanisms:

  1. Automatic Workflow Timeline (LTM): With Long-Term Memory active, Pieces passively tracks code patterns you copy, errors you encounter, and documentation pages you visit in your browser. When you switch projects, that history remains indexed.
  2. Explicit Code Snippet Saving: When you craft a clean utility function, SQL query, or regex pattern that you know you will reuse, save it to Pieces using global keyboard shortcuts or the desktop interface. Pieces automatically enriches the snippet with tags, a descriptive summary, language detection, and the originating file or URL.
  3. Screen Text and OCR: If you are watching an architecture presentation or reading code in a video stream, Pieces captures snippets directly from screen screenshots via on-device OCR, converting raw images into syntactically valid code blocks.

Step 5: Query Pieces Context Inside GitHub Copilot Chat

Once connected through MCP, you no longer need to copy code blocks into Copilot Chat prompts manually. You can query your personal knowledge base in natural language directly inside the Copilot chat window:

Copilot invokes the Pieces MCP server behind the scenes, retrieves the relevant code snippet, documentation link, or historical session, and incorporates that context into its response.


Step 6: Share Context and Snippets Across Your Engineering Team

Capturing context for personal recall is only half the battle. When teammates ask how you implemented an obscure integration, sharing raw code over Slack or Teams strips away vital metadata. Pieces solves this through structured context sharing:

  1. Context-Rich Shareable Links: Right-click any saved snippet in Pieces and generate a shareable link. Unlike a generic GitHub Gist, a Pieces link bundles the source URL, explanatory notes, tags, related files, and dependencies alongside the raw code.
  2. Shared Collections: Organize snippets into domain-specific collections (e.g., "Kafka Event Schemas", "Internal Auth Boilerplates"). You can export or distribute these collections so team members can load identical context into their own PiecesOS instances.
  3. Standardized Team Prompts: When onboarding junior engineers, provide them with your team's curated Pieces snippet link. They can plug the shared snippet directly into their own GitHub Copilot Chat session to ensure Copilot adheres to company-specific conventions.

365Finds Commercial Judgment: Strengths and Friction

We at 365Finds strongly favor this architecture over monolithic cloud alternatives, but it is not without real friction.

What 365Finds Recommends:

What Frustrates Us:

365Finds recommends this combination for senior developers and technical leads managing multi-repo architectures who find themselves repeatedly re-explaining the same internal architectural patterns to Copilot.


References