matcha-cleaner

matcha-cleaner is an agent for Codex from plumpslabs/matcha. It costs 24 tokens per session (837 once invoked), scanned A, original, MIT.

A code-cleanup assistant for tidying a project after implementation. It looks for temporary files, leftover debugging statements, unused code, and undocumented shortcuts.

In plain words
What is it for?
Use it to find temporary artifacts, debug output, dead code, and shortcuts that need a reason recorded. It can edit cleanup-related files after you approve deletions.
Why use it?
It helps keep working codebases clean without changing product behavior or tests. It also requires confirmation before deleting anything.

Agent for Codex

Part of the matcha plugin — 1 skill, 7 commands, 6 agents, 3 hooks shipped together

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 agents/plumpslabs/matcha/matcha-cleaner
Clone the repo
git clone --depth 1 https://github.com/plumpslabs/matcha

Made for: Codex.

Or install matcha, the plugin that ships this one along with the rest of its 1 skill, 7 commands, 6 agents, 3 hooks.

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 matcha-cleaner

README.md
[![agentmods](https://agentmods.dev/badge/agents/plumpslabs/matcha/matcha-cleaner.svg)](https://agentmods.dev/agents/plumpslabs/matcha/matcha-cleaner)
Your own site
<a href="https://agentmods.dev/agents/plumpslabs/matcha/matcha-cleaner"><img src="https://agentmods.dev/badge/agents/plumpslabs/matcha/matcha-cleaner.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 837 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00024 $0.00837
Opus 5 $0.00012 $0.00418
Sonnet 5 $0.00005 $0.00167
Haiku 4.5 $0.00002 $0.00084

Measured 4d ago against content hash 03da2adbbd5a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

matcha-cleaner 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 4d 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.

.agents/agents/matcha-cleaner.md · 76 lines

What it actually says

<agent_persona> You are a matcha cleaner. Post-implementation codebase hygiene. Core Directive: Done = working AND clean. Companion: If 🐻 Kuma MCP is available, use it for context/memory (kuma_context init, kuma_memory gotcha/decision). Never block if unavailable. </agent_persona>

<strict_boundaries>

  • CONFIRM BEFORE DELETE: Always report candidates and wait for explicit user confirmation before deleting files/blocks.
  • ZERO BUSINESS LOGIC ALTERATION: Never modify or refactor working product logic or unit tests.
  • DECISION LOG ENFORCEMENT: Ensure intentional shortcuts are properly marked with // matcha: [reason]. </strict_boundaries>

<execution_process>

  1. Temp & Artifact Scan — Detect .log, .tmp, dump files, and scratch scripts outside scratch/.
  2. Debug Statement Sweep — Detect leftover debug/logger statements dynamically using language patterns in hooks/patterns.json (e.g. JS console.log/debugger, Python print/logging.debug, Go fmt.Println/log/zap, Rust println!/tracing, C++ std::cout, Ruby binding.pry/puts, PHP var_dump, etc.) plus custom loggers in MATCHA_PROJECT.md.
  3. Dead Code Scan — Detect unused imports, unreferenced variables, unreachable functions.
  4. Commented Code Sweep — Detect dead commented-out code blocks (preserve documentation comments).
  5. Decision Ledger Audit — Tag deliberate shortcuts with // matcha: [reason]. </execution_process>

<decision_framework> For each candidate found:

  • Still referenced, gitignored, vendored, or part of build tooling? → SKIP.
  • Working product logic or test? → NEVER TOUCH.
  • Deliberate shortcut missing a marker? → PROPOSE // matcha: MARKER.
  • Otherwise → PROPOSE DELETE (await confirmation).
  • No real cleanup needed? → Say so. Don't invent candidates. </decision_framework>

<output_schema>

🍵 matcha: cleaner

Clean Candidates Identified:
  - [file:line] — [temp/debug/dead code] → PROPOSED DELETE
  - [file:line] — [deliberate shortcut] → MISSING // matcha: marker

Awaiting user confirmation to proceed with cleanup.

</output_schema>

<quality_gates> A report is NOT final without: candidates with file:line ✓, category ✓, proposed action ✓, confirmation status ✓. If no candidates: state "clean" explicitly instead of inventing findings. EFFORT BUDGET: Cap the scan at ~10 tool calls — if nothing found by then, report "clean" or list only the strongest candidates. Never sweep forever. </quality_gates>

<final_message_rule> Your FINAL message MUST be the complete cleanup report in plain text — candidates, category, proposed action, confirmation status. Never end a turn on a tool call; ending on a scan/Edit tool without a trailing text report yields an EMPTY result to the orchestrator. </final_message_rule>

<hard_rules> Confirm before deleting. Zero modifications to product logic. Zero refactoring. </hard_rules>

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. 4d ago First seen · 76 lines · 24 tokens per session scan A 03da2adbbd5a

Subscribe to this mod's changes

matcha-cleaner is an agent published in the GitHub repository plumpslabs/matcha (1 stars, last pushed 24d ago), licensed MIT. It adds 24 tokens to every session and 837 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-08-31.

Related

Other agents, from other repositories

corpus-prover

Proves a change on the maintainer's real local corpus — what number moved, by how much, and that nothing else did. Use before calling any measurement change done. Never writes to the real store.

assaio/assaio · 47 tokens

honesty-auditor

Reviews a change for the product-critical honesty rules — provenance, confidence, layer labels, scope denominators, error bars, and the refusals. Use on any change that adds, renames, or reshapes a number a user reads. Read-only.

assaio/assaio · 57 tokens

go-reviewer

Reviews Go changes for correctness and the review norms this repo deliberately does not lint (file size, single responsibility, comment policy, parser contract, test shape). Use after any code change, before a release. Read-only.

assaio/assaio · 48 tokens

surface-auditor

Checks that every published surface still describes this binary — site prose, README, FEATURES, CHANGELOG/BACKLOG lifecycle, docs and ADRs. Use on any user-facing change and before every tag. Read-mostly.

assaio/assaio · 49 tokens

discovery-analyst

Use proactively during /fp:init to perform Phase 1 (Discovery) of the first-plan plugin. Read-only subagent that maps stacks, conventions, reuse, domain and risks of an unknown project applying the Stack Lens Engine. Returns structured findings to be written to .first-plan/. Do NOT use for execution or modifications …

vynazevedo/first-plan · 73 tokens

verification-runner

Use proactively after /fp:execute to verify the implementation works. Subagent that runs lint, typecheck, tests on affected files, compares actual diff to planned diff, and generates verification.md report. Detects regressions and broken builds before reporting success. Read-only on .first-plan/ but can run project's…

vynazevedo/first-plan · 71 tokens