Skip to content
Simplify Code cover
Code QualityFree · MIT

Simplify Code

Cut dead code, over-abstraction and needless nesting — behavior preserved, prefer deletions. Knows what NOT to touch.

v1.0.0 · ~468 tokens · ⬇ 0 · Updated July 6, 2026

What it does

Quality-only simplification (not a bug hunt): removes dead code, one-subclass abstractions, deep nesting, reinvented stdlib, flag params, redundant state — one behavior-neutral change at a time with tests green. Explicitly leaves complexity that carries its weight and refuses to dumb down crisp code.

Example uses

Untangle an over-engineered module

A module has grown layers of abstraction that no longer earn their keep.

Simplify src/services/notification/ — it has a NotificationFactory, an AbstractNotifier base class with exactly one subclass, and a config layer wrapping three constants. Inline what doesn't earn its keep, keep behavior identical, and run the tests after every change.

Flatten a deeply nested handler

A handler has become an unreadable pyramid of nested conditionals.

The request handler in api/orders.js is six levels deep in if/else pyramids. Rewrite it with guard clauses and early returns, one simplification at a time with tests green in between — behavior must stay identical.

Sweep dead code before refactoring

You want dead weight gone before starting a bigger refactor.

Before we start the checkout refactor, sweep src/checkout/ for dead weight: unused exports, commented-out blocks, unreachable branches, and hand-rolled loops that should be map or filter. Prefer deletions, and tell me if you find complexity that's worth keeping.

Install

# 1. Create the skill folder in your Claude setup
mkdir -p ~/.claude/skills/simplify-code

# 2. Download SKILL.md into it (or move the file you just downloaded)
#    → ~/.claude/skills/simplify-code/SKILL.md

# 3. Claude Code auto-discovers it on next launch.

Inside the skill

SKILL.md
---
name: simplify-code
description: Reduce complexity in existing code — dead code, over-abstraction, deep nesting, needless indirection — without hunting bugs. Use when the user says "simplify", "this is over-engineered", "reduce complexity", "make this readable". Quality-only, behavior preserved.
---

# Simplify Code

Make code simpler and clearer while keeping behavior identical. This is not a bug hunt
and not a rewrite — it's removing what shouldn't be there.

## What to cut

- **Dead code**: unreachable branches, unused vars/params/imports/exports, commented-out blocks.
- **Over-abstraction**: a base class with one subclass, a factory that builds one thing,
  a config layer for a constant, indirection that adds a hop and no value. Inline it.
- **Deep nesting**: replace with guard clauses / early returns; flatten arrow-code.
- **Reinvented stdlib**: hand-rolled loops that are `map`/`filter`/`find`; manual clamping
  that's `Math.min/max`; date math that's a one-liner.
- **Boolean/flag params** that fork behavior → two clearly named functions.
- **Redundant state**: a variable derivable from another; caching that isn't needed.

## What to LEAVE

- Complexity that carries its weight (real perf, real requirement, real edge case) — a
  comment explaining WHY should make you keep it.
- Anything you can't prove is behavior-neutral. When unsure, leave it and say why.
- Clever-but-clear code. Simple ≠ dumbed-down. Don't expand a crisp expression into ten lines.

## Method

1. Confirm tests cover it (or add a quick characterization test).
2. One simplification at a time → run tests → green → next.
3. Prefer deletions over additions. The best simplification removes lines.

## Output

Report: lines removed, each simplification (before → after in one phrase), behavior
unchanged + green tests. If you found complexity worth keeping, name it and why.

Changelog

  • v1.0.02026-07-03Initial clean-room write.

Frequently asked questions

Is Simplify Code free?

Yes. Simplify Code is free to download and MIT-licensed.

Where do I install Simplify Code?

Place the SKILL.md file in ~/.claude/skills/simplify-code/ and Claude Code auto-discovers it on next launch.

How many tokens does Simplify Code use?

About 468 tokens — it is designed to be token-lean.

Anthony M. — Founder & Lead Reviewer
Anthony M.Verified Builder

We're developers and SaaS builders who use these tools daily in production. Every review comes from hands-on experience building real products — DealPropFirm, ThePlanetIndicator, PropFirmsCodes, and many more. We don't just review tools — we build and ship with them every day.

Written and tested by developers who build with these tools daily.