cleanup

cleanup is a command for Claude Code from dork-labs/dorkos. It costs 14 tokens per session (2,740 once invoked), scanned A, original, MIT.

A command for finding and reviewing unused code, dependencies, exports, and files, while also running linting, type checks, and security checks.

In plain words
What is it for?
Use it to inspect issues, automatically fix safe ones, focus on a particular category, or perform a deeper cleanup with review prompts.
Why use it?
It helps reveal code that can be removed or problems that should be fixed during routine maintenance.

Command for Claude Code

Part of the flow plugin — 33 skills, 42 commands, 5 agents, 4 hooks, 5 plugins 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/dork-labs/dorkos/cleanup
Clone the repo
git clone --depth 1 https://github.com/dork-labs/dorkos

Made for: Claude Code.

Or install flow, the plugin that ships this one along with the rest of its 33 skills, 42 commands, 5 agents, 4 hooks, 5 plugins.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/dork-labs/dorkos/cleanup.svg)](https://agentmods.dev/commands/dork-labs/dorkos/cleanup)
Your own site
<a href="https://agentmods.dev/commands/dork-labs/dorkos/cleanup"><img src="https://agentmods.dev/badge/commands/dork-labs/dorkos/cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,740 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00014 $0.02740
Opus 5 $0.00007 $0.01370
Sonnet 5 $0.00003 $0.00548
Haiku 4.5 $0.00001 $0.00274

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

Security

Grade A, and why

cleanup 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 4d 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.

.claude/commands/app/cleanup.md · 466 lines

How it starts

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

Application Cleanup

Comprehensive codebase maintenance using Knip for dead code detection, combined with linting, type checking, and security auditing.

Arguments

Parse $ARGUMENTS for these options:

Modes (mutually exclusive, default: check)

Mode Description
check Report issues only, no changes (default)
fix Auto-fix safe issues (unused imports, exports)
deep Full cleanup with manual review prompts

Filters (combine with any mode)

Flag Effect
--deps Focus on unused dependencies only
--exports Focus on unused exports only
--files Focus on unused files only
--no-commit Skip creating cleanup commit

Examples

/app:cleanup                    # Check mode - report all issues
/app:cleanup fix                # Auto-fix safe issues
/app:cleanup deep               # Full cleanup with prompts
/app:cleanup check --deps       # Only check unused dependencies
/app:cleanup fix --exports      # Auto-fix unused exports only

Task

Execute phases based on the selected mode.


Phase 1: Pre-Cleanup Validation

Step 1.1: Verify Clean Git State

git status --porcelain

If there are uncommitted changes:

⚠️  You have uncommitted changes. Cleanup works best with a clean working directory.

Use AskUserQuestion:

  • Proceed anyway (changes will be mixed with cleanup)
  • Stop and let me commit first

Step 1.2: Run Baseline Checks

Ensure the codebase is in a working state before cleanup:

pnpm typecheck

If typecheck fails, stop and report. The codebase must compile before cleanup.


Phase 2: Dead Code Analysis (Knip)

Step 2.1: Run Knip Analysis

pnpm knip 2>&1

Step 2.2: Categorize Issues

Read the full file on GitHub · 466 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. 4d ago First seen · 466 lines · 14 tokens per session scan A 4d31167ac8cc

Subscribe to this mod's changes

cleanup is a command published in the GitHub repository dork-labs/dorkos (9 stars, last pushed today), licensed MIT. It adds 14 tokens to every session and 2,740 once invoked, about $0.0001 per session on Opus 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-08-31.