# Windows C Drive Cleanup

> Safely audit, clean, and migrate Windows C drive application data. Use when the user asks to inspect C drive usage, reduce C drive space, clean application caches, remove stale startup/menu/app remnants, move AppData or Roaming/Local folders to another drive with junctions, or troubleshoot why apps installed on D/E/F still occupy C drive.

- Skill: `messi-10-goat-one/windows-c-drive-cleanup` (Agent Skill, multi-file: 6 files)
- Install (CLI): `npx skillmds@latest add messi-10-goat-one/windows-c-drive-cleanup`
- Raw SKILL.md: https://api.skillmd.com/api/skills/messi-10-goat-one/windows-c-drive-cleanup/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: messi-10-goat-one (https://skillmd.com/u/messi-10-goat-one)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/messi-10-goat-one/windows-c-drive-cleanup

---


# Windows C Drive Cleanup

## Core Rules

Prefer inspection before deletion. Treat C drive cleanup as a filesystem safety task, not a generic "delete large files" task.

- State the boundary before acting: "read-only check", "cache cleanup", or "migration with junction".
- Exclude reparse points/junctions from size calculations unless explicitly verifying them.
- Never delete or move system, driver, Office, runtime, service, or uninstall-support folders just because they are large.
- Do not directly cut-and-paste app data folders. Move data to the target drive, then create a junction at the original path.
- Record every destructive or path-changing action in a timestamped folder under the current workspace.
- If deletion fails because files are in use, leave them and report that they are live temp files.
- If permission fails and the user asked for it, open the folder with Explorer instead of escalating.

## Standard Workflow

1. Inspect C drive usage.
   - Measure the relevant roots with reparse points skipped.
   - Check app install registry entries and start-menu shortcuts when the user asks why an app appears on C.
   - Check running processes before touching app data.

2. Classify each large item.
   - **Delete** only obvious cache/temp/log/crash/update artifacts.
   - **Migrate** live user data that an app expects at a fixed C path.
   - **Keep** system components, drivers, runtimes, uninstallers, services, and account/chat databases unless the user explicitly accepts the risk.

3. Execute narrowly.
   - Close or verify absence of processes for the target app.
   - Clean small disposable targets first.
   - Migrate large live directories one at a time to the app's install drive or the user's chosen drive.
   - Create a junction from the original C path to the new location.

4. Verify.
   - Confirm original paths exist as `Directory, ReparsePoint`.
   - Confirm targets exist and sizes/file counts are plausible.
   - Re-check C drive free space.
   - Summarize exactly what was deleted, migrated, skipped, and why.

## Useful Scripts

Use these scripts when they fit the task; read or adapt them if the exact safety policy needs adjustment.

- `scripts/scan_hotspots.ps1`: scan top-level C drive hotspots while skipping junction contents.
- `scripts/migrate_to_junction.ps1`: move one or more directories and create junctions at the original paths.
- `scripts/clear_cache_targets.ps1`: clear explicitly named cache/temp directories or files, skipping reparse points and recording failures.

Run scripts from PowerShell. Example:

```powershell
powershell -ExecutionPolicy Bypass -File "$HOME\.codex\skills\windows-c-drive-cleanup\scripts\scan_hotspots.ps1" -Top 50
```

## App Pattern Reference

Read `references/app-patterns.md` before making app-specific decisions. It captures common patterns from prior cleanup work, including Tencent/WeChat/QQ, DingTalk, Baidu Netdisk, Tencent Meeting, CloudMusic, and small generic caches.

## Decision Guidance

Delete when:

- The directory name is clearly `Cache`, `Code Cache`, `GPUCache`, `DawnCache`, `Temp`, `CrashDumps`, `Log`, `logs`, `update`, or an old app temp folder.
- The app is closed.
- The path is under the specific app data root being handled.
- The target is not a reparse point.

Migrate when:

- The directory is large and belongs to active app state under `AppData\Roaming` or `AppData\Local`.
- The app likely recreates the same C path if the directory is merely moved.
- The user wants C space back without losing app state.

Keep when:

- The path is `Program Files`, `Program Files (x86)`, `ProgramData`, Office, Visual C++ runtime, Edge WebView, NVIDIA, Lenovo, Autodesk, dotnet, Windows, or a service executable, unless there is a precise app-specific reason.
- The directory contains chat history, account databases, playlists, offline music, or user project data and no migration is requested.

## Migration Pattern

Use a junction, not a symlink, for ordinary app data folders:

1. Verify the app is closed.
2. Verify the destination does not already exist.
3. Measure source size and file count.
4. Move source to target drive.
5. Create a junction at the original source path.
6. Verify `Get-Item` shows `Directory, ReparsePoint` and the target path is correct.

Prefer destinations near the app install directory:

- `E:\Program Files (x86)\Tencent\UserData\Roaming\<name>`
- `E:\Program Files (x86)\DingDing\UserData\...`
- `E:\BaiduNetdiskDownload\BaiduNetdisk\BaiduNetdisk\UserData\...`
- `<non-C-drive>\TencentMeeting\UserData\...`

## Reporting

Keep the final answer short and concrete:

- What changed.
- What was deleted versus migrated.
- How much space was freed or moved off C.
- Which paths are now junctions.
- Any files left because they were in use or permission-protected.
- The absolute path to the timestamped record directory.

