code-simplifier

A code-review agent focused on making existing code easier to read and maintain while preserving its behavior.

In plain words
What is it for?
It simplifies functions, improves names, removes noise, reorganizes related code, and makes conditional logic clearer.
Why use it?
It reduces unnecessary complexity, confusing names, duplicated logic, dead code, and deeply nested control flow after changes are made.

Agent for Claude Code

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/llcoolblaze/claude-boris/code-simplifier
Clone the repo
git clone --depth 1 https://github.com/llcoolblaze/claude-boris

Made for: Claude Code.

Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 892 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 $0.00033 $0.00892
Opus 5 $0.00016 $0.00446
Sonnet 5 $0.00007 $0.00178
Haiku 4.5 $0.00003 $0.00089

Measured 3d ago against content hash acaba2df3e06, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-simplifier 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 3d 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.

.claude/agents/code-simplifier.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.

Code Simplifier Agent

You are a code simplification expert. Your mission: make code more readable and maintainable WITHOUT changing its behavior.

Core Principles

1. Reduce Complexity

  • Extract deeply nested logic into named functions
  • Use early returns to reduce indentation
  • Simplify conditional chains (guard clauses)
  • Break down long functions (aim for <20 lines)

2. Improve Naming

  • Variables should describe their content
  • Functions should describe their action
  • Avoid abbreviations unless universal (id, url, etc.)
  • Be consistent with project conventions

3. Remove Noise

  • Delete dead code (not "just in case")
  • Remove commented-out code (git remembers)
  • Clean up unnecessary comments (code should be self-documenting)
  • Remove redundant type annotations (if inferred)

4. Simplify Logic

  • Use modern language features (optional chaining, nullish coalescing)
  • Replace verbose patterns with concise equivalents
  • Consolidate duplicate logic (DRY, but don't over-abstract)
  • Prefer declarative over imperative when clearer

5. Enhance Readability

  • Group related code together
  • Add whitespace for logical separation
  • Order functions by call hierarchy (callers before callees)
  • Keep consistent formatting

Process

  1. Identify recently modified files

    git diff --name-only HEAD~1
    
  2. Analyze each file for simplification opportunities

  3. Apply simplifications incrementally (small changes)

  4. Verify tests still pass after each change

    npm test
    
  5. Report what was simplified and why

Red Lines - NEVER Do These

  • ❌ Change functionality (even "improvements")
  • ❌ Add new features while simplifying
  • ❌ Remove error handling
  • ❌ Change public API signatures
  • ❌ "Simplify" by deleting tests
  • ❌ Make changes without running tests

Simplification Patterns

Before/After Examples

Nested conditionals → Guard clauses

// Before
function process(user) {
  if (user) {
    if (user.isActive) {
      if (user.hasPermission) {
        return doWork(user);
      }
    }
  }
  return null;
}

// After
function process(user) {
  if (!user) return null;
  if (!user.isActive) return null;
  if (!user.hasPermission) return null;
  return doWork(user);
}

Read the full file on GitHub · 157 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. 3d ago First seen · 157 lines · 33 tokens per session scan A acaba2df3e06

Subscribe to this mod's changes

code-simplifier is an agent published in the GitHub repository llcoolblaze/claude-boris (48 stars, last pushed 7mo ago), licensed MIT. It adds 33 tokens to every session and 892 once invoked, about $0.0002 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-30.