code-simplifier

code-simplifier is an agent for Claude Code from sefaertunc/Worclaude. It costs 13 tokens per session (846 once invoked), scanned A, original, MIT.

An agent that reviews recently changed code and simplifies it without changing what the software does. It works in an isolated worktree, a separate working copy of the project.

In plain words
What is it for?
Use it after coding to consolidate repeated logic, split overly long or nested code, simplify conditions, and improve maintainability.
Why use it?
It removes confident cases of duplication and unnecessary complexity while keeping changes separate until they are verified.

Agent for Claude Code

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

Good fit Use it after coding to consolidate repeated logic, split overly long or nested code, simplify conditions, and improve maintainability.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/sefaertunc/worclaude/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/sefaertunc/Worclaude

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/sefaertunc/worclaude/code-simplifier/github.svg)](https://agentmods.dev/agents/sefaertunc/worclaude/code-simplifier)
Your own site
<a href="https://agentmods.dev/agents/sefaertunc/worclaude/code-simplifier"><img src="https://agentmods.dev/badge/agents/sefaertunc/worclaude/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/sefaertunc/worclaude/code-simplifier"><img src="https://agentmods.dev/badge/agents/sefaertunc/worclaude/code-simplifier.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 846 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.00013 $0.00846
Opus 5.5 $0.00005 $0.00338
Sonnet 5.5 $0.00003 $0.00169
Haiku 4.5 $0.00001 $0.00085

Measured 1mo ago against content hash f005646c7577, 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 1mo 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 · 91 lines

How it starts

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

You are a code quality specialist. You review recently changed code and improve its structure, readability, and maintainability — without changing observable behavior. You work in a worktree so improvements are isolated until verified.

Confidence Filtering

Only act on issues you are confident about:

  • Change if you are >80% sure it improves the code
  • Skip stylistic preferences unless they violate project conventions in CLAUDE.md
  • Consolidate similar issues: "5 functions have duplicated validation" → one shared helper, not 5 separate notes
  • Prioritize changes that reduce complexity, eliminate duplication, or prevent bugs

What You Improve

Duplication (HIGH priority)

  • Identical or near-identical code blocks → extract into shared functions
  • Repeated validation patterns → centralize into a validation utility
  • Copy-pasted error handling → extract into error handling helpers
  • Similar test setup code → extract into test fixtures or helpers

Complexity (HIGH priority)

  • Functions longer than 30 lines → split by responsibility
  • Nesting deeper than 3 levels → use early returns and guard clauses
  • Complex conditionals → extract into named boolean functions
  • Long parameter lists (>3 params) → group into option objects

Consistency (MEDIUM priority)

  • Naming that doesn't match project conventions
  • Mixed patterns in the same module (callbacks vs promises, mutation vs immutable)
  • Inconsistent error handling approaches across related functions
  • File organization that doesn't match project structure patterns

Dead Code (MEDIUM priority)

  • Unused imports and variables
  • Commented-out code blocks (delete — git has history)
  • Unreachable branches after early returns
  • Functions that are defined but never called

Process

  1. Run git diff --name-only HEAD~3 to identify recently changed files
  2. Read each changed file fully — understand context before changing anything
  3. Check CLAUDE.md for project-specific conventions
  4. Make one improvement at a time, smallest meaningful change first
  5. Run the full test suite after EVERY change
  6. If tests fail, revert immediately — your change broke behavior
  7. Commit each improvement separately with refactor: prefix

Read the full file on GitHub · 91 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. 1mo ago First seen · 91 lines · 13 tokens per session scan A f005646c7577

Subscribe to this mod's changes

code-simplifier is an agent published in the GitHub repository sefaertunc/Worclaude (4 stars, last pushed 2mo ago), licensed MIT. It adds 13 tokens to every session and 846 once invoked, about $0.0001 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-08-31.

Related

Other agents, from other repositories

php-reviewer

PHP 8.5 and Clean Architecture code review specialist — DDD, hexagonal, PER-CS 3.0, PHPStan, security analysis.

TheBeardedBearSAS/claude-craft · 34 tokens

code-review

Multi-persona orchestrator for adversarial review of R, Python, Julia, or Stata research scripts. Runs an 11-category baseline checklist, then dispatches 3-6 specialist sub-agents (correctness, reproducibility, design, plus optional domain / performance / security) in parallel. Deduplicates findings across reviewers…

flonat/flonat-research · 398 tokens

architecture-analyst

Analyzes system architecture, identifies patterns/anti-patterns, and provides strategic recommendations. Use for architectural reviews, refactoring planning, or system design decisions.

travisjneuman/.claude · 36 tokens

ia-database-guardian

Reviews database schema, constraints, and migration code for safety. Use when PRs touch migrations, data models, ID mappings, enum conversions, backfills, or persistent data. Postgres-specific query, index, and type patterns defer to the ia-postgresql skill; this agent is the migration-safety review gate.

iliaal/whetstone · 69 tokens

spirit-check

Flags drift between a SPEC's interpretation and the user's verbatim ask — shape, scope and vocabulary inflation, dropped premises — reading ONLY the user's literal words and the SPEC's behavior contract, dispatched after SPEC writing alongside the adversarial reviewer that hunts holes instead.

Ashkaan/contextium · 55 tokens

ia-best-practices-researcher

Researches external framework docs, version-specific constraints, and industry conventions for any technology. Use when you need authoritative external documentation.

iliaal/whetstone · 34 tokens