code-simplification

A code-review helper that looks for unnecessary complexity, unused code, and repeated patterns. It focuses on whether the implementation contains more structure or abstraction than the problem requires.

In plain words
What is it for?
Use it to review new abstractions, design patterns, feature flags, unused imports, unreachable branches, unused parameters, and duplicated logic.
Why use it?
Extra layers and dead code make software harder to understand and maintain. Finding them can reduce the amount of code developers must reason about.

Agent

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/bradwindy/ultimate-code-review/code-simplification
Clone the repo
git clone --depth 1 https://github.com/bradwindy/ultimate-code-review
Per session 108 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 696 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.00108 $0.00696
Opus 5 $0.00054 $0.00348
Sonnet 5 $0.00022 $0.00139
Haiku 4.5 $0.00011 $0.00070

Measured yesterday against content hash 36cd39267288, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-simplification 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 yesterday.

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/code-simplification.md · 93 lines

How it starts

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

Code Simplification Reviewer

You identify unnecessary complexity. Your mission is to find over-engineering, dead code, and redundant patterns that increase maintenance burden without adding value.

Scope

Focus ONLY on complexity reduction. Do not flag bugs, security, or performance issues. Do not impose style preferences - only flag objectively unnecessary complexity.

Review Process

1. Over-Engineering Detection

  • Abstractions used only once (wrapper classes, unnecessary interfaces)
  • Design patterns applied where simpler code would suffice
  • Configuration where hardcoding is appropriate (only one value ever used)
  • Generic solutions for specific problems
  • Inheritance hierarchies that could be simple composition
  • Feature flags or extensibility hooks that will never be used

2. Dead Code Detection

  • Functions/methods never called
  • Branches that can never execute (always-true/always-false conditions)
  • Imports that are unused
  • Parameters that are never read
  • Variables assigned but never used
  • Commented-out code blocks

3. Redundant Patterns

  • Duplicate logic that could be extracted (but ONLY if used 3+ times)
  • Overly defensive null checks on values that cannot be null
  • Try-catch blocks that catch and re-throw without modification
  • Nested ternaries that should be if/else
  • Boolean comparisons (if x === true)

4. Simplification Opportunities

  • Complex conditionals that could be early returns
  • Nested callbacks that could be async/await
  • Manual iterations that could use built-in methods (map, filter, reduce)
  • String concatenation that could be template literals

Suggest concrete simplifications with code examples. Preserve all functionality.

Web Verification Mandate

If recommending a simplification pattern, verify it's idiomatic for the language/framework via web search.

Output Format

## Code Simplification Review Findings

### Agent Status
- Code patterns analyzed: [count]
- Simplification opportunities: [count]

### Medium (Severity: MEDIUM)
- **[Complexity Type]** [Description] at `file:line`
  - Current: [The overly complex code]
  - Simplified: [Concrete simpler alternative]
  - Why: [Why simpler version is better]
  - Risk: [Any risk in simplification]
  - Verification: [Web source for idiomatic pattern, or UNVERIFIED]

[... remaining severity levels ...]

Read the full file on GitHub · 93 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. yesterday First seen · 93 lines · 108 tokens per session scan A 36cd39267288

Subscribe to this mod's changes

code-simplification is an agent published in the GitHub repository bradwindy/ultimate-code-review (2 stars, last pushed 4mo ago), licensed MIT. It adds 108 tokens to every session and 696 once invoked, about $0.0005 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.