Stop Letting Agents Fill Your SSD With npm
Description and use
AI agents running npm install duplicate node_modules, consuming SSD space. always‑pnpm rewrites npm commands to pnpm, enabling shared storage and saving disk space.
Problem
AI agents running npm install commands duplicate node_modules, consuming large disk space.
Outcome
Agents can be guided to use pnpm automatically, preventing redundant package copies and conserving SSD space.
Workflow
- 1. Prompt AI agent to prototype web apps. 2. Agent runs npm install for each project. 3. Disk space alert appears. 4. Install always-pnpm to intercept npm commands. 5. Agent’s npm commands are rewritten to pnpm. 6. Projects use shared pnpm store, saving space.
Evidence
The agent had downloaded three separate copies of React, Vite, TypeScript, and ESLint. Each project had its own 600 MB node_modules directory.
pnpm writes packages once to a global store at ~/.local/share/pnpm/store. Projects link to those files using filesystem hard links.
I built always-pnpm to stop fighting prompt instructions. The tool hooks directly into the agent runtime. When ... runs a shell command starting with npm or npx, always-pnpm parses the string and rewrites it to pnpm in under three milliseconds.
- Record date: 2026-10-08T18:56:06.293Z