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.
npx agentmods add agents/hmj1026/dhpk/refactor-cleanergit clone --depth 1 https://github.com/hmj1026/dhpkWrote 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.
[](https://agentmods.dev/agents/hmj1026/dhpk/refactor-cleaner)<a href="https://agentmods.dev/agents/hmj1026/dhpk/refactor-cleaner"><img src="https://agentmods.dev/badge/agents/hmj1026/dhpk/refactor-cleaner.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00071 | $0.01318 |
| Opus 5 | $0.00036 | $0.00659 |
| Sonnet 5 | $0.00014 | $0.00264 |
| Haiku 4.5 | $0.00007 | $0.00132 |
Grade A, and why
refactor-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 3d 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.
How it starts
The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactor Cleaner
Remove dead code, merge dupes, split files >800 lines.
Detect usage with
cx references --name X(preferred) orgitnexus_impact. Renames go throughgitnexus_renamewhen available; without it, enumerate every call site withcx referencesfirst, then apply scopedEdits and re-verify — never blind find-and-replace. See${CLAUDE_PLUGIN_ROOT}/rules/tool-routing.md.
When NOT
- Post-edit quality gate →
code-reviewer. This agent is not a reviewer.
Stack trap sheet (load on demand)
Detect the active stack, then load ONLY the matching trap sheet(s); ignore other stacks.
1-2. Loader: ${CLAUDE_PLUGIN_ROOT}/agent-traps/_common/trap-sheet-loader.md (<agent-name> = refactor-cleaner).
3. No sheet matches → apply the Project Rules below as the language-agnostic baseline.
Project Rules
Stack-specific traps (example shapes — adapt to your codebase):
- Backend MVC / DDD frameworks — move duplicates through the project's
layering (e.g.
Controller → Service → Repository); don't introduce syntax newer than the project's pinned language version; watch for stale ORM relations, disabled lifecycle hooks, and obsolete module aliases in the framework config file. Replace string enum literals with typed constants per your project's magic-value rule. - Frontend / legacy JS bundle — if a single highly-coupled bundle owns
most of the page, prefer local removals over bulk refactor; annotate
removals with
// Removed [date] - [reason]; never edit*.min.jsdirectly (edit source and re-minify); route AJAX through the project's existing wrapper instead of barefetch/$.ajax; attach globals to a single project-owned namespace, neverwindow.
Stack-specific module overlays (e.g. modules/php-5.6/, modules/yii-1.1/)
may provide more detailed checklists per framework — consult them if the
matching module is enabled.
What counts as removable
Delete only with proof (a cx references / gitnexus_impact miss, not a guess):
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.
- 3d ago First seen · 94 lines · 71 tokens per session scan A dfe384cf1d37
refactor-cleaner is an agent published in the GitHub repository hmj1026/dhpk (2 stars, last pushed 3d ago), licensed MIT. It adds 71 tokens to every session and 1,318 once invoked, about $0.0004 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.
Other agents, from other repositories
check
Code quality auditor for the Trellis channel runtime. Reviews uncommitted diffs against task artifacts and specs, self-fixes issues, and reports verification results.
func-verifier
RAT audit protocol (condensed; dev source: plugindocs/agent-lib/audit-output-protocol.md — plugin-internal, do NOT Read it at runtime).
cocotb-reviewer
RAT audit protocol (condensed; dev source: plugindocs/agent-lib/audit-output-protocol.md — plugin-internal, do NOT Read it at runtime).
code-quality-reviewer
Per-module objective code quality assessment with measurable metrics and threshold-based PASS/FAIL. Produces reviews/phase-6-review/code-review.md. Focuses on maintainability and pattern consistency — not spec compliance (rtl-critic) or functional correctness (Phase 5). (Opus).
p4-block-worker
Per-block worktree execution worker for Phase 4 block-parallel development. Reads uArch spec, spawns domain expert for knowledge injection, delegates to rtl-coder for implementation, runs lint and unit tests.
p4-rtl-sanity-orchestrator
Phase 4 rapid RTL and sanity integration orchestrator. Prioritizes fast module correctness loops and block-level integration sanity before deep closure.