clean

clean is a command for Claude Code from TheLobbi/claude. It costs 0 tokens per session (1,162 once invoked), scanned C, original, MIT.

A cleanup command for removing common project leftovers, including build outputs, caches, temporary files, Python artifacts, Node.js dependencies, and some unused Docker items.

In plain words
What is it for?
Use it to clean Python and Node.js projects, remove build and test caches, delete coverage files, and prune stopped Docker containers or unused images.
Why use it?
It clears files that can make a project directory or build environment unnecessarily large or cause stale results. Some removals, such as node_modules, require dependencies to be installed again.

Command for Claude Code

Part of the claude-orchestration plugin — 49 commands, 9 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/thelobbi/claude/clean
Clone the repo
git clone --depth 1 https://github.com/TheLobbi/claude

Made for: Claude Code.

Or install claude-orchestration, the plugin that ships this one along with the rest of its 49 commands, 9 agents.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,162 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01162
Opus 5 $0.00000 $0.00581
Sonnet 5 $0.00000 $0.00232
Haiku 4.5 $0.00000 $0.00116

Measured 2d ago against content hash 29303a22246d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

clean scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null
.claude/commands/clean.md · 174 lines

How it starts

The opening of the file, as written. The whole thing — 174 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Clean Project

Remove build artifacts, caches, and temporary files.

Instructions

1. Python Cleanup

```bash echo "=== Cleaning Python artifacts ==="

Remove pycache directories

find . -type d -name "pycache" -exec rm -rf {} + 2>/dev/null

Remove .pyc files

find . -type f -name "*.pyc" -delete 2>/dev/null

Remove .pyo files

find . -type f -name "*.pyo" -delete 2>/dev/null

Remove pytest cache

rm -rf .pytest_cache 2>/dev/null

Remove coverage files

rm -rf .coverage htmlcov coverage.xml 2>/dev/null

Remove mypy cache

rm -rf .mypy_cache 2>/dev/null

Remove egg-info

find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null

echo "Python cleanup complete" ```

2. Node.js Cleanup

```bash echo "=== Cleaning Node.js artifacts ==="

Remove node_modules (careful - need to reinstall)

rm -rf node_modules

Remove npm cache in project

rm -rf .npm 2>/dev/null

Remove build outputs

rm -rf dist build 2>/dev/null

echo "Node.js cleanup complete" ```

3. Docker Cleanup

```bash echo "=== Cleaning Docker artifacts ==="

Remove stopped containers

docker container prune -f 2>/dev/null || true

Remove unused images

docker image prune -f 2>/dev/null || true

Remove dangling images

docker images -f "dangling=true" -q | xargs docker rmi 2>/dev/null || true

Remove Golden Armada test images

docker images "golden-armada/*:test" -q | xargs docker rmi 2>/dev/null || true

Full cleanup (aggressive - uncomment if needed)

docker system prune -af

echo "Docker cleanup complete" ```

4. Kubernetes Cleanup

```bash echo "=== Cleaning Kubernetes test resources ==="

Remove test pods

kubectl delete pods -n agents -l app=test --ignore-not-found 2>/dev/null

Remove completed jobs

kubectl delete jobs -n agents --field-selector status.successful=1 --ignore-not-found 2>/dev/null

Remove failed pods

kubectl delete pods -n agents --field-selector status.phase=Failed --ignore-not-found 2>/dev/null

echo "Kubernetes cleanup complete" ```

Read the full file on GitHub · 174 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 174 lines · 0 tokens per session scan C 29303a22246d

Subscribe to this mod's changes

clean is a command published in the GitHub repository TheLobbi/claude (21 stars, last pushed 6d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,162 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.