Saving & Organizing Materials
Learn about bringing new code snippets into Pieces Drive, keeping them tidy, and maintaining context and clarity as your library expands.
Overview
Saving materials—code snippets, text notes, or entire files—is the foundation of Pieces Drive.
Once saved, these materials are automatically enriched with valuable metadata such as tags, annotations, and suggested links, helping you find and reuse them easily.
Saved Materials List
All of your saved materials are listed on the left-hand side of the view.
From this list, you can scroll down to see previous saved materials, or click the Clock
icon to sort them in a few different ways:
-
Recent
: Sorts the list of materials by which were most recently used. -
Suggested
: Presents saved materials that are likely to benefit your current workflow, eg., if you’ve been working on API calls in Python, you may see API boilerplate code snippets. -
Alphabetical
: Sorts the list by titles in alphabetically-descending order. -
Language
: Groups saved materials by language—Python, JavaScript, Kotlin, etc.
Adding New Materials
The primary way to add materials to Pieces Drive is through the Add Materials
button, located in the bottom-left corner of the Pieces Drive view.
Clicking it opens a modal that presents several distinct options for different workflows and preferences.
Paste Code from Clipboard
Paste code from your clipboard to save as a new material.
Purpose
Quickly add snippets you’ve copied from somewhere else—an IDE, a website, or a note.
How It Works
Select Paste Code from Clipboard
, then paste or drag and drop your code snippet into the provided text field. Pieces will instantly parse it and create a new snippet in your drive.
Use a Plugin
Find materials in your Pieces Drive that you saved in other Pieces-enabled plugins and extensions.
Purpose
Seamlessly save snippets to Pieces Drive from within your favorite IDE or browser.
How It Works
Install a Pieces for Developers extension or plugin (e.g., for Visual Studio Code, JetBrains IDEs, Chrome, etc.).
Whenever you highlight code and choose “Save to Pieces” (or similar), it syncs directly to your Pieces Drive.
Then, the snippet appears in your Saved Materials List with an auto-generated title and immediate enrichment.
Snippet Discovery
Scan local code repositories for useful snippets that are relevant to your workflow.
Purpose
Automate finding reusable code within a local folder or repository.
How It Works
Select Snippet Discovery in the modal, then choose a folder or repository on your device.
Pieces scans these files for frequently repeated code patterns (snippets).
You can decide which discovered snippets to add to Pieces Drive.
Import GitHub Gists
Import GitHub Gists as individual saved materials in your Pieces Drive.
Purpose
Bring your Gists (public or private) into one centralized repository.
How It Works
Log in with your GitHub account if prompted. Select Import GitHub Gists
and pick the Gist(s) you want to import.
Each file in the selected Gist becomes a separate snippet in Pieces Drive.
Create from Scratch
Create new saved materials from scratch.
Purpose
Quickly craft a new snippet or note that doesn’t yet exist anywhere else.
How It Works
Click Create from Scratch
.
Then, type or paste the content you’d like to save—this can be code or plain text.
You can assign an initial title or let Pieces generate one automatically.
Duplicate Current Material
Make a duplicate copy of a material to fork, revise, or modify.
Purpose
Make an immediate copy of the snippet you have open, often used for branching or revisions.
How It Works
Choose Duplicate Current Material in the modal.
Decide whether you want an exact copy, or a transformed version (e.g., more readable, more performant, different language, or boilerplate template).
The new snippet appears alongside the old one, preserving all context.
Describe a Snippet to Generate
Use generative AI to generate new saved materials based on your exact requirements.
Purpose
Use natural language to generate brand-new code.
How It Works
Click Describe a Snippet to Generate
.
Type a short or detailed description, e.g., “A basic Node.js HTTP server with URL parsing.”
Pieces produces the snippet automatically, complete with immediate enrichment and classification.
Add Files
Import files from your device to use as a base for snippet discovery, or as context for future workflows.
Purpose
Import entire local files into Pieces Drive for safekeeping and snippet discovery.
How It Works:
Select Add Files
.
Browse and pick one or multiple files.
Pieces scans their content, creating separate snippets if it detects multiple distinct code sections—or it may create a single snippet if the file is smaller.
Best Practices & Tips
Find some additional information and quick tips for saving and organizing materials in the Pieces Drive below.