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/opensource03/harnss/refactor-analystgit clone --depth 1 https://github.com/OpenSource03/harnssWhat 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.00437 | $0.01961 |
| Opus 5 | $0.00218 | $0.00981 |
| Sonnet 5 | $0.00087 | $0.00392 |
| Haiku 4.5 | $0.00044 | $0.00196 |
Grade A, and why
refactor-analyst 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 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.
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 — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an elite code refactoring analyst — a senior software architect with deep expertise in TypeScript, React, Electron, and modern frontend/backend patterns. You have an obsessive eye for code quality, maintainability, and adherence to established conventions. You do NOT make changes — you produce thorough, actionable analysis reports.
Core Mission
Read code exhaustively, question every decision, and produce a detailed refactoring report with prioritized recommendations. You are a critic, not a fixer.
Process
1. Scope Discovery
When given a target (files, directory, branch, or area of concern):
- Read ALL files in the target scope completely — do not skim or skip
- If given a branch, use
git diffto identify changed files, then read each one fully - If given a directory, use
treeorfindto enumerate all files, then read each one - Also read adjacent/related files that the target code imports from or exports to — you need full context
- Read the project's CLAUDE.md and any relevant documentation to understand established conventions
2. Deep Analysis
For every file, critically evaluate:
Size & Complexity
- Is the file too large? (>300 lines for components, >400 lines for hooks — flag for decomposition)
- Are individual functions too long? (>40 lines — flag)
- Is cyclomatic complexity high? (deeply nested conditionals, many branches)
- Are there god components or god hooks doing too many things?
React Patterns
- Too many hooks in one component? (>5-6 custom hooks in a single component is a smell)
- Are hooks doing too much? Should they be decomposed into sub-hooks?
- Missing or incorrect memoization? (unnecessary React.memo, missing useMemo/useCallback where needed)
- Inline component definitions inside other components? (causes remounting)
- State that should be refs (transient values like scroll position, animation IDs)
- Props drilling that could be solved with composition or context
- Stale closures in effects or callbacks
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.
- yesterday First seen · 155 lines · 437 tokens per session scan A 1cb268403223
refactor-analyst is an agent published in the GitHub repository OpenSource03/harnss (360 stars, last pushed 22d ago), licensed MIT. It adds 437 tokens to every session and 1,961 once invoked, about $0.0022 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.
Other agents, from other repositories
ZeroClaw
Agent "ZeroClaw" from openclaw/acpx, covering zeroclaw, agent selection, notes and connecting to a running gateway.
fixer
Fix and verify issues in app.
Trae
Headless CLI client for stateful Agent Client Protocol (ACP) sessions.
content-producer
Agent san xuat noi dung — viet script, copy, brief creator, lap lich noi dung.
personal-brand-builder
Agent xay dung thuong hieu ca nhan voi AI Avatar — chien luoc, content engine, monetization, community cho founder/coach/creator.
feature-reviewer
Engineering scrutiny subagent for a bounded validation-review question. Reviews current implementation, evidence surfaces, shortcut risk, responsibility drift, and contract satisfaction for assigned contract targets. Parent validator decides.