cleanup-audit

cleanup-audit is a skill for Claude Code, Codex from jmagly/aiwg. It costs 21 tokens per session (2,991 once invoked), scanned A, original, MIT.

A codebase audit that finds unused JavaScript or TypeScript exports, unreferenced source files, unused npm dependencies, and manifest entries pointing to missing files. It labels each finding by confidence.

In plain words
What is it for?
Use it to inspect the whole repository or a selected folder, or to audit only exports, files, dependencies, or manifest entries.
Why use it?
It helps you remove accumulated clutter without treating uncertain findings as safe deletions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to inspect the whole repository or a selected folder, or to audit only exports, files, dependencies, or manifest entries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jmagly/aiwg/cleanup-audit
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.

Any agent
npx skills add jmagly/aiwg --skill cleanup-audit
Clone the repo
git clone --depth 1 https://github.com/jmagly/aiwg

Made for: Claude Code, Codex.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/jmagly/aiwg/cleanup-audit"><img src="https://agentmods.dev/badge/skills/jmagly/aiwg/cleanup-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,991 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 69
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
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.00021 $0.02991
Opus 5 $0.00010 $0.01496
Sonnet 5 $0.00004 $0.00598
Haiku 4.5 $0.00002 $0.00299

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

Security

Grade A, and why

cleanup-audit 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 5d 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.

agentic/code/addons/aiwg-utils/skills/cleanup-audit/SKILL.md · 367 lines

How it starts

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

Cleanup Audit

Audits the codebase for accumulated dead weight: unused TypeScript/JS exports, orphaned source files, npm dependencies that are declared but never imported, and manifest entries that point to files that do not exist. Every finding carries a confidence rating. Only HIGH confidence findings are safe to auto-fix.

Natural Language Triggers

Users may say:

  • "cleanup audit"
  • "dead code audit"
  • "find dead code"
  • "orphan files"
  • "unused exports"
  • "cleanup analysis"
  • "find unused dependencies"
  • "stale manifest entries"
  • "what can I delete"
  • "codebase cleanup"

Parameters

--scope <path>

Restrict analysis to a subtree. Default is the full repository root.

aiwg cleanup-audit --scope src/cli/
aiwg cleanup-audit --scope agentic/code/addons/

--type <exports|files|deps|manifests>

Run only the specified audit type. Omit to run all four.

Value Audits
exports TypeScript/JS exports with no importers
files Source files not referenced by any import or manifest
deps npm dependencies declared in package.json but not used in code
manifests Manifest entries (skills, agents) whose source file does not exist

Multiple types can be combined:

aiwg cleanup-audit --type exports --type deps

--json

Emit findings as newline-delimited JSON to stdout instead of the formatted report. Useful for piping into other tools or CI scripts.

aiwg cleanup-audit --json | jq 'select(.confidence == "HIGH")'

--fix

Auto-apply removals for all HIGH confidence findings. Has no effect without confirmation when any HIGH finding involves a non-trivial deletion (more than 10 lines or a full file). Combine with --dry-run to preview what --fix would remove.

--dry-run

Show what --fix would remove without writing any changes. If used without --fix, behaves as the default read-only audit.

Execution Flow

Phase 1: Determine Analysis Scope

  1. Parse --scope — default to repo root
  2. Parse --type — default to all four types
  3. Parse --json, --fix, --dry-run flags
  4. Build file inventory for the scope:
    • All .ts, .tsx, .js, .mjs files (for exports and files audits)
    • package.json (for deps audit)
    • All manifest.json files under agentic/ (for manifests audit)
  5. Communicate scope before analysis begins

Read the full file on GitHub · 367 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. 5d ago First seen · 367 lines · 21 tokens per session scan A 2b46e84fecd9

Subscribe to this mod's changes

cleanup-audit is a skill published in the GitHub repository jmagly/aiwg (210 stars, last pushed today), licensed MIT. It adds 21 tokens to every session and 2,991 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-09-03.

Related

Other skills, from other repositories

coding-standards

Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development. Use when writing any code to ensure consistent quality.

Wania-Kazmi/claude-code-autonomous-agent-workflow · 38 tokens

insecure-defaults

Detects fail-open insecure defaults (hardcoded secrets, weak auth, permissive security) that allow apps to run insecurely in production. Use when auditing security, reviewing config management, or analyzing environment variable handling.

waybarrios/opencode-power-pack · 48 tokens

ln-71-system-design-baseline-builder

Creates architecture-driving requirements and constraints before design. Not for target design, plan review, or implementation audits.

levnikolaevich/claude-code-skills · 30 tokens

ai-slop

Operational rubric that turns "don't make AI slop" into observable properties, severity levels, evidence requirements, and repair actions for interface design. Use as the reference rubric when building or reviewing marketing sites, product interfaces, dashboards, portfolios, or e-commerce pages, especially alongside…

waybarrios/opencode-power-pack · 61 tokens

spawn-reviewers

Spawn and collect the reviewer fleet at stage20spawnreviewers. Consumes spawn.json.spec (the authoritative spawn spec from derive-spawn-spec / derive-static-spec), resolves GRAPHPROJECT, builds per-agent prompts from the per-agent template + role suffixes (Bug Hunter A/B, Unified Auditor, Domain Critics, Impact…

closedloop-ai/claude-plugins · 182 tokens

huggingface-spaces

Build, deploy, debug, or maintain a Hugging Face Space using Gradio, Docker, or Static SDKs. Use for general Space hosting and configuration; use huggingface-zerogpu for ZeroGPU runtime constraints and lora-space-builder for LoRA demos.

waybarrios/opencode-power-pack · 60 tokens