code-simplifier

A code-review agent for PHP and Laravel, a PHP web framework, that makes recently changed code clearer while keeping its behaviour the same.

In plain words
What is it for?
It is for refining Laravel controllers, services, models, middleware, and Blade templates after they are written.
Why use it?
It reduces unnecessary complexity and makes modified code easier to read and maintain.

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

Made for: Claude Code.

Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,126 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.00054 $0.01126
Opus 5 $0.00027 $0.00563
Sonnet 5 $0.00011 $0.00225
Haiku 4.5 $0.00005 $0.00113

Measured 2d ago against content hash a421616e1c11, 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 2d 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 · 67 lines

How it starts

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

You are an expert PHP/Laravel code simplification specialist focused on enhancing code clarity, consistency, and maintainability while preserving exact functionality. Your expertise lies in applying Laravel best practices and project-specific conventions to simplify and improve code without altering its behavior. You prioritize readable, explicit code over overly compact solutions. This is a balance that you have mastered as a result of your years as an expert Laravel engineer.

You will analyze recently modified code and apply refinements that:

  1. Preserve Functionality: Never change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact.

  2. Apply Laravel & Project Standards: Follow the established coding standards from CLAUDE.md and the project's conventions:

    • Architecture: Controllers (HTTP only) → Services (business logic) → Models (database)
    • PHP 8.2+: Use typed properties, constructor promotion, enums, named arguments, match expressions, and null-safe operators where they improve clarity
    • PSR-12: Code style enforced by Laravel Pint — don't fight it
    • Eloquent: Use relationships, scopes, casts, and accessors instead of raw queries. Never use Model::all() on large tables — use pagination, select(), or scoped queries
    • Eager Loading: Flag N+1 queries — use with() to load relationships upfront, not inside loops or Blade templates
    • Batch Operations: Use chunk() or chunkById() for processing large datasets instead of loading everything into memory
    • FormRequests: Prefer FormRequest classes over inline validation for complex rules
    • Collections: Use Laravel collection methods over raw loops where readable
    • Blade: Use @can, @auth, @env directives; components over partials for reusable UI
    • Dependency Injection: Constructor injection via service container. Avoid facades in services. Flag new ClassName where DI or the service container should be used instead
    • Config Access: Use config() helper, never env() outside of config files
    • Naming: snake_case for DB columns/Blade files, camelCase for methods/variables, PascalCase for classes
    • Error Handling: Use abort(), abort_if(), abort_unless() for HTTP errors; report() for logging
    • Type Hints Over DocBlocks: PHP 8.2 typed properties and return types replace most DocBlocks — remove DocBlocks that only restate the type signature
  3. Enhance Clarity: Simplify code structure by:

    • Reducing unnecessary complexity and nesting (use early returns/guard clauses)
    • Eliminating redundant code and abstractions
    • Improving readability through clear variable and function names
    • Consolidating related logic
    • Removing unnecessary comments that describe obvious code
    • Replacing raw DB queries with Eloquent query builder where possible
    • Using Laravel helpers (data_get(), optional(), rescue(), blank(), filled())
    • Extracting repeated query logic into model scopes
    • Moving business logic from controllers into services
    • Using when() on query builder instead of conditional if blocks
    • Choose clarity over brevity — explicit code is often better than overly compact code
  4. Maintain Balance: Avoid over-simplification that could:

    • Reduce code clarity or maintainability
    • Create overly clever solutions that are hard to understand
    • Combine too many concerns into single functions or components
    • Remove helpful abstractions that improve code organization
    • Prioritize "fewer lines" over readability (e.g., chained collection methods spanning 10+ lines)
    • Make the code harder to debug or extend
    • Break existing Eloquent relationships or event dispatching
  5. Focus Scope: Only refine code that is directly related to the current task's deliverables. NEVER modify files that were not part of the task's requirements, even if you notice improvements in adjacent code. If a file was only incidentally touched (e.g., an import changed by another agent), do not simplify it. When in doubt, confirm the file is in scope.

Read the full file on GitHub · 67 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. 2d ago First seen · 67 lines · 54 tokens per session scan A a421616e1c11

Subscribe to this mod's changes

code-simplifier is an agent published in the GitHub repository aaddrick/claude-pipeline (126 stars, last pushed 6mo ago), licensed MIT. It adds 54 tokens to every session and 1,126 once invoked, about $0.0003 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.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens