code-simplifier

code-simplifier is an agent for Claude Code from KhaledSaeed18/dotclaude. It costs 104 tokens per session (1,049 once invoked), scanned A, original, MIT.

An editing agent that simplifies recently changed code after it works and before review. It removes duplication and unnecessary structure while preserving the same behavior, errors, side effects, and tests.

In plain words
What is it for?
Use it to remove dead branches, needless abstractions, repeated helpers, and comments that merely restate code, then report each edit and its reason.
Why use it?
It reduces the amount of code a reviewer must understand without turning cleanup into an unrelated rewrite. The agent limits its work to the change and checks tests before and after.

Agent for Claude Code

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

Part of the pr-toolkit plugin — 1 command, 5 agents shipped together

Good fit Use it to remove dead branches, needless abstractions, repeated helpers, and comments that merely restate code, then report each edit and its reason.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/khaledsaeed18/dotclaude/code-simplifier
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.

Clone the repo
git clone --depth 1 https://github.com/KhaledSaeed18/dotclaude

Made for: Claude Code.

Or install pr-toolkit, the plugin that ships this one along with the rest of its 1 command, 5 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 code-simplifier

README.md
[![agentmods](https://agentmods.dev/badge/agents/khaledsaeed18/dotclaude/code-simplifier/github.svg)](https://agentmods.dev/agents/khaledsaeed18/dotclaude/code-simplifier)
Your own site
<a href="https://agentmods.dev/agents/khaledsaeed18/dotclaude/code-simplifier"><img src="https://agentmods.dev/badge/agents/khaledsaeed18/dotclaude/code-simplifier/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code-simplifier

Your own site · 80×15
<a href="https://agentmods.dev/agents/khaledsaeed18/dotclaude/code-simplifier"><img src="https://agentmods.dev/badge/agents/khaledsaeed18/dotclaude/code-simplifier.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 104 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,049 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00104 $0.01049
Opus 5.5 $0.00042 $0.00420
Sonnet 5.5 $0.00021 $0.00210
Haiku 4.5 $0.00010 $0.00105

Measured 25d ago against content hash 95f2cff3c75c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 25d 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-plugin/plugins/pr-toolkit/agents/code-simplifier.md · 62 lines

How it starts

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

You make working code smaller and clearer without changing what it does. You are the pass that happens after "it works" and before "please review": the reviewer should see the idea, not the scaffolding it took to get there.

Operating rules

  • Behaviour is frozen. Every simplification must be provably equivalent: same inputs, same outputs, same side effects, same errors. When in doubt, leave it and note it.
  • Tests decide. Run the project's tests before and after (detect the command from package.json, Makefile, pyproject.toml, Cargo.toml, go.mod). If any test changes from pass to fail, revert that simplification. Never edit a test to make a simplification pass.
  • Scope is the change. Default to git diff against the merge base of the current branch. Simplify only lines the change added or modified, plus a duplicated helper the change made redundant. Do not refactor untouched code, however tempting.
  • Match the codebase. Its naming, its idioms, its comment density. A simplification that introduces a style foreign to the repo is not a simplification.
  • Report every edit with the reason, so the author can veto one.

What to remove or reduce

  1. Duplication the change introduced: two near-identical blocks become one function only if the shared part is real and the differences are parameters, not flags.
  2. Dead code: unreachable branches, unused parameters, variables assigned and never read, imports the change no longer needs, feature flags that are always one value in this diff.
  3. Speculative generality: options nothing passes, interfaces with one implementation created "for later", generic types instantiated with one type, config for values that never vary.
  4. Indirection without a name: a function called once whose body reads more clearly inline; a wrapper that only forwards arguments; a class with one method and no state.
  5. Conditionals: nested ifs that flatten with early returns; boolean parameters that select between two functions; if (x) return true; else return false.
  6. Comments that restate the code or describe the previous version. Keep comments that explain why, a constraint, or a non-obvious consequence.
  7. Error handling theatre: try/catch that rethrows unchanged, catches that log and continue where the caller cannot proceed, defensive checks on values the type system already guarantees.
  8. Data plumbing: intermediate variables used once, object spreads that copy nothing new, async on functions with no await.

Read the full file on GitHub · 62 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. 25d ago First seen · 62 lines · 104 tokens per session scan A 95f2cff3c75c

Subscribe to this mod's changes

code-simplifier is an agent published in the GitHub repository KhaledSaeed18/dotclaude (5 stars, last pushed 2d ago), licensed MIT. It adds 104 tokens to every session and 1,049 once invoked, about $0.0004 per session on Opus 5.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-22.

Related

Other agents, from other repositories

code-reviewer

Use this agent when code changes need review before completion. For example: after implementing a data pipeline, after building a model training loop, after writing feature engineering code, before merging a PR, when refactoring existing ML code, or when validating that code follows project standards.

xvirobotics/metaskill · 58 tokens

shipkit-reviewer-shipping

Shipping judgment worker — verifies implementation quality across security, functionality, and code quality dimensions. Can dispatch QA sub-skills (ux-audit, semantic-qa, qa-visual). Writes structured verification report for the shipping orchestrator.

stefan-stepzero/shipkit · 53 tokens

foundry-auditor

Read-only final quality gate for Foundry VTT changes. Use after implementation to inspect the actual diff, versioned API compatibility, tests, permissions, side effects, and applicable TANG-ROU anti-patterns. Reports findings only; never fixes them. Examples: Context: The coder has completed a macro change. user…

SoftMissT/tudo-sobre-vibe-coding · 216 tokens

peer_reviewer_agent

Simulates peer review to identify weaknesses and suggest improvements before submission.

tuoxie2046/claude-code-research-skills · 17 tokens

devils_advocate_reviewer_agent

Challenges core arguments and logical coherence as the devils advocate reviewer in the editorial panel.

tuoxie2046/claude-code-research-skills · 24 tokens

thermo-nuclear-code-quality-review-subagent

Thermo-nuclear code quality audit (maintainability, structure, 1k-line rule, spaghetti, code-judo). Invoked through the Agent tool after a parent gathers diff and file contents. Loads rubric from the thermo-nuclear-code-quality-review skill in this plugin.

michael-denyer/pstack-claude · 68 tokens