Welcome to the Vibe Coding era.
With AI agents, chat-to-code interfaces, and code generation models, the cost of starting a new project has dropped to zero. We describe an idea, watch the AI spin up a fully-functioning React/Vite template, run a quick preview, and check the "vibe." If it works, we keep building; if it doesn't, we discard it and start fresh.
But this rapid, frictionless prototyping has a silent, compounding side-effect: workspace pollution and SSD exhaustion.
Every time an AI helper initializes a project, it starts with an install command. A standard React starter kit with Tailwind, TypeScript, and modern linting config downloads roughly 300MB to 700MB of dependencies.
If you vibe-code just five or six small prototypes a day, you are accumulating gigabytes of redundant, duplicated code modules on your drive. Within a couple of weeks, your machine is running out of disk space, clogged with dozens of forgotten node_modules folders containing the exact same versions of the exact same packages.
Here is how pnpm (Performant npm) silently solves this problem, giving you the freedom to prototype endlessly without your hard drive paying the price.
The Node Modules Black Hole: npm vs. pnpm
To understand why pnpm is a necessity in the AI generation era, let's look at how it compares to standard package managers.
1. The npm Approach: Duplicate Everything
Every time you run npm install or yarn install, the packages are downloaded from the registry and copied entirely into your project's local directory.
If you have 10 projects using React, you have 10 physical copies of React on your hard drive.
2. The pnpm Approach: Content-Addressable Storage
pnpm uses a completely different architecture. Instead of copying packages into every project, it keeps them in a single, global folder on your machine (usually under ~/.local/share/pnpm/store).
When you install dependencies in a project:
pnpmchecks if the package already exists in the global store.- If it does, it creates a Hard Link from the store to your project’s
node_modules/.pnpmdirectory. - It then structures your project's
node_modulesusing Symbolic Links (symlinks) to point to that hard-linked directory.
Global Store (~/.pnpm-store)
│
┌──────────┴──────────┐
▼ ▼
Project A/node_modules Project B/node_modules
(Hard linked) (Hard linked)
Because of this, the physical files only exist once on your hard drive. No matter how many React projects you spin up, they all point to the same physical file on your disk.
⚠️ The Partition & Multi-Drive Catch (Important)
Since hard links cannot cross drive partition boundaries (e.g., you cannot link a file from C:\ drive to a project on D:\ or G:\ drive), pnpm handles this intelligently:
- If your project is on your main drive (
C:\), it links from your global home store (e.g.C:\Users\username\AppData\Local\pnpm\store). - If you work on an external or partitioned drive (like
G:\orD:\),pnpmwill automatically create a dedicated store on the root of that partition (e.g.,G:\.pnpm-store). This ensures hard links are still created locally on that drive, saving your space and avoiding slow cross-disk copies.
Real World Savings: A Comparison
If you create 15 experimental Vite + Tailwind + TypeScript apps:
| Package Manager | Average Node Modules Size | 15 Projects Total Size |
|---|---|---|
| npm / yarn | ~350 MB | 5.25 GB |
| pnpm | ~350 MB (Shared Store) | ~350 MB (Total) |
With pnpm, 15 projects take up virtually the same space as a single project, with only a few kilobytes of overhead for the symlinks.
Bonus: Protecting against "Phantom Dependencies"
In the vibe coding era, code is often generated by AIs that might write imports for packages you didn't explicitly install in your package.json (such as transitive dependencies of other packages).
- npm hoists all packages to the top-level
node_modules, meaning if packageAdepends onB, you can importBdirectly in your code without listing it inpackage.json. If you update packageAlater and it drops dependencyB, your code breaks. - pnpm uses a strict, non-hoisted nested layout. You can only import what you explicitly listed in your
package.json. This keeps AI-generated code clean, predictable, and maintainable.
Teaching Your AI Coding Agent to Use pnpm
If you are using AI coding assistants (like Cursor, Windsurf, Copilot, or Antigravity), you can explicitly teach them to use pnpm instead of npm. Since these agents read your workspace files to understand your preferences, configuring project-level rules forces the AI to adapt to pnpm automatically.
Here is how you can set this up:
1. Create a Project-Level Rules File
Most AI coding editors look for a markdown/system rules file in your workspace root.
- For Cursor: Create a
.cursorrulesfile. - For Windsurf: Create a
.windsurfrulesfile. - For general agents (like Antigravity): Add rules to
.agents/AGENTS.md.
2. The AI Instructions Template
Paste these instructions into your rules file:
# Package Manager Rules
- Always use `pnpm` instead of `npm` or `yarn` for all package management tasks.
- When installing packages, use `pnpm add <package_name>` instead of `npm i` or `npm install`.
- When running scripts, use `pnpm run <script>` or `pnpm <script>` instead of `npm run`.
- When executing binaries, use `pnpm dlx <package>` instead of `npx <package>`.
- Do not create `package-lock.json` or `yarn.lock`. Ensure only `pnpm-lock.yaml` is generated and maintained.
3. Cleanup Habit: pnpm store prune
When you delete discarded vibe-coding folders from your disk, the actual physical package files still linger in your global pnpm store. To clean up and free up disk space from packages that are no longer referenced by any active project, run:
pnpm store prune
4. Pro-Tip: Reclaim Gigabytes Right Now with npkill
If you want to quickly locate and delete all the old, duplicate node_modules folders sitting on your drive from past projects, you can use npkill. You don't even need to install it:
pnpm dlx npkill
This utility opens an interactive list of all node_modules directories in your path, allowing you to delete them with a tap of the spacebar. Run this first, clean out the duplicates, and start fresh with pnpm!
How to Switch Your Vibe Projects to pnpm
If you are using Node, you can install pnpm globally:
npm install -g pnpm
Then, next time you or your AI agent spins up a new repo, instead of running npm install, simply run:
pnpm install
Your SSD will thank you, your build pipelines will run faster, and you can keep vibe coding without worrying about running out of disk space!