clean

clean is a skill for Claude Code, Codex from Rockielab/rockie-codex. It costs 114 tokens per session (1,246 once invoked), scanned A, a copy of clean, Apache-2.0.

A pre-commit audit for code and documentation in a research repository. A commit is the saved change set recorded in Git.

In plain words
What is it for?
Use it before every Git commit, or after a commit hook blocks the commit, to audit staged files or the wider set of modified files.
Why use it?
It catches debug leftovers, unused code, stale claims, broken internal links, and other issues before changes are committed.

Skill for Claude CodeCodex

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 skills/rockielab/rockie-codex/clean
Any agent
npx skills add Rockielab/rockie-codex --skill clean
Clone the repo
git clone --depth 1 https://github.com/Rockielab/rockie-codex

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 clean

README.md
[![agentmods](https://agentmods.dev/badge/skills/rockielab/rockie-codex/clean.svg)](https://agentmods.dev/skills/rockielab/rockie-codex/clean)
Your own site
<a href="https://agentmods.dev/skills/rockielab/rockie-codex/clean"><img src="https://agentmods.dev/badge/skills/rockielab/rockie-codex/clean.svg" alt="Measured on agentmods" 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,246 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 92% copy Near-identical to another mod 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.01246
Opus 5 $0.00057 $0.00623
Sonnet 5 $0.00023 $0.00249
Haiku 4.5 $0.00011 $0.00125

Measured 5d ago against content hash a122b4c6d96a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 5d 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

This is a copy

92% identical to clean — 17 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

project-extension/agents/skills/clean/SKILL.md · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 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 · 109 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. 5d ago First seen · 109 lines · 114 tokens per session scan A a122b4c6d96a

Subscribe to this mod's changes

clean is a skill published in the GitHub repository Rockielab/rockie-codex (20 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 114 tokens to every session and 1,246 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to clean, differing in 17 lines, and is treated as a copy.