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.
git clone --depth 1 https://github.com/sefaertunc/WorclaudeWrote 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/commands/sefaertunc/worclaude/refactor-clean)<a href="https://agentmods.dev/commands/sefaertunc/worclaude/refactor-clean"><img src="https://agentmods.dev/badge/commands/sefaertunc/worclaude/refactor-clean/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.
<a href="https://agentmods.dev/commands/sefaertunc/worclaude/refactor-clean"><img src="https://agentmods.dev/badge/commands/sefaertunc/worclaude/refactor-clean.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00007 | $0.00969 |
| Opus 5.5 | $0.00003 | $0.00388 |
| Sonnet 5.5 | $0.00001 | $0.00194 |
| Haiku 4.5 | $0.00001 | $0.00097 |
Grade B, and why
refactor-clean 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 3mo 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.
test -f .claude/scratch/last-review.md && head -10 .claude/scratch/last-review.md How it starts
The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Run a focused cleanup pass on recently changed code. This command runs INLINE in your current session — it reads uncommitted changes, improves them in place, and leaves everything uncommitted for /commit-push-pr.
When invoked with arguments, use them to scope the cleanup. Example: /refactor-clean src/core/merger.js
Arguments: $ARGUMENTS
Do NOT spawn a subagent or worktree for this. Work directly on the files in the current working directory.
What to Clean
-
Dead code — unused imports, commented-out blocks, unreachable branches, uncalled functions. Delete them — git has history.
-
Duplication — identical or near-identical code blocks → extract shared function. Repeated validation → centralize. Copy-pasted error handling → extract helper.
-
Complexity — functions over 30 lines → split by responsibility. Nesting deeper than 3 levels → early returns, guard clauses. Long parameter lists → group into option objects.
-
Consistency — naming that doesn't match project conventions. Mixed patterns in the same module. Inconsistent error handling.
Process
0. Check for fresh /review-changes output
Before doing your own analysis, look for .claude/scratch/last-review.md:
test -f .claude/scratch/last-review.md && head -10 .claude/scratch/last-review.md
If the file exists AND its sha: frontmatter matches git rev-parse HEAD,
use the review as your work plan. Skip steps 1-3 below; jump straight
to step 4 with the review's findings as your candidate list.
If the SHA doesn't match, the review is stale — ignore it and proceed with your own analysis.
1-6. Self-analysis path (only if no fresh review)
- Identify changed files:
git diff --name-only(unstaged) andgit diff --cached --name-only(staged). If no changes, checkgit diff --name-only HEAD~5for recent commits. - Read each changed file fully — understand context before changing
- Check CLAUDE.md for project-specific conventions
- Make one improvement at a time, smallest meaningful change first
- Scoped tests after each change. Run only the tests related to
the files you changed (don't run the whole suite each time):
- Vitest:
npx vitest run --related <changed-files> - Jest:
npx jest --findRelatedTests <changed-files> - Other runners: scope to the relevant test directory or file pattern
- Vitest:
- If scoped tests fail, revert immediately — your change broke behavior
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.
- 3mo ago First seen · 109 lines · 7 tokens per session scan B ff33296725eb
refactor-clean is a command published in the GitHub repository sefaertunc/Worclaude (4 stars, last pushed 3mo ago), licensed MIT. It adds 7 tokens to every session and 969 once invoked, about $0.0000 per session on Opus 5.5. 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.
refactor-clean compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactor-cleansefaertunc/Worclaude | Command | 4 | 3mo ago | MIT | B | 7 | Claude Code |
| fest-showObedience-Corp/festival | Command | 178 | today | Apache-2.0 | A | 17 | Claude Code |
| synthesise-reviewsflonat/flonat-research | Command | 155 | 16d ago | MIT | A | 47 | Claude Code |
| verify-mathflonat/flonat-research | Command | 155 | 16d ago | MIT | A | 81 | Claude Code |
| prep-rolefourleafai/clover-public | Command | 8 | 11d ago | MIT | A | 0 | Claude Code |
| hypothesisAznatkoiny/zAI-Skills | Command | 10 | 24d ago | MIT | A | 8 | Claude Code |
| auditoria-legalMazalucas/El-DT-Lightweight-Army | Command | 4 | yesterday | MIT | A | 0 | Claude Code |