Senior Build Cleanup & System Optimization Specialist. Expert in reclaiming disk space and resolving build corruption in 2026 ecosystems.
The artifact-janitor is a tactical skill designed to maintain a clean, efficient, and healthy development environment. In 2026, where monorepos can easily exceed 5GB in dependencies and build caches (Turborepo, Next.js), proactive management of build artifacts is no longer optionalβit is a performance requirement.
node_modules and hidden cache directories (.next, .turbo).| Anti-Pattern | Why it fails in 2026 | Modern Alternative |
|---|---|---|
Manual rm -rf |
Prone to typos (e.g., rm -rf / node_modules). |
Use the deep-clean.sh script or specific tool commands. |
Deleting .git |
Destroys repository history and identity. | NEVER delete .git unless detaching a repo. |
Deleting .env |
Loss of critical local secrets/keys. | Add .env to a "Protected" list. |
| Blind Deletion in CI | Can break incremental build performance. | Use targeted cache invalidation rather than total wipes. |
Ignoring .cache |
Many modern tools store GBs in hidden user-level caches. | Include ~/.cache and framework-specific caches in discovery. |
If you just need to free up some quick space or fix a minor build glitch:
# 1. Analyze space
du -sh node_modules .next
# 2. Targeted removal
rm -rf .next/
rm -rf node_modules/
# 3. Restore
bun install
Use this when your code is correct but the build is failing with strange errors.
# Clean all caches and build info
rm -rf .next tsconfig.tsbuildinfo .turbo
# Re-generate everything
bun run build
Use this before zipping a project or pushing a massive refactor to ensure no local artifacts interfere.
# Using the janitor script in dry-run first
./skills/artifact-janitor/scripts/deep-clean.sh --dry-run
# Execute if safe
./skills/artifact-janitor/scripts/deep-clean.sh
In 2026, monorepos are the norm. Standard rm doesn't scale.
# Remove all node_modules in every package
pnpm -r exec rm -rf node_modules
# Clean pnpm global store (use with caution)
pnpm store prune
# Bun is fast, but its cache can grow
bun pm cache rm
du -sh is your best friend.node, bun, or vite processes are locking the files.bun x tsc --noEmit to ensure the project structure is still valid.See References: Safety Protocols for more.
deep-clean.shWe provide a robust script in skills/artifact-janitor/scripts/deep-clean.sh.
Features:
--dry-run mode.# Usage
./skills/artifact-janitor/scripts/deep-clean.sh [options]
# Options:
# --dry-run : Only show what would be deleted.
# --force : Skip confirmation (use with caution).
Cause: Stale tsconfig.tsbuildinfo or .next/types.
Fix: rm tsconfig.tsbuildinfo && rm -rf .next.
Cause: Stale node_modules or symlink breakage.
Fix: rm -rf node_modules && bun install.
Detailed deep-dives into artifact management:
Updated: January 22, 2026 - 16:50