cleanup-artifacts

cleanup-artifacts is a command for Claude Code from MadAppGang/claude-code. It costs 17 tokens per session (1,704 once invoked), scanned A, original, MIT.

A project-cleanup command that finds temporary files, development leftovers, build outputs, logs, and other artifacts while protecting implementation code and documentation.

In plain words
What is it for?
Use it to inspect project changes and clean test files, temporary documents, development scripts, build artifacts, coverage reports, logs, and editor files.
Why use it?
It helps remove clutter that can confuse development, version control, or deployment without requiring you to identify every leftover file yourself.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Good fit Use it to inspect project changes and clean test files, temporary documents, development scripts, build artifacts, coverage reports, logs, and editor files.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/madappgang/claude-code/cleanup-artifacts
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.

Clone the repo
git clone --depth 1 https://github.com/MadAppGang/claude-code

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cleanup-artifacts

README.md
[![agentmods](https://agentmods.dev/badge/commands/madappgang/claude-code/cleanup-artifacts/github.svg)](https://agentmods.dev/commands/madappgang/claude-code/cleanup-artifacts)
Your own site
<a href="https://agentmods.dev/commands/madappgang/claude-code/cleanup-artifacts"><img src="https://agentmods.dev/badge/commands/madappgang/claude-code/cleanup-artifacts/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cleanup-artifacts

Your own site · 80×15
<a href="https://agentmods.dev/commands/madappgang/claude-code/cleanup-artifacts"><img src="https://agentmods.dev/badge/commands/madappgang/claude-code/cleanup-artifacts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 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,704 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00017 $0.01704
Opus 5.5 $0.00007 $0.00682
Sonnet 5.5 $0.00003 $0.00341
Haiku 4.5 $0.00002 $0.00170

Measured 1mo ago against content hash a7b0f4414a75, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cleanup-artifacts scanned grade A with 0 findings 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 1mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/frontend/commands/cleanup-artifacts.md · 221 lines

How it starts

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

Mission

Analyze the current project state, identify temporary artifacts and development files, then run the cleaner agent to clean them up safely while preserving important implementation code and documentation.

Workflow

STEP 1: Analyze Current Project State

  1. Gather Project Context:

    • Run git status to see current state
    • Run git diff --stat to see what's been modified
    • Use Glob to find common artifact patterns:
      • Test files: **/*.test.{ts,tsx,js,jsx}
      • Spec files: **/*.spec.{ts,tsx,js,jsx}
      • Temporary documentation: AI-DOCS/**/*-TEMP.md, AI-DOCS/**/*-WIP.md
      • Development scripts: scripts/dev-*.{ts,js}, scripts/temp-*.{ts,js}
      • Build artifacts: dist/**/*, build/**/*, .cache/**/*
      • Coverage reports: coverage/**/*
      • Log files: **/*.log, **/*.log.*
      • Editor files: **/.DS_Store, **/*.swp, **/*.swo
  2. Identify Current Task:

    • Check for AI-DOCS/ folder to understand recent work
    • Look for recent commits to understand context
    • Analyze modified files to determine what's being worked on
  3. Categorize Files:

    • Artifacts to Clean: Temporary files that can be safely removed
    • Files to Preserve: Implementation code, final tests, user-facing docs, configs
    • Uncertain Files: Files that might need user input

STEP 2: Present Findings to User

Present a clear summary:

# Cleanup Analysis

## Current Project State
- Git Status: [clean/modified/staged]
- Recent Work: [description based on git log and AI-DOCS]
- Modified Files: [count and summary]

## Artifacts Found

### Will Clean (if approved):
- Temporary test files: [count] files
- Development artifacts: [count] files
- Intermediate documentation: [count] files
- Build artifacts: [count] files
- [Other categories found]

### Will Preserve:
- Implementation code: [list key files]
- Final tests: [list]
- User-facing documentation: [list]
- Configuration files: [list]

### Uncertain (need your input):
- [List any files where classification is unclear]

Read the full file on GitHub · 221 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. 1mo ago First seen · 221 lines · 17 tokens per session scan A a7b0f4414a75

Subscribe to this mod's changes

cleanup-artifacts is a command published in the GitHub repository MadAppGang/claude-code (285 stars, last pushed 7mo ago), licensed MIT. It adds 17 tokens to every session and 1,704 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.