cleanup

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

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/jonase47/ccpr/cleanup
Clone the repo
git clone --depth 1 https://github.com/jonase47/ccpr
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,560 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00000 $0.03560
Opus 5 $0.00000 $0.01780
Sonnet 5 $0.00000 $0.00712
Haiku 4.5 $0.00000 $0.00356

Measured yesterday against content hash 8bd16bac7354, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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 · 220 lines

How it starts

The opening of the file, as written. The whole thing — 220 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, 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 · 220 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. yesterday 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 yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,560 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.