Xpersona
W

Windows Disk Cleaner

CLAWHUB · Unverified

Safe Windows disk cleanup assistant. Scans any drive (defaults to C:), analyzes space usage across temp files, dev caches (npm/pip/conda/docker/gradle/maven)... Skill: Windows Disk Cleaner Owner: guge0 Summary: Safe Windows disk cleanup assistant. Scans any drive (defaults to C:), analyzes space usage across temp files, dev caches (npm/pip/conda/docker/gradle/maven)... Tags: latest:2.0.0 Version history: v2.0.0 | 2026-04-07T14:40:08.065Z | user Renamed scan_disk.ps1 to scan_disk.txt for ClawHub file-type compatibility. Added openclaw metadata with powershell/python3 requirem

62
Rank
84
Safety
1.3k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: medium.

clawhub skill install s173gx66sjvs9e1g9d9xnmg7n98424tr:windows-disk-cleaner
  1. Setup complexity is MEDIUM. Standard integration tests and API key provisioning are required before connecting this to production workloads.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-guge0-windows-disk-cleaner/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

57,341 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: win-disk-cleaner
description: "Safe Windows disk cleanup assistant. Scans any drive (defaults to C:), analyzes space usage across temp files, dev caches (npm/pip/conda/docker/gradle/maven), browser caches, Windows Update leftovers, large files, duplicate files, and node_modules. Generates an interactive HTML report with three safety tiers (safe / review / never-touch). Users confirm deletions before any file is removed. Supports Chinese and English."
tags: "windows,disk-cleanup,cache,devtools,system-maintenance,powershell"
metadata:
  openclaw:
    requires:
      bins:
        - powershell
        - python3
    os:
      - windows
---

# Windows 磁盘清理助手

一个安全、全面的 Windows 磁盘清理 skill。核心原则:**先扫描分析,再展示报告,让用户决定删什么**。绝不静默删除任何文件。

支持扫描任意磁盘,默认扫描系统盘(通常是 C:)。用户可以指定盘符,如"帮我看看 D 盘"或"扫描所有磁盘"。对于非系统盘,跳过系统相关的扫描项(Windows Update、系统临时文件等),聚焦于大文件和用户数据分析。

## 工作流程概览

```
扫描 → 分析分类 → 生成报告(HTML) → 用户确认 → 执行清理 → 验证结果
```

## 第一步:环境检测与目标确认

在做任何事之前,先确认运行环境,并确定扫描目标:

```powershell
# 确认是 Windows
$env:OS
# 获取当前用户
$env:USERNAME
# 列出所有磁盘及空间概况,让用户了解全局
Get-PSDrive -PSProvider FileSystem | Format-Table Name, Used, Free, @{N='Total(GB)';E={[math]::Round(($_.Used+$_.Free)/1GB,2)}} -AutoSize
```

然后确认用户要扫描哪个盘:
- 如果用户已指定(如"清理 D 盘"),直接用指定盘符
- 如果用户没指定,默认使用系统盘(`$env:SystemDrive`,通常是 C:),但展示磁盘列表让用户确认
- 如果用户说"全部"或"所有磁盘",依次扫描每个盘

对于非系统盘,扫描策略有所不同:跳过 Windows Update 缓存、系统临时文件等系统相关项,聚焦于大文件分析、重复文件扫描、用户数据整理。

如果不是 Windows 环境,告知用户此 skill 专为 Windows 设计,并提供对应平台的基本建议。

## 第二步:全面扫描

按以下分类扫描。使用 PowerShell 脚本 `scripts/scan_disk.txt`(见下方说明),或直接在终端执行等效命令。

### 扫描分类

扫描结果分为三个安全等级:

#### 🟢 安全删除(Safe)——缓存和临时文件
这些删了不会丢失任何用户数据,最多影响一些加载速度(缓存会自动重建):

| 类别 | 典型路径 | 说明 |
|------|---------|------|
| Windows 临时文件 | `%TEMP%`, `C:\Windows\Temp` | 系统和用户临时文件 |
| Windows Update 缓存 | `C:\Windows\SoftwareDistribution\Download` | 已安装更新的安装包 |
| 缩略图缓存 | `%LOCALAPPDATA%\Microsoft\Windows\Explorer\thumbcache_*` | 文件预览缩略图 |
| 系统日志 | `C:\Windows\Logs` 中的旧日志 | 超过30天的日志 |
| 回收站 | 回收站 | 已删除的文件 |
| Windows 错误报告 | `%LOCALAPPDATA%\CrashDumps`, `C:\ProgramData\Microsoft\Windows\WER` | 崩溃转储和错误报告 |
| npm 缓存 | `%APPDATA%\npm-cache` | Node.js 包缓存 |
| pip 缓存 | `%LOCALAPPDATA%\pip\cache` | Python 包缓存 |
| conda 包缓存 | `%USERPROFILE%\.conda\pkgs` 中的 `.tar.bz2`/`.conda` 文件 | 已解压的包的压缩档 |
| NuGet 缓存 | `%LOCALAPPDATA%\NuGet\v3-cache` | .NET 包缓存 |
| Gradle 缓存 | `%USERPROFILE%\.gradle\caches` | Java/Gradle 构建缓存 |
| Maven 本地仓库 | `%USERPROFILE%\.m2\repository` (需谨慎,标记为黄色如果有本地发布的包) | Maven 依赖缓存 |
| Docker 未使用资源 | `docker system df` 检查 | 悬空镜像、停止的容器、未使用的卷 |
| 浏览器缓存 | 各浏览器缓存目录 | Chrome/Edge/Firefox 缓存 |

#### 🟡 需确认(Review)——可能有用户数据
删除前必须逐项或分组展示,让用户选择:

| 类别 | 典型路径 | 说明 |
|------|---------|------|
| 下载文件夹 | `%USERPROFILE%\Downloads` | 按修改时间排序,展示大文件 |
| 桌面大文件 | `%USERPROFILE%\Desktop` | 超过 100MB 的文件 |
| 大文件扫描 | 各用户目录 | 全盘超过 500MB 的文件(排除系统目录) |
| 旧版 Windows | `C:\Windows.old` | 系统升级残留(可能很大) |
| 重复文件 | 用户目录内 | 基于文件大小+部分哈希的重复检测 |
| node_modules | 项目目录中的 node_modules | 长期未访问的项目的依赖 |
| 虚拟环境 | `.venv`, `venv`, `.conda/envs` | 长期未使用的 Python/Conda 环境 |

_meta.json

{
  "ownerId": "kn790yt4a4gjzwda274zzfe901842sqe",
  "slug": "windows-disk-cleaner",
  "version": "2.0.0",
  "publishedAt": 1775572808065
}

references/safe_paths.md

# Windows 安全清理路径参考

本文档列出了 Windows 系统上已知的可安全清理路径,以及需要谨慎处理的路径。
扫描脚本会参考此文档决定哪些路径标记为安全、哪些需要用户确认。

## 🟢 安全清理路径

### 系统临时文件
| 路径 | 说明 | 备注 |
|------|------|------|
| `%TEMP%` | 用户临时文件夹 | 通常 `C:\Users\<user>\AppData\Local\Temp` |
| `C:\Windows\Temp` | 系统临时文件夹 | 需要管理员权限 |
| `C:\Windows\SoftwareDistribution\Download` | Windows Update 下载缓存 | 清理前需停止 wuauserv 服务 |
| `C:\Windows\Prefetch` | 预读缓存 | 可安全清理,会自动重建,但清理后短期内启动可能稍慢 |

### 错误报告和日志
| 路径 | 说明 |
|------|------|
| `%LOCALAPPDATA%\CrashDumps` | 应用崩溃转储 |
| `%LOCALAPPDATA%\Microsoft\Windows\WER` | Windows 错误报告(用户级) |
| `C:\ProgramData\Microsoft\Windows\WER` | Windows 错误报告(系统级) |
| `C:\Windows\Logs` 中超过30天的文件 | 系统日志 |

### 缩略图和图标缓存
| 路径 | 说明 |
|------|------|
| `%LOCALAPPDATA%\Microsoft\Windows\Explorer\thumbcache_*` | 缩略图缓存 |
| `%LOCALAPPDATA%\Microsoft\Windows\Explorer\iconcache_*` | 图标缓存 |

### 浏览器缓存

#### Chrome
- `%LOCALAPPDATA%\Google\Chrome\User Data\Default\Cache`
- `%LOCALAPPDATA%\Google\Chrome\User Data\Default\Code Cache`
- `%LOCALAPPDATA%\Google\Chrome\User Data\Default\Service Worker\CacheStorage`

#### Edge
- `%LOCALAPPDATA%\Microsoft\Edge\User Data\Default\Cache`
- `%LOCALAPPDATA%\Microsoft\Edge\User Data\Default\Code Cache`

#### Firefox
- `%LOCALAPPDATA%\Mozilla\Firefox\Profiles\*\cache2`

#### Brave
- `%LOCALAPPDATA%\BraveSoftware\Brave-Browser\User Data\Default\Cache`

**注意**:清理浏览器缓存前建议先关闭对应浏览器。

### 开发工具缓存

| 工具 | 缓存路径 | 清理命令 |
|------|---------|---------|
| npm | `%APPDATA%\npm-cache` | `npm cache clean --force` |
| yarn | `%LOCALAPPDATA%\Yarn\Cache` | `yarn cache clean` |
| pnpm | `%LOCALAPPDATA%\pnpm\store` | `pnpm store prune` |
| pip | `%LOCALAPPDATA%\pip\cache` | `pip cache purge` |
| conda | `%USERPROFILE%\.conda\pkgs` | `conda clean --all -y` |
| NuGet | `%LOCALAPPDATA%\NuGet\v3-cache` | `dotnet nuget locals all --clear` |
| Gradle | `%USERPROFILE%\.gradle\caches` | 手动删除 |
| Maven | `%USERPROFILE%\.m2\repository` | 手动删除(注意本地发布的包)|
| Go | `%LOCALAPPDATA%\go-build` | `go clean -cache` |
| Rust/Cargo | `%USERPROFILE%\.cargo\registry\cache` | `cargo cache --autoclean` |
| Docker | - | `docker system prune -af` |

### 其他应用缓存
| 路径 | 说明 |
|------|------|
| `%LOCALAPPDATA%\Microsoft\Windows\INetCache` | IE/Edge 临时文件 |
| `%LOCALAPPDATA%\Temp` | 某些应用的临时文件 |
| `%APPDATA%\Code\Cache` | VS Code 缓存 |
| `%APPDATA%\Code\CachedData` | VS Code 编译缓存 |
| `%APPDATA%\Code\CachedExtensionVSIXs` | VS Code 扩展缓存 |

## 🟡 需用户确认的路径

| 路径 | 原因 |
|------|------|
| `%USERPROFILE%\Downloads` | 可能有用户需要的文件 |
| `%USERPROFILE%\Desktop` 上的大文件 | 用户主动放置的文件 |
| `C:\Windows.old` | 旧系统备份,某些情况下可能需要回滚 |
| 项目中的 `node_modules` | 删除后需 `npm install` 重新安装 |
| Python 虚拟环境 (`.venv`, `venv`) | 删除后需重新创建 |
| Conda 环境 (`%USERPROFILE%\.conda\envs`) | 删除后需重新创建 |
| `%USERPROFILE%\.m2\repository` | Maven 可能有本地发布的包 |
| Docker 卷 (`docker volume ls`) | 可能包含持久化数据 |

## 🔴 绝对不能碰的路径

以下路径在任何情况下都不应被扫描或建议删除:

- `C:\Windows\` (SoftwareDistribution\Download 除外)
- `C:\Program Files\`
- `C:\Program Files (x86)\`
- `C:\ProgramData\` (除已知缓存子目录外)
- `C:\

scripts/scan_disk.txt

<#
.SYNOPSIS
    Windows 磁盘空间扫描脚本 - 安全扫描,不删除任何文件
.DESCRIPTION
    扫描 Windows 系统磁盘,分析空间占用情况,输出 JSON 格式的扫描结果。
    所有操作只读,不会修改或删除任何文件。
.PARAMETER Drive
    要扫描的驱动器盘符,默认为系统盘(通常是 C:)
.PARAMETER OutputPath
    JSON 结果输出路径,默认输出到当前目录的 scan_result.json
.PARAMETER TopN
    大文件扫描时返回前 N 个最大文件,默认 50
.EXAMPLE
    .\scan_disk.ps1
    .\scan_disk.ps1 -Drive "D:" -TopN 100
#>

param(
    [string]$Drive = $env:SystemDrive,
    [string]$OutputPath = ".\scan_result.json",
    [int]$TopN = 50
)

$ErrorActionPreference = "SilentlyContinue"

# 判断是否为系统盘
$isSystemDrive = ($Drive.TrimEnd(':\') -eq $env:SystemDrive.TrimEnd(':\'))

# ============================================================
# 辅助函数
# ============================================================

function Get-FolderSizeQuick {
    param([string]$Path, [int]$TimeoutSeconds = 30)
    if (-not (Test-Path $Path)) { return 0 }
    $size = 0
    try {
        $job = Start-Job -ScriptBlock {
            param($p)
            (Get-ChildItem -Path $p -Recurse -File -Force -ErrorAction SilentlyContinue |
                Measure-Object -Property Length -Sum).Sum
        } -ArgumentList $Path
        $completed = Wait-Job $job -Timeout $TimeoutSeconds
        if ($completed) {
            $size = Receive-Job $job
        }
        Remove-Job $job -Force
    } catch {
        $size = 0
    }
    if ($null -eq $size) { $size = 0 }
    return [long]$size
}

function Format-SizeString {
    param([long]$Bytes)
    if ($Bytes -ge 1GB) { return "{0:N2} GB" -f ($Bytes / 1GB) }
    if ($Bytes -ge 1MB) { return "{0:N2} MB" -f ($Bytes / 1MB) }
    if ($Bytes -ge 1KB) { return "{0:N2} KB" -f ($Bytes / 1KB) }
    return "$Bytes B"
}

function Test-CommandExists {
    param([string]$Command)
    return [bool](Get-Command $Command -ErrorAction SilentlyContinue)
}

# ============================================================
# 磁盘基本信息
# ============================================================

Write-Host "============================================" -ForegroundColor Cyan
Write-Host "  Windows 磁盘清理扫描工具" -ForegroundColor Cyan
Write-Host "  扫描目标: $Drive" -ForegroundColor Cyan
Write-Host "============================================" -ForegroundColor Cyan
Write-Host ""

$driveInfo = Get-PSDrive -Name ($Drive.TrimEnd(':')) -PSProvider FileSystem
$totalSpace = $driveInfo.Used + $driveInfo.Free
$usedSpace = $driveInfo.Used
$freeSpace = $driveInfo.Free
$usedPercent = [math]::Round(($usedSpace / $totalSpace) * 100, 1)

Write-Host "[磁盘概览]" -ForegroundColor Yellow
Write-Host "  总空间: $(Format-SizeString $totalSpace)"
Write-Host "  已用:   $(Format-SizeString $usedSpace) ($usedPercent%)"
Write-Host "  可用:   $(Format-SizeString $freeSpace)"
Write-Host ""

$result = @{
    scan_time    = (Get-Date -Format "yyyy-MM-dd HH:mm:ss")
    drive        = $Drive
    total_bytes  = $totalSpace
    used_bytes   = $usedSpace
    free_bytes   = $freeSpace
    used_percent = $usedPercent
    username     = $env:USERNAME
    categories   = @{
        safe   =

skill-card.md

## Description:

Safe Windows disk cleanup assistant that scans Windows drives, analyzes temporary files, developer caches, browser caches, Windows Update leftovers, large files, duplicate files, and node_modules, then generates an interactive report with safe, review, and never-touch cleanup tiers.

This skill is ready for commercial/non-commercial use.

## Publisher:

[guge0](https://clawhub.ai/user/guge0)

### License/Terms of Use:

MIT-0

## Use Case:

Developers, IT staff, and Windows power users use this skill to inspect disk usage, identify cleanup candidates, and generate reviewable cleanup commands and reports before deleting local files.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Generated cleanup commands may delete important Firefox profile data or Docker volumes.

Mitigation: Inspect every generated command before execution, remove Docker `--volumes`, and avoid any command targeting Firefox profile roots.

Risk: Generated reports can expose local usernames, file paths, and file inventories.

Mitigation: Treat reports as sensitive local artifacts and redact or avoid sharing them outside the intended review workflow.

## Reference(s):

- [Windows Safe Cleanup Paths](references/safe_paths.md)
- [ClawHub Skill Page](https://clawhub.ai/guge0/skills/windows-disk-cleaner)

## Skill Output:

**Output Type(s):** [Text, Markdown, Code, Shell commands, Files, Guidance]

**Output Format:** [Markdown guidance with PowerShell commands, JSON scan results, and an HTML cleanup report]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Windows-only; generated reports may contain local usernames, paths, and file inventories.]

## Skill Version(s):

2.0.0 (source: release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Windows Disk Cleaner and adjacent AI workflows.