cleanup
Skill by udecode
Frees disk space in a project by removing unused git worktrees and Next.js cache folders. It keeps any worktree a session or running process uses, and any cache a running server holds. Built for developers with many agent worktrees.
Install cleanup
Built from the published package, never by AI.
git clone --depth 1 https://github.com/udecode/plate /tmp/plate && mkdir -p ~/.claude/skills && cp -r /tmp/plate/.agents/skills/cleanup ~/.claude/skills/cleanupRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/udecode/plate /tmp/plate && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/plate/.agents/skills/cleanup ~/.gemini/antigravity-cli/skills/cleanupAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
Cleanup frees disk space in a project by removing git worktrees and Next.js cache folders that nothing uses. It keeps every worktree that a session or process works in, and every cache a running server holds. A scan script makes each verdict, so a repeat run reaches the same result. Before a worktree is removed, its uncommitted changes that the checkout lacks are saved as a patch, and its branch stays.
The /cleanup scan command lists items and removes nothing. The /cleanup command removes the safe set, and /cleanup all applies the same checks to every checkout in a folder such as ~/git. Items that fall outside the safe rules are listed for the owner to decide. It is aimed at developers who run many agent worktrees, subagent worktrees and dev servers in a repository and want disk space back.
Written from the project's SKILL.md and checked against it.
What it can do
- /cleanup scanLists worktree and cache folders as SAFE, ASK or KEEP with sizes and reasons, and removes nothing.
- /cleanupRemoves the safe set of unused git worktrees and Next.js cache folders in the project.
- /cleanup allApplies the same checks to every checkout in a folder, such as each repository in ~/git.
- Session-aware keep rulesKeeps worktrees that a running session, process or pinned claim still uses.
- Patch saving before removalSaves uncommitted changes the checkout lacks as a patch before removing a worktree.
- Run folder cleanupExpires or strips old run folders in pstack artifacts and ignored .tmp folders.
- Owner decisions for ASK rowsLists ambiguous worktrees with path, size, reason and session title for the owner to remove or lock.
- Disk usage reportReports free space from df readings taken before and after the cleanup run.
What you need
- Git
- Node.js to run scripts/scan.mjs
- lsof for process checks
- A runtime with a session list tool, such as Claude Code desktop's list_sessions
Try asking
- Scan this project for unused git worktrees and Next.js caches
- Free disk space by removing the safe worktrees and caches
- Show what is using my disk in this checkout
Good to know
- Without a session list tool, only caches and run folders are removed.
- ASK rows need the owner to decide before removal.
- A next dev process can keep a worktree that the scan will not remove until it stops.
- The scan never runs git worktree prune or git stash.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/cleanup/SKILL.md, .agents/skills/cleanup/scripts/scan.mjs, .agents/skills/cleanup/scripts/scan.test.mjs. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md11 KB -
scripts/scan.mjs43 KB -
scripts/scan.test.mjs32 KB
Alternatives to cleanup
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
cleanup: common questions
Does the cleanup delete my uncommitted changes?
No. Uncommitted changes the checkout lacks are saved as a patch under the repository's git folder before the worktree is removed. The branch stays.
Can I preview what will be removed before running it?
Yes. The /cleanup scan command lists and removes nothing, and shows each row as SAFE, ASK or KEEP with its reason.
Will it remove a worktree a running session is using?
No. Worktrees that a running session, shell or dev server works in are marked KEEP and stay.
How do I install cleanup?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is cleanup free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is cleanup safe to use?
It scores 84 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to cleanup?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
