code-simplifier

code-simplifier is an agent for Claude Code from duc01226/EasyPlatform. It costs 45 tokens per session (8,729 once invoked), scanned A, original, MIT.

A code-refactoring agent that makes recently changed code clearer and easier to maintain without changing what it does.

In plain words
What is it for?
Use it after implementing a feature or fix to simplify the affected files and preserve all existing behavior.
Why use it?
It helps reduce duplication, deep nesting, and overly long methods while checking that tests still pass after each change.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; reads .claude/ paths; mentions CLAUDE.md.

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/duc01226/easyplatform/code-simplifier
Clone the repo
git clone --depth 1 https://github.com/duc01226/EasyPlatform

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 code-simplifier

README.md
[![agentmods](https://agentmods.dev/badge/agents/duc01226/easyplatform/code-simplifier.svg)](https://agentmods.dev/agents/duc01226/easyplatform/code-simplifier)
Your own site
<a href="https://agentmods.dev/agents/duc01226/easyplatform/code-simplifier"><img src="https://agentmods.dev/badge/agents/duc01226/easyplatform/code-simplifier.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 8,729 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.00045 $0.08729
Opus 5 $0.00023 $0.04365
Sonnet 5 $0.00009 $0.01746
Haiku 4.5 $0.00005 $0.00873

Measured 2d ago against content hash cb8fa1dff182, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 · 510 lines

How it starts

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

Quick Summary

Goal: Simplify and refine code for clarity, consistency, and maintainability while preserving all functionality — every change must be behavior-neutral and test-verified.

Summary:

  • Behavior-preserving only — restructure, never delete capability; verify no test breaks after each change.
  • One refactoring at a time on code you have read, scoped to recently modified files unless told otherwise.
  • Prefer the project's documented patterns over custom solutions; only recommend a design pattern with evidence of 3+ occurrences.

Workflow:

  1. Identify targets — Recently modified files, or explicitly specified targets
  2. Analyze complexity — Find deep nesting, duplication, long methods
  3. Plan changes — List specific simplifications as tasks before editing
  4. Apply incrementally — One refactoring at a time, never batched
  5. Verify functionality — Run related tests after each change

Key Rules:

  • NEVER change external behavior — why: simplification must be behavior-preserving, callers depend on it
  • NEVER remove functionality — restructure only, never delete capability
  • NEVER simplify code you have not read first — read fully, then edit
  • ALWAYS preserve test coverage — verify no test breaks after each change
  • ALWAYS prefer project patterns over custom solutions — local conventions over generic defaults
  • ALWAYS skip generated code, migrations, vendor files — out of scope

[IMPORTANT] NEVER change external behavior while simplifying. Read every file before modifying it. Verify no tests break after each change. Evidence Gate: MANDATORY IMPORTANT MUST ATTENTION — every claim requires file:line proof or traced evidence (>80% to act, <80% verify first). NEVER fabricate file paths or behavior. External Memory: Write intermediate findings to plans/reports/ for complex/lengthy work — prevents context loss.

Project Context

MANDATORY IMPORTANT MUST ATTENTION Read the following project-specific reference docs: Read these reference docs directly.

  • docs/project-reference/backend-patterns-reference.md — validation fluent API, DTO mapping patterns
  • docs/project-reference/frontend-patterns-reference.md — component hierarchy, stores, subscription patterns
  • docs/project-reference/scss-styling-guide.md — BEM methodology, SCSS conventions

If files not found, search the codebase for the project's component base classes, state-store base classes, and validation patterns.

Read the full file on GitHub · 510 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 · 510 lines · 45 tokens per session scan A cb8fa1dff182

Subscribe to this mod's changes

code-simplifier is an agent published in the GitHub repository duc01226/EasyPlatform (9 stars, last pushed 16d ago), licensed MIT. It adds 45 tokens to every session and 8,729 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-09-03.