simplify

simplify is a command for Claude Code from dinhnguyenngoc/spec-driven-claude-code. It costs 12 tokens per session (2,599 once invoked), scanned A, original, MIT.

A command for making code easier to understand and maintain while keeping its behavior unchanged. It targets unnecessary complexity in existing code.

In plain words
What is it for?
Use it after a code review finds complexity, before adding features to tangled code, or during maintenance work.
Why use it?
Complex code takes longer to review, modify, and debug. Simplifying it lowers that burden without intentionally changing what the software does.

Command 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 commands/dinhnguyenngoc/spec-driven-claude-code/simplify
Clone the repo
git clone --depth 1 https://github.com/dinhnguyenngoc/spec-driven-claude-code

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 simplify

README.md
[![agentmods](https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/simplify.svg)](https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/simplify)
Your own site
<a href="https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/simplify"><img src="https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/simplify.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,599 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.00012 $0.02599
Opus 5 $0.00006 $0.01300
Sonnet 5 $0.00002 $0.00520
Haiku 4.5 $0.00001 $0.00260

Measured 3d ago against content hash a99a689b4adb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

simplify 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 3d 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/commands/simplify.md · 325 lines

How it starts

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

/simplify — Code Simplification

"Complexity is the enemy of execution."

Purpose

Simplify code for clarity and maintainability. Reduce complexity without changing behavior.

Workspace Mode: if the session root declares Mode: workspace → resolve the target repo per CLAUDE.md §Workspace Mode before anything else; every path, probe, and gate below is relative to the target repo, and the workspace disk-check applies at the gate.

Stack Profile note: the dotnet commands and C# catalog below use the default profile. Core = Node.js → map to the npm equivalents (npm test, npm run build); the Common Simplifications are default-stack illustration — apply the equivalent TS idioms per rules/overrides/lang-nodejs.md (early returns, discriminated unions + switch, arrow shorthand). Core = PHPphp artisan test / vendor/bin/pest for the suite; equivalent idioms per rules/overrides/lang-php.md (early returns, match expressions over switch, backed enums over class constants, arrow functions).

When to Use

  • After /review identifies complexity issues
  • When code is hard to understand
  • Before adding new features to tangled code
  • During tech debt cleanup sprints

Principles

Chesterton's Fence

Before removing something, understand why it exists.

Don't delete code just because it looks unnecessary. Investigate:

  • Git history: git log -p -- path/to/file
  • Related tests
  • Comments or documentation
  • architecture/ARCHITECTURE.md §Non-Functional Requirements — code cited there as an NFR mechanism (cache, index, AsNoTracking, compiled query, rate limiter…) is a budget, not complexity: the test net cannot see its removal (thresholds are measured at /verify Phase 4, not by the suite), so "all tests still green" proves nothing here. Removing or bypassing a cited mechanism is an /arch-level decision (B5 Red Flag below), never a simplification.
  • Ask team members if unsure

Rule of 500

If a file or class exceeds ~500 lines, it likely needs splitting. (Methods have a much tighter bar: ~30 lines per rules/code-style.md — see the Step 3 table.)

Read the full file on GitHub · 325 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. 3d ago First seen · 325 lines · 12 tokens per session scan A a99a689b4adb

Subscribe to this mod's changes

simplify is a command published in the GitHub repository dinhnguyenngoc/spec-driven-claude-code (20 stars, last pushed 4d ago), licensed MIT. It adds 12 tokens to every session and 2,599 once invoked, about $0.0001 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.