cleanup-repo

cleanup-repo is a command for Claude Code from KaelSensei/MagicAIBuilder. It costs 0 tokens per session (3,233 once invoked), scanned A, original, MIT.

A guided command for reviewing and reorganizing a repository, which is the folder containing a project's code and files. It looks for scattered files, redundant material, and project rules before planning cleanup.

In plain words
What is it for?
Use /cleanup-repo to inspect the repository structure and identify or carry out organization and cleanup work.
Why use it?
It helps make a disorganized codebase easier to understand and maintain. It also reduces the risk of deleting or moving important files without checking the project context.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: installed under .agents/ (shared by several agents); mentions Cursor.

Good fit Use /cleanup-repo to inspect the repository structure and identify or carry out organization and cleanup work.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kaelsensei/magicaibuilder/cleanup-repo
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/KaelSensei/MagicAIBuilder

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-repo

README.md
[![agentmods](https://agentmods.dev/badge/commands/kaelsensei/magicaibuilder/cleanup-repo/github.svg)](https://agentmods.dev/commands/kaelsensei/magicaibuilder/cleanup-repo)
Your own site
<a href="https://agentmods.dev/commands/kaelsensei/magicaibuilder/cleanup-repo"><img src="https://agentmods.dev/badge/commands/kaelsensei/magicaibuilder/cleanup-repo/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-repo

Your own site · 80×15
<a href="https://agentmods.dev/commands/kaelsensei/magicaibuilder/cleanup-repo"><img src="https://agentmods.dev/badge/commands/kaelsensei/magicaibuilder/cleanup-repo.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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 3,233 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.00000 $0.03233
Opus 5 $0.00000 $0.01617
Sonnet 5 $0.00000 $0.00647
Haiku 4.5 $0.00000 $0.00323

Measured 11d ago against content hash 23c2bcc2f9e4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

cleanup-repo 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 11d 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.

.agents/commands/cleanup-repo.md · 430 lines

How it starts

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

Cleanup Repo Command – Repository Organization and Structure Cleanup

When /cleanup-repo is invoked, immediately execute the following steps to analyze, organize, and clean up the repository structure when files are scattered and disorganized.


Step 1: Load Project Context

  1. Assume the project root as the working directory
  2. Load and strictly follow ALL Cursor rules from .cursor/rules/*.mdc:
    • security.mdc - Security requirements
    • technical-stack.mdc - React Native/SQLite patterns
    • documentation.mdc - Documentation update requirements
    • version-management.mdc - Git commit/push workflow
    • general-principles.mdc - Project philosophy
  3. Read relevant documentation:
    • README.md
    • PROGRESS.md
    • .cursor/docs/DOCUMENTATION_STRUCTURE.md (if exists)
    • Architecture documents
  4. Identify the current Git branch and assume it is a refactor branch, not main

Step 2: Analyze Current Repository Structure

  1. Scan the entire repository to understand current organization:

    find . -type f -name "*.md" -o -name "*.json" -o -name "*.ps1" -o -name "*.js" | grep -v node_modules | grep -v .git
    
  2. Identify scattered files:

    • Documentation files in root (should be in docs/ or .cursor/docs/)
    • Script files in root (should be in scripts/ or tools/)
    • Configuration files in wrong locations
    • Test data files in root (should be in test-data/ or misc/)
    • Image/assets in wrong locations
    • Duplicate files
    • Unused files
  3. Check for organizational issues:

    • Multiple documentation files in root vs. organized folders
    • Scripts scattered vs. in a scripts/ folder
    • Test data mixed with source code
    • Configuration files not in standard locations
    • Build artifacts in wrong places
    • Temporary files that should be deleted
  4. Review recommended structure (from .cursor/docs/DOCUMENTATION_STRUCTURE.md if available):

    • Documentation should be organized in folders
    • Scripts should be in scripts/ or tools/
    • Test data should be in test-data/ or misc/
    • Assets should be in src/assets/ or appropriate folders

Read the full file on GitHub · 430 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. 11d ago First seen · 430 lines · 0 tokens per session scan A 23c2bcc2f9e4

Subscribe to this mod's changes

cleanup-repo is a command published in the GitHub repository KaelSensei/MagicAIBuilder (2 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,233 tokens. 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-08-31.