refactorlib-cc

refactorlib-cc is a skill for Claude Code from bengous/claude-code-plugins. It costs 52 tokens per session (1,481 once invoked), scanned A, original, MIT.

A read-only codebase audit that looks for custom code duplicating functionality already provided by the project's installed dependencies. Dependencies are third-party libraries the project already uses.

In plain words
What is it for?
Use it to inspect project dependencies, identify replacement candidates, check whether replacements are feasible, and create a structured refactoring plan.
Why use it?
It finds code that may be unnecessarily maintained when an existing library can provide the same behavior, while leaving the actual code changes to a later step.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions subagents.

Good fit Use it to inspect project dependencies, identify replacement candidates, check whether replacements are feasible, and create a structured refactoring plan.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bengous/claude-code-plugins/refactorlib-cc
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 bengous/claude-code-plugins --skill refactorlib-cc
Clone the repo
git clone --depth 1 https://github.com/bengous/claude-code-plugins

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 refactorlib-cc

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/bengous/claude-code-plugins/refactorlib-cc"><img src="https://agentmods.dev/badge/skills/bengous/claude-code-plugins/refactorlib-cc.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,481 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.00052 $0.01481
Opus 5.5 $0.00021 $0.00592
Sonnet 5.5 $0.00010 $0.00296
Haiku 4.5 $0.00005 $0.00148

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

Security

Grade A, and why

refactorlib-cc 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.

archive/effect-tooling/skills/refactorlib-cc/SKILL.md · 157 lines

How it starts

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

refactorlib

Audit a codebase for handcrafted code that could be replaced by existing dependencies.

Projects accumulate utility code over time. Some predates a dependency that now covers the same ground; some was written before the team discovered a library API. Removing these duplications shrinks maintenance surface and leverages battle-tested implementations with better edge-case handling and security patches.

Project context

  • deps: !bun -e "const p=JSON.parse(await Bun.file('package.json').text()); console.log(JSON.stringify({...p.dependencies,...p.devDependencies}))" 2>/dev/null
  • runtime: !bun --version 2>/dev/null || node --version 2>/dev/null
  • has_effect: !bun -e "const p=JSON.parse(await Bun.file('package.json').text()); console.log(p.dependencies?.effect || p.devDependencies?.effect ? 'yes' : 'no')" 2>/dev/null
  • has_bun: !bun -e "const p=JSON.parse(await Bun.file('package.json').text()); console.log(p.devDependencies?.['@types/bun'] ? 'yes' : 'no')" 2>/dev/null
  • src_dirs: !ls src/ 2>/dev/null | head -20

Workflow

Phase 1 -- Route on context

The project context above was resolved at skill load time. Use it to decide which pattern catalogs each agent should read:

  • If has_effect == "yes": include references/patterns/effect-infra.md in the infra agent's pattern list
  • Always: include references/patterns/runtime-infra.md for infra agent, references/patterns/general-utility.md and references/patterns/runtime-utility.md for utility agent

The subagents have effect-usage and bun skills preloaded — no need to load companion skills in the orchestrator.

Phase 2 -- Parallel exploration

Spawn two custom subagents in parallel. Each receives a short task prompt with:

  • Project dependencies (from deps above)
  • Source directories (from src_dirs above)
  • Pattern catalog file paths to read (from Phase 1 routing)
  • Guardrails: ~/.claude/skills/refactorlib-cc/references/guardrails.md
  • Report format: ~/.claude/skills/refactorlib-cc/references/report-format.md
  • The user's request (or "Full audit -- no scope restriction")

Read the full file on GitHub · 157 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 157 lines · 52 tokens per session scan A e2a45796b291

Subscribe to this mod's changes

refactorlib-cc is a skill published in the GitHub repository bengous/claude-code-plugins (5 stars, last pushed today), licensed MIT. It adds 52 tokens to every session and 1,481 once invoked, about $0.0002 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.