clean

clean is a skill for Claude Code from Rockielab/rockie-claude. It costs 114 tokens per session (1,216 once invoked), scanned A, original, Apache-2.0.

A pre-commit review skill for finding code and documentation problems in changed files before they are committed to Git.

In plain words
What is it for?
Use it to audit staged files or all dirty files and report blockers, warnings, and informational findings before a commit.
Why use it?
It catches issues such as debug leftovers, unused imports, stale documentation claims, broken internal links, and unwanted new Markdown files.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code.

Part of the rockie-claude plugin — 29 skills, 1 MCP server shipped together

Good fit Use it to audit staged files or all dirty files and report blockers, warnings, and informational findings before a commit.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rockielab/rockie-claude/clean
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 Rockielab/rockie-claude --skill clean
Clone the repo
git clone --depth 1 https://github.com/Rockielab/rockie-claude

Made for: Claude Code.

Or install rockie-claude, the plugin that ships this one along with the rest of its 29 skills, 1 MCP server.

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 clean

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/rockielab/rockie-claude/clean"><img src="https://agentmods.dev/badge/skills/rockielab/rockie-claude/clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,216 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.00114 $0.01216
Opus 5 $0.00057 $0.00608
Sonnet 5 $0.00023 $0.00243
Haiku 4.5 $0.00011 $0.00122

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

Security

Grade A, and why

clean 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 10d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (audit.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • clean — 92% identical, 17 lines differ
project-harness/skills/clean/SKILL.md · 106 lines

How it starts

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

/clean — Pre-commit audit adapted for a research repo

Research repos are typically majority prose — scripts, experiment dirs, and many .md docs read by humans AND future agents. Slop in either kind hurts. The audit covers both.

When to run

  • Before EVERY git commit. The pre-commit-gate hook will block if the sentinel hash doesn't match current staged state.
  • When the user asks to commit.
  • When the hook emits a block message.

What the skill does

  1. Runs ${OPENCLAW_SKILLS_DIR}/clean/audit.py. Arguments:
    • --scope staged (default) — audits files in git diff --cached --name-only
    • --scope dirty — audits all modified + untracked non-gitignored files
  2. The audit reports findings in three buckets:
    • Blockers — must fix before commit (new .md files created during cleanup runs, broken internal doc links, obvious debug artifacts, syntax errors)
    • Warnings — should review (TODO markers pointing to resolved work, duplicate content across docs, rules contradicting ${OPENCLAW_WORKSPACE_DIR}/memory/workflow.db)
    • Info — worth knowing (file size growth, complexity spikes)
  3. If zero blockers: the audit invokes ${OPENCLAW_WORKSPACE_DIR}/scripts/clean-finalize.sh <hash> as its final action. That script writes ${OPENCLAW_WORKSPACE_DIR}/.state/clean-ok-<hash> (where <hash> is computed by ${OPENCLAW_WORKSPACE_DIR}/scripts/compute_clean_hash.sh) AND emits the upstream-contribute nudge to stderr. The pre-commit-gate hook recomputes the same hash and requires the sentinel to exist.
  4. If blockers exist: the skill reports them and does NOT call clean-finalize.sh, so no sentinel and no nudge. Agent fixes, reruns.

Hard rules for this repo specifically

  • NEVER create new .md files during cleanup. Consolidate into existing ones. Exception: a user explicitly says "write a new doc for X."
  • NEVER auto-fix documentation. Flag it, let agent or user decide.
  • NEVER audit the whole codebase. Only changed files. Existing slop elsewhere is not this commit's problem.
  • Thresholds apply to NEW code only: Python funcs ≤ 80 lines, cyclomatic complexity ≤ 8. Existing violations are noise.
  • Degrade gracefully: if ruff / shellcheck / code-simplifier isn't installed, skip that check with a note. Don't block.

Read the full file on GitHub · 106 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 106 lines · 114 tokens per session scan A 4d447c01eaf5

Subscribe to this mod's changes

clean is a skill published in the GitHub repository Rockielab/rockie-claude (21 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 114 tokens to every session and 1,216 once invoked, about $0.0006 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-30.