Overview
Pumu is designed with safety-first principles. It includes multiple layers of protection to prevent accidental deletion of critical files, system folders, and active projects.Never-Deleted Folders
System and Cache Directories
Fromscanner.go:26-31, Pumu never descends into these directories:
| Folder | Why It’s Protected | Risk if Deleted |
|---|---|---|
.git | Version control | CRITICAL - Lose all Git history |
.npm, .yarn | Global package caches | Break all npm/yarn projects on system |
.cargo, .rustup | Rust global cache | Break all Rust projects |
Library (macOS) | System libraries | OS instability |
AppData (Windows) | Application data | Break installed applications |
.vscode, .idea | IDE settings | Lose editor configuration |
.cache | Generic cache | May slow down applications |
.Trash | macOS trash | Unexpected behavior |
What Pumu Actually Deletes
Only these regenerable folders are targeted (fromscanner.go:34-37):
These folders are safe to delete because they can be fully regenerated from:
- Lockfiles (
package-lock.json,Cargo.lock, etc.) - Source code
- Build configurations
Safety Layers
1. Dry-Run Mode
Thelist command never deletes anything - it only previews what would be removed.
Best practice: Always run
pumu list before pumu sweep to preview what will be deleted.2. Interactive Selection
By default,sweep mode shows an interactive multi-select so you choose exactly what to delete (from scanner.go:107-117):
| Key | Action |
|---|---|
↑ / k | Move cursor up |
↓ / j | Move cursor down |
space | Toggle selection |
a | Select all |
n | Deselect all |
i | Invert selection |
enter | Confirm deletion |
q / esc | Cancel operation |
Pressing
q or esc aborts the entire operation - nothing is deleted (see scanner.go:112-115).3. Explicit sweep Command
Pumu requires you to explicitly use the sweep command to delete anything:
| Command | Behavior |
|---|---|
pumu | Refresh current directory (detects package manager) |
pumu list | Read-only - no deletions |
pumu sweep | Deletes after interactive selection |
pumu sweep --no-select | Deletes all found folders (dangerous) |
4. Smart Prune Mode
prune mode uses a scoring algorithm to only delete safe folders (see README:254-293):
| Score | Meaning | Action |
|---|---|---|
| 90-95 | Orphan (no lockfile) or build cache | Deleted |
| 60-80 | Stale lockfile (30-90+ days old) | Deleted |
| 45 | Normal dependency folder with lockfile | Deleted (default threshold ≥ 50) |
| 15-20 | Active project or uncommitted changes | Skipped |
Conservative mode: Use
--threshold 80 to only delete high-score (orphan) folders.5. Concurrent Safety
Fromscanner.go:170-190, Pumu uses mutexes and atomic operations to prevent race conditions:
- Multiple goroutines access shared data
- Without locks, concurrent writes could corrupt the folder list
- Atomic operations ensure accurate size tracking during deletion
6. Error Handling
Pumu continues processing even if individual operations fail (fromscanner.go:183-186):
- One permission error doesn’t halt the entire scan
- Partial deletions are tracked accurately
- Failed deletions don’t affect successful ones
Interactive Selection Workflow
Here’s the full workflow when you runpumu sweep:
Step-by-Step Safety Checks
- Scan phase - Only deletable targets are found
- Size calculation - Preview before deletion
- First selection - Choose which folders to delete
- Deletion - Only selected folders are removed
- Second selection (if
--reinstall) - Choose which projects to reinstall - Summary - Show what was actually deleted
You can abort at any selection screen by pressing
q or esc. Nothing is deleted until you press enter on the first selection.Recovery Strategies
If You Accidentally Delete node_modules
- With Lockfile
- Without Lockfile
- Using Git
Safe recovery:Result: Exact same dependencies restored from lockfile.
If You Delete the Wrong Folder
I deleted .venv but needed it
I deleted .venv but needed it
Recovery:Result: Exact environment restored if
requirements.txt exists.I deleted target/ and lost debug symbols
I deleted target/ and lost debug symbols
Recovery:Result: Compilation artifacts regenerated. Debug symbols restored.
I deleted .next and can't build
I deleted .next and can't build
Recovery:Result:
.next folder regenerated from source code.If You Accidentally Use --no-select
Command:
- Stay calm - All deleted folders are regenerable
- Check what was deleted - Review the summary output
- Use reinstall - Run
pumu sweep --reinstall --no-selectto restore everything
What Pumu Will Never Delete
Version Control
.git/.svn/.hg/
Source Code
.js,.ts,.py,.gofilessrc/,lib/,components/- Configuration files
Global Caches
~/.npm/~/.cargo/~/.cache/
System Folders
Library/(macOS)AppData/(Windows)/usr/,/etc/
Safety Checklist
Before runningpumu sweep, verify:
- Lockfiles are committed to version control
- You’ve run
pumu listto preview - You’re in the correct directory
- You have backups of any custom build configurations
- You know how to reinstall dependencies for each project
FAQ
Can Pumu delete my source code?
Can Pumu delete my source code?
No. Pumu only deletes folders in the
deletableTargets list:node_modules,target,.venv,.next,.svelte-kit,dist,build
What if I cancel during deletion?
What if I cancel during deletion?
Partially deleted folders remain deleted. However:
- Canceling during selection = nothing is deleted
- Canceling during deletion = some folders may be partially removed
Is it safe to run Pumu on production servers?
Is it safe to run Pumu on production servers?
No. Pumu is designed for development machines:
- Production should use containerized dependencies
- Deleting
node_modulesin production causes downtime
Can I customize ignored paths?
Can I customize ignored paths?
Yes, but requires recompiling:
- Edit
internal/scanner/scanner.go:26-31 - Add your paths to
ignoredPathsmap - Run
go build -o pumu
See Also
- Package Manager Detection - What Pumu recognizes
- Performance Guide - Concurrent scanning details