Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/evan043/claude-cli-advanced-starter-packnpx agentmods add commands/evan043/claude-cli-advanced-starter-pack/refactor-analyze.templateWrote 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/evan043/claude-cli-advanced-starter-pack/refactor-analyze.template)<a href="https://agentmods.dev/commands/evan043/claude-cli-advanced-starter-pack/refactor-analyze.template"><img src="https://agentmods.dev/badge/commands/evan043/claude-cli-advanced-starter-pack/refactor-analyze.template/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/evan043/claude-cli-advanced-starter-pack/refactor-analyze.template"><img src="https://agentmods.dev/badge/commands/evan043/claude-cli-advanced-starter-pack/refactor-analyze.template.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.00000 | $0.11206 |
| Opus 5.5 | $0.00000 | $0.04482 |
| Sonnet 5.5 | $0.00000 | $0.02241 |
| Haiku 4.5 | $0.00000 | $0.01121 |
Grade B, and why
refactor-analyze.template 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.
cat .claude/refactor-analysis/refactor-analysis-{date}/By-Page/epg/fix-order.yaml How it starts
The opening of the file, as written. The whole thing — 1,357 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Codex Runtime Compatibility
This prompt was authored for Claude-style slash workflows. In Codex runtime, adapt tool calls as follows:
AskUserQuestion=> ask the user directly in chat.WebSearch/WebFetch=> use available web tools (search_query,open,find) and cite links.Read/Write=> use shell/filesystem tools in this workspace.- Claude-only MCP calls (for example Playwright MCP names) => use available equivalents or clearly state fallback.
- Keep intent and output format identical; only adapt execution mechanics.
description: Deep complexity analysis for refactoring prioritization with dependency tracing model: sonnet argument-hint: [file path, directory, or 'all']
/refactor-analyze - Code Complexity Analysis
Analyze code complexity, detect code smells, and prioritize refactoring candidates with metrics-driven recommendations. Now with dependency tracing and global scanning.
Quick Start
/refactor-analyze # Interactive mode - choose options
/refactor-analyze src/api/ # Analyze specific directory
/refactor-analyze src/api/client.ts # Analyze single file
/refactor-analyze --top 10 # Show top 10 worst files
/refactor-analyze --trace-imports # Trace full import dependency tree
/refactor-analyze --global-scan # Find ALL large files (not just flagged)
/refactor-analyze --threshold 1000 # Custom line threshold (default: 500)
Instructions for Claude
When /refactor-analyze is invoked, ALWAYS start with Step 0 to present interactive options.
Step 0: Present Interactive Options (REQUIRED)
Use AskUserQuestion to let the user configure the analysis:
questions:
- header: "Analysis Mode"
question: "What type of analysis do you want to run?"
multiSelect: false
options:
- label: "Standard Analysis (Recommended)"
description: "Analyze flagged files (>500 lines) with basic metrics"
- label: "Deep Analysis + Import Tracing"
description: "Trace full dependency tree for each file - discovers hidden large dependencies"
- label: "Global Scan"
description: "Find ALL files above threshold regardless of page association"
- label: "Comprehensive (All Features)"
description: "Global scan + import tracing + orphan detection"
- header: "Line Threshold"
question: "What line count threshold should trigger analysis?"
multiSelect: false
options:
- label: "500 lines (Standard)"
description: "Default threshold - catches most problem files"
- label: "1000 lines (Large files only)"
description: "Focus on the biggest offenders first"
- label: "2000 lines (Critical only)"
description: "Only truly massive files needing immediate attention"
- label: "300 lines (Strict)"
description: "More aggressive - catch problems earlier"
- header: "Output Format"
question: "How should results be organized?"
multiSelect: false
options:
- label: "By Priority Score (Recommended)"
description: "Rank all files by refactoring urgency"
- label: "By Page/Route"
description: "Group files by their consuming page entry points"
- label: "By Discovery Method"
description: "Separate direct flags, import traces, and global scan results"
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 · 1,357 lines · 0 tokens per session scan B ffedb448587f
refactor-analyze.template is a command published in the GitHub repository evan043/claude-cli-advanced-starter-pack (62 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 11,206 tokens. 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-30.
refactor-analyze.template compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactor-analyze.templateevan043/claude-cli-advanced-starter-pack | Command | 62 | 4mo ago | MIT | B | 0 | Claude Code |
| assemble-teamtravisjneuman/.claude | Command | 115 | today | MIT | A | 25 | Claude Code |
| hatch3r-pr-resolvehatch3r/hatch3r | Command | 26 | 2mo ago | MIT | A | 25 | Claude Code |
| code-reviewbearlike/Assistant | Command | 43 | yesterday | MIT | A | 5 | Claude Code |
| prepare-reviewstefan-jansen/claude-code-toolkit | Command | 101 | 4mo ago | MIT | A | 0 | Claude Code |
| review-cskbyerlikaya/claude-starter-kit | Command | 24 | 2mo ago | MIT | A | 14 | Claude Code |
| octo-staged-reviewCES-Ltd/Lumi | Command | 42 | 6mo ago | MIT | A | 11 | Claude Code |