Visual Studio Code Extension
The Pieces for VS Code Extension is a versatile tool that integrates seamlessly with the VS Code editor, as well as IDEs based on VS Code, such as Cursor.
It provides users with a streamlined way to manage and interact with saved code snippets and harness the capabilities of the AI-powered Pieces Copilot directly within their coding environment.
-
Pieces Copilot: Engage in AI-driven conversations to enhance productivity by generating code, adding comments, troubleshooting, and more—all contextualized to your project by adding files and folders as context, with or without the powerful Long-Term Memory Engine (LTM).
-
Pieces Drive: Effortlessly save, locate, and share frequently used code snippets to your Pieces Drive—Making it easier to organize your work, quickly access important pieces of code, and collaborate effectively with others.

Explore troubleshooting options, navigate to our support page, or directly book a call with our engineers.
This extension is designed to offer two main pillars of functionality for developers working in the Visual Studio Code environment:
Enhanced AI Assistance
Through Pieces Copilot, developers can generate code solutions with context-based AI conversations, add code comments, troubleshoot, and fix bugs right inside VS Code.
Integrated Snippet Management
With Pieces Drive embedded in VS Code, developers can also save, edit, search, and share their code snippets, boosting productivity by keeping reusable code accessible.
Using Pieces Copilot
Inside VS Code, the Pieces Copilot offers several powerful actions to enhance your coding workflow using generative AI.
To start, you can initiate a conversation with the LLM of your choice, providing as much context as needed by adding files, folders, or even entire repositories to the chat.
To explore available options, simply select a portion of code, right-click, and hover over the Pieces
item in the context menu.
From here, you’ll find several quick actions, including:
-
Modify Selection with Copilot
: Edit or transform the selected code to improve readability, optimize performance, or adapt it for other needs. -
Explain Selection with Copilot
: Get detailed explanations of the code’s functionality. -
Comment Selection with Copilot
: Generate inline comments to improve code clarity.
You can also use the Ask Copilot About Active File
action to provide more context about your project. This helps Pieces Copilot better understand your entire file and deliver more relevant suggestions.
Using AI Quick Actions
The Pieces Copilot now comes packaged with AI Quick Actions, which are similar to CodeLens actions that sit above functions nearest your cursor.
With the new Pieces: Comment
tool, the Pieces Copilot can generate meaningful, insertable documentation explaining your codes’ purpose and function—and Pieces: Explain
can quickly generate a breakdown of some code logic while simultaneously initiating a Copilot chat in the side window.
|
|
---|
To get started, look for the AI Quick Actions buttons in your code—these buttons relocate themselves depending on the location of the nearest visible functions, and click the documentation or explanation tool depending on your use case.
Managing Your Pieces Drive
Saving and managing code snippets within Pieces Drive in the VS Code extension is simple and efficient.
To save a snippet, right-click the selected code, hover over Pieces
, and choose Save Current Selection to Pieces
. You can also use the Share
option to share snippets with others.
Common snippet types include utility functions, API requests, and reusable code blocks.
When you save snippets to your Drive, Pieces enriches them with AI-generated metadata, such as tags, titles, authorship details, and descriptions, keeping everything organized and accessible.
You can find brief descriptions below of the different material management options available within the Pieces for VS Code Extension:
-
Save Current Selection to Pieces
: Right-click a code block and save it to your repository with AI-enriched metadata, ensuring easy access to frequently used snippets. -
Save Active File to Pieces
: Save the entire active file to your repository in one action—ideal for preserving larger scripts or complete files. -
Ask Copilot About Selection
: Start a conversation with Pieces Copilot to gain insights, explanations, or improvement suggestions for the selected code. -
Ask Copilot About Active File
: Analyze the active file with Pieces Copilot to get insights and recommendations for your codebase. -
Share
: Share snippets with your team by creating distributable copies of reusable code. -
Search Pieces
: Quickly find specific snippets in your repository using keywords, tags, or titles.
Referencing & Reusing
The Pieces for VS Code Extension offers powerful search tools to quickly find and access your saved snippets.
You can perform broad searches or refine results using specific terms like function names, keywords, or tags, making it easy to locate the exact code you need.
To search, right-click, hover over Pieces
, and select Search Pieces
.
This opens a search bar where you can input queries to find your snippets. Once found, snippets can be shared or copied directly into your project.
Download the Extension
Ready to streamline your development? Download the Pieces for VS Code Extension and follow our installation guide to start.