cleanup-unused-files
Skill75 starsChanged 4 months agoMITView on GitHub
Aggressively clean disk space by removing caches, build artifacts, temporary folders, tool state, and other reproducible local junk from repos and developer machines. Use when the user asks to free space, nuke caches, wipe local build output, remove stale tool directories, clear package-manager caches, reset local developer state, or do a broad cleanup of bulky unused files.
- Deletes or force-pushes
In this repository59 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/heygen-skills/CLAUDE.mdCLAUDE.md
- 1passwordSkill
- ask-curlSkill
- boardSkill
- codeflow-maintainerSkill
- codex-session-managerSkill
- coven-astraSkill
- coven-board-entrySkill
- coven-charmSkill
- coven-cloud-maintainerSkill
- coven-codySkill
- coven-echoSkill
- coven-identity-canonSkill
- coven-kittySkill
- coven-parallel-workSkill
- coven-sageSkill
- coven-task-managerSkill
- daily-dev-agenticSkill
- discrawlSkill
- disk-space-optimizerSkill
- epubSkill
- familiar-board-stewardshipSkill
- heygen-avatarSkill
- heygen-videoSkill
- heygen-skillsSkill
- higgsfield-generateSkill
- higgsfieldSkill
- linear-issue-managementSkill
- lit-ui-designerSkill
- lobsterSkill
- maintainer-barSkill
- memory-recallSkill
- memory-timeline-managerSkill
- ml-engineerSkill
- nodriverSkill
- ocrSkill
- openclaw-devSkill
- openclaw-trustSkill
- opencoven-designSkill
- OpenCoven Role Creation ProcessSkill
- pr-agentSkill
- project-managerSkill
- prompt-engineerSkill
- prompt-vaultSkill
- research-ingestionSkill
- ritual-dapp-frontendSkill
- rollcallSkill
- security-agentSkill
- skill-scannerSkill
- slidev-deck-pipelineSkill
- tauri-apple-releaseSkill
- threejs-animationSkill
- tinyfish-agent-runSkill
- tinyfish-browserSkill
- tinyfish-fetchSkill
- tinyfish-searchSkill
- tinyfishSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Prefer obvious, reproducible junk over careful semantic analysis.
- Distinctive: line 15
Prefer exact paths over broad globs.
- Distinctive: line 17
Treat anything under source directories as higher risk unless it is known build output.
- Distinctive: line 18
If the cleanup touches machine-wide tool state or login/session data, call that out clearly before running it.
- Distinctive: line 64
If the request is vague, default to an audit of likely large cache directories first.
- Distinctive: line 68
When disk recovery is the goal, focus on these before hunting tiny files:
- Distinctive: line 101
Call out that these may force reinstallation, re-downloads, reindexing, or loss of local session/tool state.
- Distinctive: line 105
Prefer short, direct commands with obvious targets.
- Distinctive: line 123
Avoid fancy one-liners if they make the blast radius less legible.
- Distinctive: line 153
When asked for a cleanup recipe, produce something like this:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cleanup Unused Files
Optimize for reclaiming disk space fast.
Prefer obvious, reproducible junk over careful semantic analysis.
Default stance
- Target caches, build output, temp folders, and local tool state first.
- Prefer exact paths over broad globs.
- Be explicit about blast radius.
- Treat anything under source directories as higher risk unless it is known build output.
- If the cleanup touches machine-wide tool state or login/session data, call that out clearly before running it.
Primary targets
Common high-yield cleanup targets include:
- project build output like
target/,dist/,.next/,coverage/,.turbo/ - package-manager caches
- SDK/tool caches
- app caches under
~/Library/Caches - stale temp folders
- old logs, dumps, and exports
- backup/swap/temp files
Examples of the user's preferred cleanup style:
rm -rf ~/.codex
rm -rf ~/Library/Caches
rm -rf ~/.rustup
rm -rf ~/.bun
rm -rf ~/.npm
rm -rf ~/.lmstudio
rm -rf src-tauri/targetAlso valid tool-native cleanup commands when they fit better:
cargo clean --manifest-path src-tauri/Cargo.toml
npm cache clean --force
brew cleanup --prune=all
rustup toolchain list | grep -v default | xargs -I{} rustup toolchain uninstall {}Workflow
1) Identify cleanup scope
Determine whether the user wants:
- project-only cleanup
- home-directory cache cleanup
- machine-wide developer reset
- maximum disk recovery regardless of re-download cost
If the request is vague, default to an audit of likely large cache directories first.
2) Prefer highest-yield directories
When disk recovery is the goal, focus on these before hunting tiny files:
~/Library/Caches~/.npm~/.bun~/.rustup~/.cargo~/.codex~/.lmstudio- repo-local
target/,dist/,.next/,coverage/ - large temp/export folders under the workspace or home directory
3) Distinguish safe nukes from state resets
Usually safe and reproducible:
- build output
- download caches
- derived data
- package caches
- logs
- temp files
Higher impact, but still valid if explicitly requested:
~/.rustup(removes installed toolchains)~/.cargo(removes installed cargo binaries, registry, and config-adjacent state)~/.codex~/.bun~/.npm~/.lmstudio- all of
~/Library/Caches
Call out that these may force reinstallation, re-downloads, reindexing, or loss of local session/tool state.
4) Execute with exact commands
Prefer short, direct commands with obvious targets.
Examples:
rm -rf ~/.codex
rm -rf ~/Library/Caches
rm -rf ~/.rustup
rm -rf ~/.bun
rm -rf ~/.npm
rm -rf ~/.lmstudio
rm -rf src-tauri/targetFor repo build cleanup, exact-path deletion is fine.
For machine-wide cleanup, group commands by tool/system and explain briefly what each group resets.
Avoid fancy one-liners if they make the blast radius less legible.
5) Summarize outcome
Report:
- what paths were removed
- which ones were skipped
- likely consequences such as re-downloads or tool re-bootstrap
- any follow-up commands the user may need
Decision rules
Delete immediately when:
- the user explicitly names the path
- the directory is clearly cache/build output/tool state
- the directory is reproducible and not the source of truth
Pause and confirm when:
- the path is broad and not explicitly requested
- the path may contain user-authored content
- the cleanup may remove credentials, custom models, local databases, or app data beyond cache
- the command would recurse through mixed-purpose directories
Preferred style
Be blunt and practical.
When asked for a cleanup recipe, produce something like this:
# Rust / Tauri build output
rm -rf src-tauri/target
# Tool and package caches
rm -rf ~/.npm
rm -rf ~/.bun
rm -rf ~/.codex
rm -rf ~/.lmstudio
# macOS app caches
rm -rf ~/Library/Caches
# Rust toolchains and state
rm -rf ~/.rustupFavor the biggest wins first.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

