CommunityRédaction et éditiongithub.com

9rxu/git

Reusable Codex skill and PowerShell tool for safe Windows C drive cleanup

Qu'est-ce que git ?

git is a Codex agent skill that reusable Codex skill and PowerShell tool for safe Windows C drive cleanup.

Compatible avec~Claude Code✓Codex CLI~Cursor
npx skills add 9rxu/git

Installed? Explore more Rédaction et édition skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Clean C Drive

Use scripts/Invoke-CDriveCleanup.ps1 for deterministic scanning and cleanup. Read references/cleanup-experience.md when diagnosing a sudden refill or explaining why a directory was preserved.

Workflow

  1. Run a read-only scan first:

    powershell -NoProfile -ExecutionPolicy Bypass -File scripts\Invoke-CDriveCleanup.ps1 -Mode Scan -DeepScan
    
  2. Report the largest reclaimable cache paths separately from protected application or user data.

  3. Run user-level cleanup only after the user asks to clean:

    powershell -NoProfile -ExecutionPolicy Bypass -File scripts\Invoke-CDriveCleanup.ps1 -Mode Clean
    
  4. Run full cleanup when the user authorizes system cleanup. This cleans user caches, requests UAC, clears locked system caches, and runs DISM component cleanup:

    powershell -NoProfile -ExecutionPolicy Bypass -File scripts\Invoke-CDriveCleanup.ps1 -Mode Full
    
  5. Add -IncludeRecycleBin only when the user explicitly authorizes emptying it. Add -DisableHibernation only when the user explicitly asks to disable hibernation.

  6. Verify final free space, remaining locked paths, hibernation status, and any services temporarily stopped by cleanup.

Safety Rules

  • Never delete personal folders, project directories, browser profiles, installed programs, game libraries, or cloud-sync data automatically.
  • Never manually delete pagefile.sys, restore points, WinSxS, Installer, or System32 content.
  • Do not use DISM /ResetBase; use StartComponentCleanup so installed updates remain serviceable.
  • Preserve package installations such as roaming npm global tools, WinGet packages, Godot export templates, and Feishu version directories unless the user separately confirms removal.
  • Treat failures as locked or permission-protected items. Report them instead of broadening deletion scope.
  • Do not clear Prefetch as routine cleanup; Windows manages it and rebuilding it can slow startup.
  • Do not create junctions or move caches to another drive during cleanup unless the user separately requests migration.

Modes

  • Scan: Read-only known-cache inventory and protected-data summary.
  • Clean: Remove whitelisted user-level caches and temporary files.
  • AdminClean: Run only the elevated system-cleaning stage.
  • Full: Run Clean, then self-elevate for AdminClean.

Use -WhatIf with a cleaning mode to preview deletion targets without changing files.

Skills associés