Skip to main content
plugin

vm-disk-cleanup — Claude Code plugin: what it does, how to install

Clears disk-eating caches and build artifacts in Claude environments to resolve ENOSPC errors.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add anthropics/claude-plugins-community
/plugin install vm-disk-cleanup@claude-community
Open on GitHub

What vm-disk-cleanup does

Protracted sessions inside sandboxes accumulate package caches, compilation outputs, and temporary files. When the volume hits capacity, ordinary shell operations fail under ENOSPC errors. That deadlock stops diagnostics.

The cleanup runs in three progressive tiers. Phase one targets Python bytecode, apt cache, and temp files using almost zero free space. Phase two clears npm and pip directories. Phase three removes node_modules, global packages, and heavy build outputs.

Execution triggers either manually via natural prompts or on detecting ENOSPC strings inside terminal output. Operating requires an environment with Bash access.

What it helps with

  • recover from terminal ENOSPC errors
  • purge pip and npm cache directories
  • clean up Python bytecode and temporary files
  • remove accumulated build outputs and node_modules

Example prompts for the agent

  • Clean disk space in this sandbox
  • Disk full, run emergency cleanup
  • Clear session artifacts and package cache

How to install vm-disk-cleanup

Plugin marketplace

/plugin marketplace add anthropics/claude-plugins-community
/plugin install vm-disk-cleanup@claude-community

Step by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own

Questions about vm-disk-cleanup

How to install vm-disk-cleanup in Claude Code?

Run /plugin marketplace add anthropics/claude-plugins-community followed by /plugin install vm-disk-cleanup@claude-community.

What does vm-disk-cleanup do?

It clears drive space in three stages: temp files and bytecode first, followed by npm and pip caches, ending with build artifacts and node_modules.

What dependencies does vm-disk-cleanup require?

It needs no external configuration beyond an environment providing Bash access.

Source text

vm-disk-cleanup · MIT
# VM Disk Cleanup

Prevent and recover from disk-full errors in Claude's working environment — both **Cowork** session VMs and **Claude Code** sandboxes.

## The Problem

Long Claude sessions accumulate disk-eating artifacts: npm/pip caches, `node_modules`, Python bytecode, build outputs, and temp files. When the disk fills completely, even basic Bash commands fail with `ENOSPC` errors — creating a deadlock where you can't diagnose or fix the problem.

## What It Does

A 3-phase cleanup that starts with the lightest operations (so they work even when disk is nearly full) and escalates:

| Phase | What it clears | Disk needed |
|-------|---------------|-------------|
| **1 — Emergency** | Python bytecode, temp files, apt cache | Almost zero |
| **2 — Medium** | pip cache, npm cache | Minimal |
| **3 — Heavy** | node_modules, build artifacts, global packages | Some free space |

## Installation

### Step 1: Add the MSApps marketplace (one-time)

**Claude Code (CLI):**
```
/plugin marketplace add MSApps-Mobile/claude-plugins
```

**Cowork (Desktop App):**
Go to **Settings → Plugins → Marketplaces → Add**, and enter `MSApps-Mobile/claude-plugins`.

You only need to do this once — it gives you access to all MSApps plugins.

### Step 2: Install the plugin

**Claude Code:**
```
/plugin install vm-disk-cleanup@msapps-plugins
```

**Cowork:**
Go to **Settings → Plugins**, search for **vm-disk-cleanup**, and click **Install**.
## Usage

Just say any of these naturally:

- "clean VM" / "clean disk"
- "disk full" / "no space left"
- "free disk space"
- "session cleanup"

The skill also activates automatically when it detects ENOSPC errors in Bash output.

### Pro tip: Pair with a scheduled task

In **Cowork**, you can set up a scheduled task that runs cleanup every 2 hours to prevent disk-full situations before they happen. Ask Claude: *"Create a scheduled task to clean the VM disk every 2 hours"*.

## Setup

No configuration needed. Works out of the box on both platforms.

## Requirements

- **Cowork**: Any session (Linux VM with Bash)
- **Claude Code**: Any environment with Bash access

## License

MIT — Free to use and modify.

© MSApps-Mobile · MIT · MSApps-Mobile/claude-plugins

Similar plugins

All plugins for DevOps and infrastructure →

From the same set24

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor