cleanup

cleanup is a command for Claude Code from jonase47/ccpr. It costs 0 tokens per session (3,603 once invoked), scanned B, original, MIT.

A command that checks and tidies project documentation. It reviews the HANDOVER inbox and runs several existing document-lint checks in one report.

In plain words
What is it for?
Run it between project phases or when documentation starts to drift. It checks HANDOVER entries, memory notes, phase documents, manuals, and overall document volume.
Why use it?
It helps keep project notes short, consistent, and readable by both people and coding agents. It also highlights stale documents and excessive documentation volume.

Command for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: reads .claude/ paths.

Good fit Run it between project phases or when documentation starts to drift. It checks HANDOVER entries, memory notes, phase documents, manuals, and overall document volume.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/jonase47/ccpr/cleanup
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/jonase47/ccpr

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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/jonase47/ccpr/cleanup"><img src="https://agentmods.dev/badge/commands/jonase47/ccpr/cleanup.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,603 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.03603
Opus 5.5 $0.00000 $0.01441
Sonnet 5.5 $0.00000 $0.00721
Haiku 4.5 $0.00000 $0.00360

Measured 26d ago against content hash 6cff04c738ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

cleanup scanned grade B with 1 finding 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 26d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

grep -m1 '^HANDOVER_WARN_PCT' ~/.claude/hooks/agent-monitor.py
commands/cleanup.md · 225 lines

How it starts

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

/cleanup – Doc Hygiene: HANDOVER cap + lint aggregator

Runs a one-shot hygiene pass on a project's docs to keep them lean and machine-readable: HANDOVER inbox triage and size cap enforcement plus the four existing lint scripts (memory-lint.sh, phase-docs-lint.sh, doc-volume-check.sh, manual-lint.sh) bundled into one consolidated drift report. Use this between phases (after a Gate) or whenever the project-guide warns about HANDOVER size, an unprocessed inbox, stale memory or doc volume drift.

Argument: $ARGUMENTS = [optional: projectdir]

  • Without argument: operates on $(pwd).
  • With argument: operates on the given project directory.

Flow

1. HANDOVER inbox triage (confirm before removing)

The HANDOVER carries an append-only inbox (## Open Points, see templates/HANDOVER_TEMPLATE.md): working agents drop findings there that fall outside their assignment, when running in the main working tree (a worktree-isolated agent reports the line in its final message instead), and this step is the one place they are cleared again.

Scan docs/HANDOVER.md for lines matching the marker pattern ^- INBOX [|] — match on the marker, not the heading, so entries appended under a differently named heading are still found.

Write the separator as the bracket expression [|], never as a bare |: bare, it is alternation in ERE (grep -E) and in GNU BRE (grep '\|'), where ^- INBOX OR empty matches every line of the file. [|] is a literal pipe in BRE, ERE and Python re alike. Reference command:

grep -c '^- INBOX [|]' docs/HANDOVER.md

It must return the same count with -E added — if the two differ, the pattern is wrong, not the file.

  • No matches → report inbox: 0 entries and continue with §2. Do not create the section: a project on an older template stays valid without it. If the ## Open Points heading is missing entirely, mention templates/HANDOVER_TEMPLATE.md once in the report — as a hint, not an action. A fresh project-init HANDOVER is expected to report 0: the template's format example lives inside the section's blockquote (> ) and therefore does not match the marker.
  • Matches → split each line on | into marker | date | source | finding | ref and present all entries as a table with one proposed target each. If a line yields more than five fields (someone wrote a literal | into the finding text), keep field 1 as the marker, fields 2–3 as date and source, the last field as ref, and re-join everything in between as the finding — the reference is always last. Never drop the surplus text and never re-cut the line in the file.

Read the full file on GitHub · 225 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. 26d ago Changed · +1 lines 6cff04c738ab
  2. 1mo ago Changed · +1 lines 34933410e1fb
  3. 1mo ago Changed 44fbc177bfd4
  4. 1mo ago Changed edd7bbef1b68
  5. 1mo ago Changed · +3 lines 1599cb9511ab
  6. 1mo ago First seen · 220 lines · 0 tokens per session scan B 8bd16bac7354

Subscribe to this mod's changes

cleanup is a command published in the GitHub repository jonase47/ccpr (1 stars, last pushed 26d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,603 tokens. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.