Npkill
Clean up node_modules and .next folders to free up disk space using npkill.
- Rating
- 4.1 (30 reviews)
- Downloads
- 913 downloads
- Version
- 1.0.0
Overview
Clean up node_modules and .next folders to free up disk space using npkill.
Complete Documentation
View Source →
NPkill - Node.js and Next.js Build Artifact Cleaner
This skill leverages the npkill tool to clean up node_modules and .next folders that accumulate over time from JavaScript and Next.js development, freeing up significant disk space.
Purpose
This skill addresses a common problem faced by JavaScript and Next.js developers: accumulation of large build artifact folders (node_modules, .next) that consume significant disk space over time. It provides a safe and efficient way to identify and remove these unnecessary folders.
When to Use This Skill
Use this skill when:
- Your disk space is running low due to accumulated node_modules folders
- You want to clean up old Next.js build artifacts (.next folders)
- You need to maintain a clean development environment
- You want to identify which projects are consuming the most disk space
- You want to perform regular maintenance on your development workspace
Core Commands
Interactive Cleanup (Recommended)
npkill
Target .next Folders Specifically
npkill --target .next
Dry Run (Always Recommended First)
npkill --dry-run
Automated Cleanup (Use with Caution)
npkill --delete-all --yes
View Sizes in Gigabytes
npkill --gb
Scan from Specific Directory
npkill --directory /path/to/search/from
Safety Features
- Warnings for Protected Directories: npkill highlights system/app directories that shouldn't be deleted with a ⚠️ symbol
- Interactive Confirmation: Manual selection required in interactive mode
- Dry-run Option: Preview changes before executing any deletions
- Exclusion Options: Ability to exclude specific directories from scanning
Common Use Cases for Next.js Developers
Clean .next Folders Safely
# First, preview what would be deleted
npkill --target .next --dry-run
# Then, if satisfied with the preview, run interactively
npkill --target .next
Regular Maintenance
# Run interactive cleanup to review and selectively delete
npkill
Check Disk Usage
# View all node_modules folders sorted by size
npkill --sort=size
Best Practices
- Always run with --dry-run first to see what would be deleted
- Review warnings carefully about protected directories marked with ⚠️
- Use interactive mode for safer selective deletion
- Consider excluding important project directories using --exclude if needed
- Schedule regular cleanup to prevent massive accumulation
Installation Requirements
This skill requires the npkill CLI tool to be installed globally:
npm install -g npkill
Limitations
- Requires npkill to be installed separately
- May not detect all protected system directories in all environments
- Interactive mode requires terminal with arrow key support
Installation
openclaw install npkill
💻Code Examples
### Clean .next Folders Safely
# First, preview what would be deleted
npkill --target .next --dry-run
# Then, if satisfied with the preview, run interactively
npkill --target .next### Regular Maintenance
# Run interactive cleanup to review and selectively delete
npkill### Check Disk Usage
# View all node_modules folders sorted by size
npkill --sort=sizeTags
Quick Info
Ready to Install?
Get started with this skill in seconds
Related Skills
4claw
4claw — a moderated imageboard for AI agents.
Aap Passport
Agent Attestation Protocol - The Reverse Turing Test.
Acestep Lyrics Transcription
Transcribe audio to timestamped lyrics using OpenAI Whisper or ElevenLabs Scribe API.
Adaptive Suite
A continuously adaptive skill suite that empowers Clawdbot.