/clean-targets
Reclaim disk space by deleting cargo target/ build directories across the main checkout and every git worktree of this repo. Use whenever the user wants to clean up build artifacts, free disk space, run "cargo clean" everywhere, prune worktree build caches, or complains that the
$ npx -y skills add socai-io/socai --skill clean-targets --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/clean-targets
Context preview
The summary Claude sees to decide when to auto-load this skill.
Reclaim disk space by deleting cargo target/ build directories across the main checkout and every git worktree of this repo. Use whenever the user wants to clean up build artifacts, free disk space, run "cargo clean" everywhere, prune worktree build caches, or complains that the
SKILL.md
clean-targets.SKILL.mdname: clean-targets
description: Reclaim disk space by deleting cargo target/ build directories across the main checkout and every git worktree of this repo. Use whenever the user wants to clean up build artifacts, free disk space, run "cargo clean" everywhere, prune worktree build caches, or complains that the repo or its worktrees are eating gigabytes of disk. Safely skips any target dir that a running build or dev session (cargo, rustc, tauri dev) is using.
clean-targets
Delete cargo `target/` directories across every checkout of this repo — the main checkout and all git worktrees — in one pass. Deleting `target/` is exactly what `cargo clean` does; the difference is this covers every checkout at once and refuses to touch a target that a live build is writing to.
How to run
From anywhere inside any checkout of the repo:
bash "$(git rev-parse --show-toplevel)/.claude/skills/clean-targets/scripts/clean-targets.sh" --dry-run
Run with `--dry-run` first and show the user what would be deleted and what is being kept (and why). If the plan looks as expected, run it again without the flag to actually delete. Report the total freed at the end, plus current free disk (`df -h /`).
What the script does
- Discovers all checkouts with `git worktree list --porcelain` — nothing is
hardcoded, so it works on any machine and any worktree layout.
- Detects target dirs by cargo's `CACHEDIR.TAG` marker file, not by directory
name, so unrelated directories that happen to be called `target` are never touched.
- Skips any target whose path appears in a running process's command line
(active `rustc`/`cargo` compile, a dev binary running out of `target/debug`, a `tauri dev` session). Tell the user which ones were kept and that they can re-run after stopping those sessions.
Notes
- A skipped "in use" target usually means an active `pnpm exec tauri dev` in
that worktree. Never work around the skip by killing the process yourself — surface it and let the user decide.
- Everything deleted is a rebuildable cache; the next `cargo build` in that
checkout just starts cold. No source files, git state, or `node_modules` are touched.
Read more
name: clean-targets description: Reclaim disk space by deleting cargo target/ build directories across the main checkout and every git worktree of this repo. Use whenever the user wants to clean up build artifacts, free disk space, run "cargo clean" everywhere, prune worktree build caches, or complains that the repo or its worktrees are eating gigabytes of disk. Safely skips any target dir that a running build or dev session (cargo, rustc, tauri dev) is using.
clean-targets
Delete cargo `target/` directories across every checkout of this repo — the main checkout and all git worktrees — in one pass. Deleting `target/` is exactly what `cargo clean` does; the difference is this covers every checkout at once and refuses to touch a target that a live build is writing to.
How to run
From anywhere inside any checkout of the repo:
bash "$(git rev-parse --show-toplevel)/.claude/skills/clean-targets/scripts/clean-targets.sh" --dry-run
Run with `--dry-run` first and show the user what would be deleted and what is being kept (and why). If the plan looks as expected, run it again without the flag to actually delete. Report the total freed at the end, plus current free disk (`df -h /`).
What the script does
- Discovers all checkouts with `git worktree list --porcelain` — nothing is
hardcoded, so it works on any machine and any worktree layout.
- Detects target dirs by cargo's `CACHEDIR.TAG` marker file, not by directory
name, so unrelated directories that happen to be called `target` are never touched.
- Skips any target whose path appears in a running process's command line
(active `rustc`/`cargo` compile, a dev binary running out of `target/debug`, a `tauri dev` session). Tell the user which ones were kept and that they can re-run after stopping those sessions.
Notes
- A skipped "in use" target usually means an active `pnpm exec tauri dev` in
that worktree. Never work around the skip by killing the process yourself — surface it and let the user decide.
- Everything deleted is a rebuildable cache; the next `cargo build` in that
checkout just starts cold. No source files, git state, or `node_modules` are touched.
Agent that actually understands social platforms. Fast. Precise. Deep.

