Disk Cleaner (disk-sweeper) for Openclaw

Disk Cleaner is an intelligent command-line tool designed to safely analyze disk usage, identify large files, detect duplicates via SHA-256 hashing, and securely clean up application caches.

harrylabsj
v1.0.0
Jun 14, 2026
0
548
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install disk-sweeper

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install disk-sweeper using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Disk Cleaner (disk-sweeper)?

Disk Cleaner (disk-sweeper) is a high-performance system analysis and cleanup utility available via Openclaw Skills. Engineered for developers and power users, this CLI tool runs recursive directory scans to break down storage distribution by file type, size, and age. What makes it unique is its strict safety guardrails: it protects system-critical directories and uses a multi-tiered safety-grading framework to ensure you never delete essential files.

Beyond basic cleanup, the tool stands out in its ability to detect deep application caches, specifically targeting heavy resource hogs like macOS caches, Xcode, Docker, node_modules, and major Chinese productivity tools (WeChat, DingTalk, QQ, Baidu, WPS). It runs entirely offline, ensures zero network exposure, and leverages a smart, multi-pass SHA-256 deduplication algorithm to locate and reclaim space wasted by duplicate files.

Disk Cleaner (disk-sweeper) Use Cases

Here are common ways to utilize this utility from the directory of Openclaw Skills:

  • Reclaim Developer Storage: Instantly scan and wipe heavy cache build-ups from Docker images, Xcode DerivedData, npm/yarn node_modules, and Homebrew packages.
  • App Cache Clean Up: Identify and safely purge massive cache directories created by communication tools like WeChat, DingTalk, and QQ without disrupting chat logs.
  • System Space Auditing: Run real-time, streaming scans across your home directories to output clear visual reports of large files and overall disk usage.
  • Duplicate File Detection: Group and detect exact duplicate files using size-based sorting and layered SHA-256 content hashing to safely deduplicate archives and media.
  • Automated Maintenance: Set up weekly scheduled scan cron jobs to track disk health and output structured JSON summaries for monitoring.

How Disk Cleaner (disk-sweeper) Works

This tool follows a structured five-step execution pipeline when triggered via Openclaw Skills:

  1. Streaming Filesystem Scan: The scanner.py engine asynchronously scans the target path, automatically bypassing system-protected directories and directories without access permissions.
  2. Multi-dimensional Aggregation: The analyzer.py engine processes the files in real time, grouping them by type, size, directory nesting depth, extension, and file age.
  3. De-duplication Check: For duplicate detection, the tool groups potential matches by size first, then analyzes head hashes, and completes full SHA-256 content hashes to guarantee perfect matches without overhead.
  4. Safety Grading Analysis: The safety engine evaluates paths against a hardcoded protection matrix and patterns to tag files with color-coded risk grades (Safe, Cleanable, Caution, Protected).
  5. Safe Execution: It performs previews by default. Upon confirmation, files are sent safely to the system Trash (using native APIs) instead of permanent deletion, providing an instant safety net.

Disk Cleaner (disk-sweeper) Setup

Get started with Disk Cleaner directly from the registry of Openclaw Skills:

# Install the disk-sweeper skill globally
clawhub install disk-sweeper

# Run a quick, safe scan of your home directory
clawhub run disk-sweeper scan --paths ~/ 

# Preview cleanable items safely without deleting anything
clawhub run disk-sweeper clean --mode preview

# Safely execute automated cleanup for items marked green (Safe)
clawhub run disk-sweeper clean --mode auto-safe --confirm

Disk Cleaner (disk-sweeper) Data Schema & Taxonomy

The Disk Cleaner skill is structured modularly to decouple filesystem operations, analysis, and rule definitions. Below is the project file architecture and metadata schema used in this entry from Openclaw Skills:

Project Directory Structure

disk-sweeper/
├── SKILL.md                 # Skill definitions and documentation
├── scripts/
│   ├── scanner.py           # Filesystem scanner (streaming + progress)
│   ├── analyzer.py          # Space analysis engine
│   ├── duplicates.py        # Duplicate file detection (SHA-256)
│   ├── caches.py            # App cache recognition
│   ├── safety.py            # Safety grading + protection list
│   ├── cleaner.py           # Cleanup executor (trash/delete/undo)
│   ├── formatter.py         # Report formatting
│   └── progress.py          # Progress bar + status output
└── references/
    ├── protected-paths.json # System path protection definitions
    ├── cache-patterns.json  # Application cache regex and paths
    └── file-types.json      # Extension-to-category mappings

Safety Grading Matrix

Grade Color Indicator Rationale / Action
SAFE Green Reconstructable caches (e.g., npm, pip) that can be cleared safely
CLEANABLE Yellow Unused developer assets (e.g., Xcode DerivedData, Docker images)
CAUTION Orange App caches containing user data or attachments (e.g., WeChat, QQ)
PROTECTED Red System directories, core binaries, and OS-critical files (cannot override)

Disk Cleaner (disk-sweeper) Advanced Features

Explore the advanced engineering built into this skill as part of the Openclaw Skills ecosystem:

  • Hardcoded Critical Path Protection: Permanent exclusion rules prevent any scans or deletes from touching system files in /System, /bin, /sbin, /usr/bin, /etc, and /dev.
  • Multi-pass Duplicate Detection: Avoids performance bottlenecks on large media drives by verifying file sizes first, checking only the file header hash next, and executing a full SHA-256 hash only as a final verification step.
  • Trash-First Deletion Protocol: Ensures physical deletes are skipped by default; instead, native operating system commands move files to the user's trash bin (using 'use_trash: true').
  • Graceful Interrupt Handling: Captures SIGINT (Ctrl+C) interrupts to instantly save progress, cease active processes, and output a structured log of completed operations.
  • Zero-Network Architecture: Functions entirely local, reading no file contents and sending zero data packages over the internet, keeping your system usage profiles secure.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*