factorize

factorize is a skill for Claude Code from Bidiche49/claude-conf. It costs 12 tokens per session (1,947 once invoked), scanned A, original, MIT.

A project-wide scan for duplicated code, repeated patterns, and places where shared code could replace repetition.

In plain words
What is it for?
Use it to inspect the whole project or a selected directory, either to report opportunities only or to plan and apply refactoring.
Why use it?
It helps reveal maintenance problems that may be missed when reviewing only recently changed files.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions CLAUDE.md.

Good fit Use it to inspect the whole project or a selected directory, either to report opportunities only or to plan and apply refactoring.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bidiche49/claude-conf/factorize
Install

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.

Any agent
npx skills add Bidiche49/claude-conf --skill factorize
Clone the repo
git clone --depth 1 https://github.com/Bidiche49/claude-conf

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 factorize

README.md
[![agentmods](https://agentmods.dev/badge/skills/bidiche49/claude-conf/factorize/github.svg)](https://agentmods.dev/skills/bidiche49/claude-conf/factorize)
Your own site
<a href="https://agentmods.dev/skills/bidiche49/claude-conf/factorize"><img src="https://agentmods.dev/badge/skills/bidiche49/claude-conf/factorize/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 factorize

Your own site · 80×15
<a href="https://agentmods.dev/skills/bidiche49/claude-conf/factorize"><img src="https://agentmods.dev/badge/skills/bidiche49/claude-conf/factorize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,947 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.00012 $0.01947
Opus 5.5 $0.00005 $0.00779
Sonnet 5.5 $0.00002 $0.00389
Haiku 4.5 $0.00001 $0.00195

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

Security

Grade A, and why

factorize 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.

factorize/skills/factorize/SKILL.md · 208 lines

How it starts

The opening of the file, as written. The whole thing — 208 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Scan the codebase to detect duplicated code, repeated patterns, and factorization opportunities. Unlike /simplify (which refines recently changed code), this command performs a project-wide analysis.

Modes:

  • /factorize — full scan, all source files
  • /factorize src/services — scoped to a specific directory
  • /factorize --dry-run — report only, no code changes
  • /factorize --scope small — override auto-detected project size

Step 1 — Context

  1. Read CLAUDE.md to understand:

    • Stack (language, framework, conventions)
    • Project structure (where source lives, what's generated/vendored)
    • Naming conventions and existing abstractions
  2. Detect project size:

    • Count source files (exclude tests, config, generated, vendor, node_modules)
    • Small (< 30 files): 1 analysis agent
    • Medium (30-100 files): 2 agents (split by directory)
    • Large (> 100 files): 3 agents (split by layer/concern)
  3. Present the plan:

    FACTORIZE — [project name]
    Stack: [detected]
    Scope: [full / directory]
    Size: [X source files] → [small/medium/large]
    Agents: [1-3]
    Mode: [analysis + refactor / dry-run (report only)]
    
    Proceed? [Y/n]
    

Step 2 — Detection phase

Launch agents in parallel (subagent_type: feature-dev:code-explorer).

Each agent receives its assigned files and this mission:

You are analyzing [project name] ([stack]) for factorization opportunities.
Your assigned files: [list].

Scan for these patterns:

1. **DUPLICATED CODE** — identical or near-identical blocks (>5 lines) that appear in 2+ files.
   Report: both locations, the duplicated block, and a suggested shared function/module name.

2. **REPEATED PATTERNS** — same logical pattern implemented differently across files
   (e.g., 3 different ways to validate input, 4 similar API call wrappers).
   Report: all occurrences, the common pattern, and a suggested unified approach.

3. **MISSED ABSTRACTIONS** — operations that could benefit from a shared utility
   (e.g., repeated string transformations, common data reshaping, recurring error handling).
   Report: occurrences and suggested abstraction.

4. **COPY-PASTE DRIFT** — code that was clearly copied then modified slightly,
   creating divergence that will cause bugs (one copy gets fixed, others don't).
   Report: all copies, the differences, and which version is likely "correct".

For each finding, report:
- **Type**: DUPLICATION / PATTERN / ABSTRACTION / DRIFT
- **Impact**: HIGH (>3 occurrences or >20 lines each) / MEDIUM (2-3 occurrences) / LOW (minor)
- **Locations**: file:line for each occurrence
- **Code snippets**: the duplicated/similar blocks (abbreviated if >15 lines)
- **Suggestion**: concrete refactoring approach (function name, module location, signature)

Do NOT report:
- Similar test setup code (tests are allowed to be repetitive for readability)
- Framework boilerplate that cannot be abstracted (e.g., route definitions)
- Config files or generated code
- Differences that are intentional (check comments, commit messages)

Read the full file on GitHub · 208 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 · 208 lines · 12 tokens per session scan A 4093a50b03b9

Subscribe to this mod's changes

factorize is a skill published in the GitHub repository Bidiche49/claude-conf (2 stars, last pushed 5mo ago), licensed MIT. It adds 12 tokens to every session and 1,947 once invoked, about $0.0000 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-31.