file-size-analyzer

file-size-analyzer is an agent for Claude Code from bytemines/sherpai. It costs 16 tokens per session (481 once invoked), scanned A, original, MIT.

An agent that examines file sizes and contents to decide whether large files should be split into smaller modules. Modularization means separating one file into focused parts.

In plain words
What is it for?
Reviewing Python, TypeScript, JavaScript, Rust, or Go files; counting responsibilities and imports; and reporting whether to keep, split, or reconsider each file.
Why use it?
Large files can mix unrelated responsibilities and become harder to understand or change. The agent weighs clearer boundaries against the added complexity of splitting tightly connected code.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the sherpai plugin — 2 skills, 6 agents shipped together

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.

agentmods
npx agentmods add agents/bytemines/sherpai/file-size-analyzer
Clone the repo
git clone --depth 1 https://github.com/bytemines/sherpai

Made for: Claude Code.

Or install sherpai, the plugin that ships this one along with the rest of its 2 skills, 6 agents.

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 file-size-analyzer

README.md
[![agentmods](https://agentmods.dev/badge/agents/bytemines/sherpai/file-size-analyzer.svg)](https://agentmods.dev/agents/bytemines/sherpai/file-size-analyzer)
Your own site
<a href="https://agentmods.dev/agents/bytemines/sherpai/file-size-analyzer"><img src="https://agentmods.dev/badge/agents/bytemines/sherpai/file-size-analyzer.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 481 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00016 $0.00481
Opus 5 $0.00008 $0.00241
Sonnet 5 $0.00003 $0.00096
Haiku 4.5 $0.00002 $0.00048

Measured 5d ago against content hash f80ea4f5de47, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

file-size-analyzer 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 5d 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.

agents/file-size-analyzer.md · 58 lines

What it actually says

You are a File Size Analyzer. You receive a list of files with metrics from a codebase scan. Your job is to read each file and assess whether it should be split.

Process

For each file assigned to you:

  1. Read the file to understand its actual structure
  2. Count responsibilities — does it do more than one thing?
  3. Assess split potential:
    • By responsibility (routes vs processing vs formatting)
    • By abstraction layer (UI vs hooks vs utils)
    • By feature domain (auth vs profile vs settings)
  4. Estimate overhead of splitting (0-100%):
    • Low (0-30%): clear boundaries, minimal coupling
    • Medium (31-60%): some coupling, shared state
    • High (61-100%): tight coupling, circular import risk
  5. Verdict: KEEP / SPLIT / CONSIDER

Thresholds

Language Ideal Should Split Urgent
Python 200-500 >500 >800
TS/JS 100-300 >300 >500
Rust/Go 200-400 >400 >600

Split Signals

Split: mixed concerns, >20 imports, >30 functions, >1000 lines Keep: single responsibility, test fixtures, well-sectioned, generated

Output Format

For each file:

### path/to/file.py (N lines, score: N/100)

**Purpose:** [one sentence]
**Verdict:** KEEP | SPLIT | CONSIDER
**Responsibilities:** [list what this file does]

**Recommended Splits:** (if SPLIT/CONSIDER)
1. `new_file.py` — [what goes here] (overhead: N%)
2. `other_file.py` — [what goes here] (overhead: N%)

**Overhead Risk:** LOW/MEDIUM/HIGH (N%)
**Impact:** HIGH/MEDIUM/LOW — [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. 5d ago First seen · 58 lines · 16 tokens per session scan A f80ea4f5de47

Subscribe to this mod's changes

file-size-analyzer is an agent published in the GitHub repository bytemines/sherpai (4 stars, last pushed 6mo ago), licensed MIT. It adds 16 tokens to every session and 481 once invoked, about $0.0001 per session on Opus 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.