SkillsReviewed · davepoon

Cleanup from buildwithclaude

Cleanup is a disk-cleaning skill for developers using AI coding agents, but its default scan extends beyond the current repository and approved deletions can be permanent. Its Python script inventories Git worktrees, branches, build artifacts, caches, agent logs and trash, then applies selected items from a saved plan.

Researched 16 Nov 2026

In short.

Cleanup is a storage-maintenance skill for developers with AI coding clutter, but its broad default scope and partial change checks require careful review before deletion. It combines assistant instructions with a Python command-line script that classifies candidates, saves a numbered plan and rechecks selected items before acting. The instructions require confirmation, while the command-line implementation has no interactive approval prompt. Runtime reliability, compatibility and actual space recovery are unverified.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage is limited to plugins/all-skills/skills/cleanup at revision 3c9a725a1c4e41f80e224e1d4e5940f402d9bbda: SKILL.md, scripts/agent_cleanup.py and the folder's LICENSE, together with the repository-level LICENSE. Other skills, repository components, external documentation and later revisions are excluded. The supplied files support source-level descriptions; execution, assistant integration, compatibility, deletion outcomes and actual reclaimed space remain unverified.

The overview

identity

Cleanup is the skill folder plugins/all-skills/skills/cleanup in davepoon/buildwithclaude. It contains assistant instructions, a Python implementation and a local MIT licence. The script identifies itself as agent-cleanup version 1.0.0.

The specific source revision is available at [https://github.com/davepoon/buildwithclaude/tree/3c9a725a1c4e41f80e224e1d4e5940f402d9bbda/plugins/all-skills/skills/cleanup]. The surrounding repository and its other skills are outside this resource's scope.

assessment

The useful feature is a combined inventory of clutter that otherwise requires several separate tools: abandoned checkouts, merged branches, dependency folders, package caches and agent transcripts. Numbered candidates and explanations make the proposed cleanup easier to review.

It is best suited to supervised maintenance of development machines. The instructions promise to skip anything changed since scanning, but the implementation uses partial fingerprints that cannot detect every change. Its REMOVE label expresses a classification rule, not a guarantee that deletion is harmless.

users

The intended users are developers whose coding agents leave multiple Git worktrees and storage-heavy project folders. A worktree is another checkout of a repository, often used to let an agent work separately. Built-in discovery paths cover Codex, Cursor, Conductor and Vibe Kanban, plus worktrees registered inside repositories.

The script also targets selected data directories for Claude Code, Codex, Gemini CLI and OpenCode. Beginners need to understand the difference between a rebuildable dependency folder and unique work before approving removal. Shared-repository users also need to understand that remote deletion affects branches on origin.

capabilities

Candidates are classified as REMOVE, NEEDS-DECISION, KEEP-ACTIVE or SKIP. Git checks consider merge status, pull requests, uncommitted paths, ignored files, branch age, locks, rebases and visible process working directories. Optional remote candidates are limited to origin branches associated with qualifying local candidates.

Storage targets include dependency and build folders, archives, backups, package caches, Docker build cache, old agent files and trash. The --only option selects git, artifacts, archives, caches, agents or trash; repeatable --root options add project locations.

Defaults are 14 days for stale projects, 30 days for retained agent files, a 20 MiB minimum storage-item size and discovery depth 3 under project roots. These are configurable thresholds, not measured recommendations.

Using it

requirements

The script declares Python 3.9 or newer, uses Python's standard library and requires Git. GitHub CLI is optional for pull-request metadata. Without usable gh results, classification proceeds without that information.

Relevant package-manager, Docker or Homebrew commands must be installed for their corresponding cleanup operations. Process discovery uses /proc where available and otherwise attempts lsof. Windows compatibility and specific supported operating-system versions are not established.

Git merge-tree --write-tree supports content-based merge detection; the implementation falls back to ancestry checking when that operation is unavailable or otherwise fails outside a reported merge conflict. Equivalent detection across Git versions is unverified.

mechanism

The assistant instructions describe choosing a scope, scanning, obtaining approval and applying exactly the selected IDs. The script saves its latest numbered plan under XDG_STATE_HOME/agent-cleanup/plan.json, defaulting to ~/.local/state/agent-cleanup/plan.json.

Apply rejects plans older than 24 hours, derives fresh candidate states and compares classifications and fingerprints before acting. Protected classes are refused. Remote deletion additionally requires --remote and uses a force-with-lease condition tied to the recorded remote tip. Unreferenced detached worktree heads receive a rescue reference before removal.

Scanning performs no cleanup deletions, but it writes the plan. Adding --fetch updates and prunes remote-tracking references, and content-merge checks can write Git objects. Non-preview application results are appended to history.jsonl in the same state directory.

setup

Obtain the pinned skill folder with SKILL.md, scripts/agent_cleanup.py and its licence, retaining the relative directory layout. The supplied files do not establish a marketplace installation command or supported assistant versions.

An illustrative Git-only inventory command is python3 plugins/all-skills/skills/cleanup/scripts/agent_cleanup.py scan --repo /path/to/repo --only git --all. Replace the repository path with the intended location. The --all flag displays protected items too. This command was not executed.

Even with --repo, the script also discovers repositories under its built-in agent worktree roots. The --only flag limits categories, not that discovery scope. Omitting --fetch avoids its reference updates but can leave classification dependent on stale remote-tracking information.

example

Hypothetically, a scan might identify item 7 as a merged worktree. After reviewing its path and explanation, preview its operation with python3 plugins/all-skills/skills/cleanup/scripts/agent_cleanup.py apply 7 --dry-run. Actual removal would use the same command without --dry-run after approval.

The number is illustrative; IDs belong to the latest saved plan and a later scan replaces that plan. No example output, successful deletion or reclaimed-space result is established.

Assessment & evidence

limitations

The default repository scan also considers known agent worktree roots, user-wide package caches, agent logs and trash. There is no shown switch that disables the built-in agent roots. Homebrew cleanup additionally removes outdated formula versions.

Change detection is incomplete. Git fingerprints compare HEAD and counts of dirty and retained ignored paths, so changed contents can escape detection when those counts stay constant. Archive fingerprints use the newest timestamp and entry count. Artifact fingerprints track project activity outside artifact directories, rather than hashing their contents. Rechecks are collected before the application loop, leaving a further window for changes.

Process protection checks working directories, not every open file or background activity. Cache and agent-data items do not receive content fingerprints; their cleanup commands or age rules are reapplied. The command-line interface does not request interactive confirmation, and selected local branches are deleted with git branch -D.

Archives, logs and trash have no supplied recovery mechanism. Reported reclaimed space is approximate; the agent-data calculation can undercount because it subtracts the remaining whole-directory size from an estimate covering only eligible old files. These are implementation observations, not reproduced runtime results.

reasoning

The cleanup decisions are deterministic Python rules. The assistant interprets the user's scope and obtains approval; the script supplies classification and deletion behavior. Git content comparisons help identify work already incorporated through squash or rebase merges, while age helps distinguish recent activity from older candidates.

The implementation treats folders such as node_modules as rebuildable, but puts build, dist and Python virtual environments into NEEDS-DECISION because they may contain releases, exports or manually installed packages. That distinction is useful, although folder names and timestamps cannot establish how valuable their contents are to a particular developer.

alternatives

For a narrower task, the underlying operations can be handled individually: Git worktree listing and removal for checkouts, or package-manager cache commands such as pnpm store prune and uv cache prune. This gives more direct control over scope but requires reviewing each tool's behavior separately.

For recurring log growth, the skill points to retention settings including Claude Code's cleanupPeriodDays and Gemini CLI's general.sessionRetention. Their current behavior is not independently established by the supplied files. No competing cleanup product or comparative performance result is assessed.

evidence

The available source consists of the complete supplied SKILL.md, Python script, skill-folder MIT notice and repository-level MIT notice. The instructions describe the intended interaction; the script establishes the visible options, classification rules and deletion paths.

The original instruction file is at [https://raw.githubusercontent.com/davepoon/buildwithclaude/3c9a725a1c4e41f80e224e1d4e5940f402d9bbda/plugins/all-skills/skills/cleanup/SKILL.md]. The original implementation is at [https://raw.githubusercontent.com/davepoon/buildwithclaude/3c9a725a1c4e41f80e224e1d4e5940f402d9bbda/plugins/all-skills/skills/cleanup/scripts/agent_cleanup.py].

Nothing was executed. No runtime tests, cross-platform results, recovery exercises or measured cleanup outcomes are supplied, so those behaviors remain unverified.

Access & freshness

costs

The captured files provide no price, subscription or paid-support terms. The script contains no model API calls; its visible work uses local files and command-line tools, with optional Git and GitHub network operations.

Host-assistant charges, support costs and actual compute or bandwidth costs are unknown. Removing caches and build artifacts can require downloads, installation or rebuilding later. No measured financial savings or space-recovery benchmark is supplied.

rights

The skill-folder MIT notice credits LuchasArie, copyright 2026. The repository-level MIT notice credits davepoon, copyright 2025. Both permit use, modification, redistribution, sublicensing and sale, subject to retaining the copyright and permission notices in copies or substantial portions.

Both notices disclaim warranties and liability. Preserve the applicable notices when redistributing the captured skill or script; permission to redistribute does not establish operational safety.

freshness

The supplied capture is dated 2026-11-16T18:49:42.252Z and pins revision 3c9a725a1c4e41f80e224e1d4e5940f402d9bbda. The script's internal version is 1.0.0. The capture date does not establish a release date.

Changes after that revision, current agent directory layouts, retention settings and compatibility with later external tools are unknown. The repository's main branch may differ from the pinned files.

actions

Start with the needed categories and inspect every proposed repository, path and uniqueness note. Use explicit item IDs and --dry-run to preview the intended operations. Keep recoverable copies of unique work before approving destructive items.

Use --recommended only after reviewing and approving every applicable REMOVE item. Remote deletion needs separate approval and --remote; --force should be reserved for worktrees whose uncommitted changes can knowingly be lost. The CLI itself does not collect those approvals.

Rescan and review again after the 24-hour plan limit or relevant filesystem changes. Read each result line for skipped, refused or failed items. Treat estimated space recovery as approximate.

Evidence for this report

LICENSEnotice · checked 2026-11-16
plugins/all-skills/skills/cleanup/LICENSEnotice · checked 2026-11-16
plugins/all-skills/skills/cleanup/SKILL.mdselected · checked 2026-11-16