<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 2237</title>
    <description>The latest articles on DEV Community by 2237 (@zl2237).</description>
    <link>https://dev.to/zl2237</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4266502%2F8023fbd9-0989-4aa7-98c2-ac8012a2f70a.jpg</url>
      <title>DEV Community: 2237</title>
      <link>https://dev.to/zl2237</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zl2237"/>
    <language>en</language>
    <item>
      <title>I Let an AI Agent Clean My C: Drive — 6.28 GB Freed, 32 Items, and I Approved Every Single Deletion</title>
      <dc:creator>2237</dc:creator>
      <pubDate>Thu, 26 Nov 2026 09:33:10 +0000</pubDate>
      <link>https://dev.to/zl2237/i-let-an-ai-agent-clean-my-c-drive-628-gb-freed-32-items-and-i-approved-every-single-deletion-fh8</link>
      <guid>https://dev.to/zl2237/i-let-an-ai-agent-clean-my-c-drive-628-gb-freed-32-items-and-i-approved-every-single-deletion-fh8</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; My C: drive was at 89.8 GB free. Ten minutes and one sentence to my AI coding agent later, it was 96.08 GB — 6.28 GB freed across 32 items, zero mistakes, and I saw and approved every single item before anything was deleted. The skill that did it is open-source, pure PowerShell, and works with Claude Code, Trae and Cursor.&lt;/p&gt;

&lt;p&gt;My C: drive turns red every few months. Yours probably does too.&lt;/p&gt;

&lt;p&gt;I tried the usual two options. One-click cleaners are fast but opaque — "3.2 GB freed!" — of what? And once, after a "deep registry clean," some system settings got reset and I never found out why. Manual cleanup is the opposite: open a file listing, audit directory by directory, give up after two hours.&lt;/p&gt;

&lt;p&gt;Then AI coding agents offered a tempting third option: just ask the agent to clean up. It's genuinely good at the judgment part. But the one time I let it act on its own, I caught it about to remove a folder it classified as "looks like cache." That folder held six months of experiment data.&lt;/p&gt;

&lt;p&gt;The problem isn't that AI is bad at this. The problem is the permission model.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Friday run, in numbers
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/zl2237/system-cleanup" rel="noopener noreferrer"&gt;system-cleanup&lt;/a&gt; is my answer — an Agent Skill (standard &lt;code&gt;SKILL.md&lt;/code&gt; format) for coding agents like &lt;strong&gt;Claude Code, Trae, Cursor, CodeBuddy or ZCode&lt;/strong&gt;. Pure PowerShell 5.1+, zero dependencies.&lt;/p&gt;

&lt;p&gt;Last Friday, one sentence — "help me clean up my C: drive" — produced this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Space freed&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;6.28 GB&lt;/strong&gt; (89.8 → 96.08 GB free)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Items processed&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;32, all successful, zero mistakes&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Also found&lt;/td&gt;
&lt;td&gt;9 dead environment variables (Maven, IDEA 2024.1 still haunting my PATH)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Awaiting my approval&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;10.5 GB&lt;/strong&gt; of dev caches (npm/pip/NuGet), tiered "deletable, will re-download"&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two moments from that run convinced me the judgment layer actually works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;It deleted the old, spared the live.&lt;/strong&gt; It flagged PyCharm &lt;strong&gt;2024.3&lt;/strong&gt; leftover directories (~2 GB) as deletable — but recognized &lt;strong&gt;2025.2&lt;/strong&gt; as the version I actively use and didn't touch a byte of it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It doesn't bluff when unsure.&lt;/strong&gt; A 637 MB directory wasn't quietly mixed into "safe to delete." It was listed separately as "unsure." I said keep. It kept.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How it works: four steps, no "one-click"
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd7c5pus0zbvaxzlemji4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd7c5pus0zbvaxzlemji4.gif" alt=" " width="600" height="516"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You say "my C: drive is full"
        │
        ▼
① Scan      (read-only — nothing is deleted)
② Report    (item, size, safety tier, why it's deletable)
③ You approve (all of it? some? none?)
④ Execute   (automatic backups, logging, rollback paths)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The executor scripts only accept a JSON plan file you explicitly confirmed. There is no path from "the AI hallucinated" to "files are gone."&lt;/p&gt;

&lt;h2&gt;
  
  
  What it covers
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;You say&lt;/th&gt;
&lt;th&gt;It does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;"My environment variables are a mess"&lt;/td&gt;
&lt;td&gt;Finds dead PATH entries and variables pointing to deleted software; exports a &lt;code&gt;.reg&lt;/code&gt; backup before touching anything&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"I uninstalled this app, leftovers?"&lt;/td&gt;
&lt;td&gt;Cross-references installed-software list against AppData/ProgramData; buckets orphans into "safe to delete" vs "unsure"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"C: is full"&lt;/td&gt;
&lt;td&gt;Whitelist scan of temp files, crash dumps, browser caches; Top-N largest-file hunt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"Re-plan my disks"&lt;/td&gt;
&lt;td&gt;Proposes a layout, migrates with &lt;code&gt;robocopy /MOVE&lt;/code&gt; (copy-verify-then-delete-source), fixes PATH along the way&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The dev-cache scan deserves its own note: npm, pnpm, pip, Maven, Gradle, NuGet, Go, Conda and Docker caches are tiered into &lt;em&gt;safe-delete-and-rebuild / safe-delete-and-redownload / use-the-official-command / report-only&lt;/em&gt;. My Maven repository got the "official command" tier with the explanation "all Java deps would re-download; costly if you have many projects." That's the level of nuance a blanket &lt;code&gt;rm -rf&lt;/code&gt; advice never reaches.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it's safe enough to actually run
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scan and execute are separate programs.&lt;/strong&gt; Six scanners are read-only; two executors require the human-approved plan file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Whitelist-only.&lt;/strong&gt; &lt;code&gt;hiberfil.sys&lt;/code&gt;, &lt;code&gt;pagefile.sys&lt;/code&gt;, &lt;code&gt;Windows.old&lt;/code&gt; are reported but never deleted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Registry changes are backed up first&lt;/strong&gt; via &lt;code&gt;reg export&lt;/code&gt; — restoring is a double-click.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Migrations don't gamble with data.&lt;/strong&gt; Cross-volume moves copy-verify-then-delete-source.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Everything is on the record&lt;/strong&gt; in &lt;code&gt;Desktop\cleanup-report-&amp;lt;date&amp;gt;\&lt;/code&gt; — that's where every number in this post comes from.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a list of things it &lt;strong&gt;deliberately does not do&lt;/strong&gt;: registry "deep cleaning" (near-zero benefit, real risk), duplicate-file deletion (one wrong guess costs more than the space saves), startup "optimization." Fewer features, executed reliably.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a skill and not a GUI app?
&lt;/h2&gt;

&lt;p&gt;Because cleanup is judgment-heavy, not execution-heavy. A GUI ships rules, and rules can't decide whether &lt;code&gt;%AppData%\SomeVendor&lt;/code&gt; is an orphan or your live data — so it either interrogates you with a hundred yes/no dialogs or deletes quietly behind your back. An LLM is good at exactly that judgment; scripts are good at stable, auditable execution; and the approval step belongs to a human.&lt;/p&gt;

&lt;p&gt;A skill is the wiring that puts each of them where they're strongest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;For Claude Code (Trae/Cursor equivalents in the repo README):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="n"&gt;clone&lt;/span&gt; &lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;zl2237&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cleanup&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="s2"&gt;"$env:USERPROFILE\.claude\skills\system-cleanup"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart the agent and talk normally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Help me clean up my C: drive
Which environment variables point to dead paths?
This app was uninstalled — find its leftovers
What are the largest files on C:?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Repo: &lt;strong&gt;&lt;a href="https://github.com/zl2237/system-cleanup" rel="noopener noreferrer"&gt;https://github.com/zl2237/system-cleanup&lt;/a&gt;&lt;/strong&gt; (MIT). Misjudged-directory reports are the most valuable contributions.&lt;/p&gt;

&lt;p&gt;If it wins you back a few gigabytes, a ⭐ helps other "afraid to delete" people find it.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>microsoft</category>
      <category>opensource</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
