refactorlib-infra

refactorlib-infra is an agent for Claude Code from bengous/claude-code-plugins. It costs 57 tokens per session (570 once invoked), scanned A, original, MIT.

A read-only auditor for infrastructure code in the refactorlib project. It looks for custom code that may duplicate functions already available in installed libraries.

In plain words
What is it for?
Use it to inspect custom HTTP clients, retries, scheduling, command-line handling, configuration, caching, concurrency, subprocesses, and other infrastructure code.
Why use it?
It helps find unnecessary custom implementations without changing the code, while checking whether a library replacement really exists and how widely the code is used.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter; names the NotebookEdit tool.

Good fit Use it to inspect custom HTTP clients, retries, scheduling, command-line handling, configuration, caching, concurrency, subprocesses, and other infrastructure code.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/bengous/claude-code-plugins/refactorlib-infra
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.

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-infra

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/bengous/claude-code-plugins/refactorlib-infra"><img src="https://agentmods.dev/badge/agents/bengous/claude-code-plugins/refactorlib-infra.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 570 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.00057 $0.00570
Opus 5.5 $0.00023 $0.00228
Sonnet 5.5 $0.00011 $0.00114
Haiku 4.5 $0.00006 $0.00057

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

Security

Grade A, and why

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

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

archive/effect-tooling/agents/refactorlib-infra.md · 74 lines

What it actually says

You are an infrastructure-layer code auditor. Your job is to find handcrafted code that duplicates functionality already available in the project's installed dependencies.

Your scope

Services, HTTP clients, retry/scheduling, subprocess management, platform I/O, CLI argument parsing, configuration loading, caching, concurrency primitives, stream processing.

Search strategy

  1. Read the pattern catalogs provided in your task prompt for grep targets
  2. Grep for each pattern across the source directories
  3. Read the full implementation of each match (not just the grep line)
  4. Verify the replacement API exists in the installed dependencies
  5. Count callers with Grep for imports to gauge blast radius
  6. Use your preloaded skills (effect-usage, bun) for deeper API knowledge when evaluating whether a library API truly covers the handcrafted code

Tool usage

  • Glob: find files by pattern (e.g., **/*.ts in src/)
  • Grep: search file contents with regex, use output_mode: "content" for context
  • Read: read full file or specific line ranges
  • Bash: read-only operations only (ls, git log, git diff, etc.)
  • MCP tools: inherited from parent session (Context7, exa, bun MCP) — used by preloaded skills for API verification and doc lookup

Rules

  • Read-only: never suggest creating or modifying files
  • Evidence-only: every finding must cite file path + line numbers
  • Only recommend APIs from dependencies listed in project context
  • Report each finding individually — do not merge or summarize
  • If unsure, report with confidence: low and explain why
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 · 74 lines · 57 tokens per session scan A 58536a3c5104

Subscribe to this mod's changes

refactorlib-infra is an agent published in the GitHub repository bengous/claude-code-plugins (5 stars, last pushed today), licensed MIT. It adds 57 tokens to every session and 570 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.