maintain

A code-quality report that identifies possible unused code and functions that are unusually long or complicated. Its findings are suggestions for a developer to judge.

In plain words
What is it for?
Find dead-code candidates, inspect references before deleting them, review complex or long functions, and record why reasonable exceptions remain.
Why use it?
It helps reduce code that is no longer needed and highlights places that may be difficult to understand or maintain.

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/azrtydxb/procoder/maintain
Clone the repo
git clone --depth 1 https://github.com/azrtydxb/procoder
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 310 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.00020 $0.00310
Opus 5 $0.00010 $0.00155
Sonnet 5 $0.00004 $0.00062
Haiku 4.5 $0.00002 $0.00031

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

Security

Grade A, and why

maintain 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 2d 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.

.kilo/commands/maintain.md · 27 lines

What it actually says

The user invoked /procoder:maintain.

The command below is the procoder binary on PATH.

  1. Run procoder index build if the index is missing or stale (stats tells you), then procoder maintain.
  2. Judge every line — nothing here blocks, everything is a candidate:
    • unused: dead-code candidates from the precise index. Exported API is marked — a library's public surface is legitimately unreferenced from inside; internal symbols with no references usually deserve deletion. Confirm with procoder index refs <symbol> before removing anything.
    • complexity / funlen: long or deeply-branched functions. Refactor the ones that are genuinely hard to follow; say why for the ones you leave (a table-driven function can be long and clear).
  3. Deletion is the best refactor: prefer removing dead code over commenting it out or keeping it "for later".
  4. The thresholds are the repo's to set: [maintain] gocyclo, funlen_lines, funlen_statements in .procoder/config.toml (defaults 15/80/50).
  5. Report to the user what you removed, what you refactored, and what you judged fine as-is.
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. 2d ago First seen · 27 lines · 20 tokens per session scan A 179a2788096d

Subscribe to this mod's changes

maintain is a command published in the GitHub repository azrtydxb/procoder (196 stars, last pushed 2d ago), licensed Apache-2.0. It adds 20 tokens to every session and 310 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-30.