Developers working across multiple editors—such as Visual Studio Code, JetBrains IDEs (IntelliJ IDEA, PyCharm, WebStorm), Cursor, and terminal environments—often struggle with snippet fragmentation. Code templates, infrastructure configs, and recurring boilerplate get trapped inside isolated editor settings or lost across local scratchpads.
Pieces addresses this by decoupling snippet management from individual editor configurations. Powered by a local background service (Pieces OS), Pieces functions as a centralized, local-first repository that stores, enriches, and synchronizes code snippets across multiple IDE workspaces in real time.
This guide explains how Pieces synchronizes saved code snippets across different IDEs, how to access and insert them seamlessly in your workspaces, and how to export and back up your snippet library.
1. How Pieces Snippet Synchronization Works
Understanding the underlying sync mechanism helps avoid common setup pitfalls and data inconsistencies. Pieces relies on a tiered synchronization model:
[ IDE Workspace 1 (VS Code / Cursor) ] [ IDE Workspace 2 (JetBrains / IntelliJ) ]
│ │
▼ ▼
Local IPC / MCP Local IPC / MCP
│ │
└──────────────► [ Pieces OS ] ◄──────────────────┘
(Local Storage & AI Core)
│
▼ (Optional)
[ Pieces Personal Cloud ]
│
▼
[ Remote Workstation ]
Local-First Real-Time IPC (Single Machine)
All snippet persistence and indexing run locally through Pieces OS, which operates as a lightweight daemon on port 10000 (or dynamic local socket). When you save or edit a snippet in Visual Studio Code, the update is committed immediately to the local Pieces OS database. Other open editors—such as IntelliJ IDEA or Cursor—query the same local background instance. Synchronization between IDEs on the same computer occurs in sub-seconds and requires no internet connection.
Integration Protocols: MCP vs. Legacy Plugins
- Model Context Protocol (MCP): Pieces integrates with modern AI coding assistants (including Cursor, VS Code via GitHub Copilot or Continue, and Claude Desktop) via Anthropic's open Model Context Protocol. Through the local Pieces MCP server, your coding assistant can search, read, and inject saved snippets directly into your prompts or active workspace files.
- Pieces Drive Sidebar (Extension Interface): For direct visual navigation, the Pieces IDE integrations provide a sidebar tree view where developers can browse materials, search by tags or auto-generated titles, and insert code directly at the cursor.
Multi-Device Synchronization (Personal Cloud)
When working across multiple machines (such as an office desktop and a remote laptop), local IPC alone is not enough. Pieces bridges separate computers through Pieces Personal Cloud:
- You sign into the same Pieces account on both machines.
- The Desktop client creates an encrypted snapshot of your snippets, tags, and settings.
- The snapshot syncs through your private Pieces Cloud endpoint, allowing the second machine to download and restore the snippet library.
2. Step-by-Step: Synchronizing Snippets Between IDEs
Step 1: Ensure Pieces OS Is Running
Before working in any editor, ensure Pieces OS is active.
- macOS: Look for the Pieces icon in the top menu bar.
- Windows: Verify that Pieces OS is running in the system tray.
- Linux: Ensure the background service daemon is initialized (
systemctl --user status pieces-osor launch via application launcher).
If Pieces OS is not running, editor extensions and MCP endpoints will fail to connect.
Step 2: Save a Snippet from Your Current IDE
When you write or encounter a reusable code block in your workspace:
- Highlight the target code block in your editor.
- Right-click and choose Save to Pieces (or use the default shortcut:
Alt + M, Son Windows/Linux orOption + M, Son macOS). - Pieces OS captures the code and triggers an automatic enrichment pipeline:
- Identifies the programming language automatically.
- Generates a descriptive title and summary.
- Attaches tags (framework names, library dependencies).
- Records contextual metadata, including source file name and origin workspace.
Step 3: Access and Insert the Snippet in a Different IDE Workspace
To reuse the snippet in another editor (for example, switching from VS Code to JetBrains IntelliJ):
- Open the target IDE on the same machine.
- Open the Pieces Drive panel in the sidebar, or invoke the Pieces search palette.
- Locate the snippet using keyword search or tag filters.
- Place your editor cursor where the code belongs and click Insert at Cursor. The code block is pasted cleanly into your active buffer, preserving formatting and indentation.
Step 4: Access Snippets via MCP in AI-Driven Workspaces
If you use modern editors like Cursor or VS Code with MCP configured:
- Open your AI chat panel or inline composer.
- Query your saved snippet library directly using natural language (e.g., "Retrieve my Postgres connection pool helper from Pieces and adapt it for asyncpg").
- The MCP server reads the snippet directly from Pieces OS and injects it into the LLM context, allowing the assistant to generate code tailored to your team's conventions.
3. How to Export Saved Snippets from Pieces
Developers frequently need to share snippets with colleagues, migrate snippets to a new operating system, or export backups. Pieces provides several export paths depending on the destination.
Method 1: Exporting via Shareable Web Links (Pieces Links)
If you want to send a snippet to a teammate without forcing them to configure Pieces:
- In your IDE sidebar or Pieces Desktop app, find the target snippet.
- Right-click the snippet and select Share via Pieces link (or press
Ctrl + Shift + I/Cmd + Shift + I). - Pieces generates a secure HTTPS link hosted on the Pieces Cloud.
- When opened in any web browser, the recipient sees:
- The formatted code snippet with syntax highlighting.
- Auto-generated tags, language classifications, and descriptions.
- Any attached source context (e.g., documentation links or GitHub repository references).
- A single-click copy button.
Recipients do not need a Pieces account or software installation to view and copy the code.
Method 2: Exporting Across Devices via Personal Cloud Snapshots
To migrate your entire snippet collection between computers:
- Open the Pieces for Developers Desktop App.
- Click your user profile in the upper-left corner and go to Settings > Account.
- Scroll down to the Personal Cloud section and locate Backup & Restore Data.
- Click the Create Backup button (cloud icon with an upward arrow) to push an encrypted snapshot to your personal cloud.
- On your target computer, sign in with the same account, navigate to the same menu, and click Restore Backup. All snippets, metadata tags, and workspace contexts will be populated into the new machine's local Pieces OS.
Method 3: Manual Local Database Export and File Backup
Because Pieces is local-first, you can perform full offline backups by archiving the database directory directly from your file system.
- Completely close the Pieces Desktop App and exit Pieces OS.
- Navigate to the database storage location for your operating system:
- macOS:
~/Library/com.pieces.os/and~/Library/com.pieces.pfd/ - Windows:
C:\Users\<username>\AppData\Local\Mesh Intelligent Technologies, Inc\Pieces OS\com.pieces.os\andcom.pieces.pfd\ - Linux:
~/.local/share/com.pieces.os/
- macOS:
- Copy or compress the
com.pieces.osfolder to an external SSD, network drive, or local backup directory. - To restore on another machine, install Pieces OS, shut it down, and replace the newly generated directory with your backup copy.
Method 4: Programmatic Export via Local REST API / SDK
For teams that require automated export into internal documentation, Markdown repositories, or JSON archives:
- Pieces OS runs an HTTP REST API locally on port 10000.
- You can query the
/assetsendpoint usingcurlor the official Pieces Python / TypeScript SDKs to retrieve all saved snippets, code strings, tags, and classification metadata programmatically. - This allows you to write custom backup scripts that generate Git-tracked
.mdor.jsonfiles on a scheduled basis.
4. Comparison of Synchronization and Export Methods
| Method | Best For | Network Requirement | Metadata Retained |
|---|---|---|---|
| Local Pieces OS IPC | Instant sync across IDEs on one machine | Fully offline | Complete (tags, titles, language, history) |
| Model Context Protocol (MCP) | Injecting snippets into AI assistants (Cursor, Copilot) | Local / Dependent on AI model | Full semantic context and snippet body |
| Shareable Pieces Link | Peer code reviews and team messaging | Internet connection required | Formatted code, tags, descriptions, external links |
| Personal Cloud Snapshot | Moving workspace snippets to a new laptop | Internet connection required | Complete database snapshot and account settings |
| Manual Folder Backup | Air-gapped backups and complete OS migrations | Fully offline | Full local database, embeddings, and LTM cache |
| Local REST API / SDK | Custom programmatic exports to Markdown or JSON | Fully offline (local HTTP) | Raw JSON payload with full entity schema |
5. Important Trade-Offs and Limitations
- Daemon Dependency: All IDE synchronization depends strictly on Pieces OS running in the background. If the background daemon crashes or is suspended by system battery-saver policies, IDE extensions cannot retrieve or push snippets.
- Transition from Standalone Plugins to MCP: Pieces has updated its integration focus from maintenance-heavy individual IDE plugins toward standard MCP endpoints. For modern editors like Cursor and VS Code, configuring MCP yields better AI contextual retrieval than relying on legacy sidebar views.
- No Direct GUI Bulk-Export Button: The desktop user interface currently lacks a simple "Export All to ZIP" button. Teams requiring bulk migration away from Pieces must rely on the manual folder backup method or write a short script consuming the local REST API.
- Cloud Sync Scope: Automatic real-time cross-machine synchronization requires an active Personal Cloud connection. If you work in an air-gapped or high-security enterprise environment where cloud sync is restricted, snippet transfer between machines must be handled via manual database folder copy.