Skip to content
SEO
Skill

/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

BOOST
From plugin
socai
24710 skills1 agent
Install
$ npx -y skills add socai-io/socai --skill clean-targets --agent claude-code

How 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.md
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.

Read more
Ships withsocai

Agent that actually understands social platforms. Fast. Precise. Deep.

Get the whole plugin

Other skills on socai.

socai-model-sync
Skill

socai-model-sync

Refresh, inspect, and validate socai's generated desktop/CLI LLM model catalog. Use when adding or updating model versions such…

@socai-io@socai-ioInstall Skill
socai-release
Skill

socai-release

Create, monitor, troubleshoot, and verify socai desktop GitHub releases from the command line with gh. Use when publishing a new…

@socai-io@socai-ioInstall Skill
socai-site-deployment
Skill

socai-site-deployment

Deploy, configure, troubleshoot, and verify the socai marketing/download website on Vercel. Use for socai.io deployments, Vercel…

@socai-io@socai-ioInstall Skill
research
Skill

research

Explore social-platform topics and discover people, projects and adjacent leads; retain a broad map, selective depth and durable…

@socai-io@socai-ioInstall Skill
self-healing
Skill

self-healing

Diagnose failed or incomplete agent actions, apply the smallest safe recovery, verify the result, and retain only reusable…

@socai-io@socai-ioInstall Skill
vc-research
Skill

vc-research

Find startup opportunities, connect people and projects, and prepare focused VC follow-ups without turning discovery into…

@socai-io@socai-ioInstall Skill