harnss: Agent for Claude Code

.claude/agents/refactor-analyst.md

refactor-analyst is an agent for Claude Code from OpenSource03/harnss. It costs 437 tokens per session (1,961 once invoked), scanned A, original, MIT.

An analysis agent that examines code quality and recommends refactoring for selected files, directories, or a branch. Refactoring means restructuring code to make it easier to maintain without changing its intended behavior.

In plain words
What is it for?
Use it to analyze a code area or branch, read related files and project guidance, and produce prioritized refactoring recommendations.
Why use it?
It provides a detailed review of patterns, complexity, conventions, and possible improvements before anyone edits the code. It does not make changes itself.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions CLAUDE.md.

This is OpenSource03/harnss's own configuration. It tells Claude Code how to work on harnss itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything harnss configures →

Reuse

Borrowing it

Nothing to install: this file belongs to OpenSource03/harnss. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/OpenSource03/harnss/master/.claude/agents/refactor-analyst.md
Clone the repo
git clone --depth 1 https://github.com/OpenSource03/harnss

Made for: Claude Code.

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 refactor-analyst

README.md
[![agentmods](https://agentmods.dev/badge/agents/opensource03/harnss/refactor-analyst/github.svg)](https://agentmods.dev/agents/opensource03/harnss/refactor-analyst)
Your own site
<a href="https://agentmods.dev/agents/opensource03/harnss/refactor-analyst"><img src="https://agentmods.dev/badge/agents/opensource03/harnss/refactor-analyst/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.

agentmods 80×15 button for refactor-analyst

Your own site · 80×15
<a href="https://agentmods.dev/agents/opensource03/harnss/refactor-analyst"><img src="https://agentmods.dev/badge/agents/opensource03/harnss/refactor-analyst.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 437 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,961 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00437 $0.01961
Opus 5.5 $0.00175 $0.00784
Sonnet 5.5 $0.00087 $0.00392
Haiku 4.5 $0.00044 $0.00196

Measured 1mo ago against content hash 1cb268403223, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 1mo 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.

.claude/agents/refactor-analyst.md · 155 lines

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 diff to identify changed files, then read each one fully
  • If given a directory, use tree or find to 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

Read the full file on GitHub · 155 lines

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. 1mo ago First seen · 155 lines · 437 tokens per session scan A 1cb268403223

Subscribe to this mod's changes

refactor-analyst is an agent published in the GitHub repository OpenSource03/harnss (392 stars, last pushed 7d ago), licensed MIT. It adds 437 tokens to every session and 1,961 once invoked, about $0.0017 per session on Opus 5.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.

Related

Other agents, from other repositories

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.

Intelligent-Internet/zenith · 40 tokens

verdict-reviewer

Adversarial final reviewer for a completed work order or diff — checks the change against its acceptance criteria and the scoped developing/ owner documents, hunting for ship-blockers. Use when a batch of work needs a PASS/FAIL verdict with evidence before merge or deploy.

amplifthq/opentag · 58 tokens

repo-auditor

Read-only evidence collector for fan-out audits — doc health sweeps, dead-code hunts, contract-drift checks, multi-file inventories. Use PROACTIVELY when a question needs facts gathered across many files and only the conclusion matters. Reports facts with file:line evidence; never proposes fixes.

amplifthq/opentag · 64 tokens

slop-detector

Reviews frontend code and copy for the fingerprints of AI-generated output and reports specific, located fixes. Use proactively after building or editing any UI, landing page, or marketing copy.

OneWave-AI/open-agent-stack · 40 tokens

quality-reviewer

Independent senior-engineering quality auditor for the ck:quality skill. Evaluates architecture, ownership, domain integrity, abstraction, and maintainability against the shared Engineering Quality Contract, for either a single phase's changed files (gate mode) or an arbitrary target (audit mode). Never edits files…

huuanh20/awesome-ai-agent-skills · 71 tokens

code-reviewer

Generic code review agent. Reads CLAUDE.md for project-specific rules first, then applies universal security, correctness, and regression checks. Use immediately after writing or modifying code. Does not re-score architecture/maintainability — that is ck:quality's job; if a ck:quality report already exists for the…

huuanh20/awesome-ai-agent-skills · 86 tokens