code-simplify

code-simplify is a command for Claude Code from loiane/specs-driven-development-spring-angular. It costs 23 tokens per session (539 once invoked), scanned A, original, MIT.

A command that simplifies one source file or directory using readability rules while keeping the existing tests passing.

In plain words
What is it for?
Use it on files under the specified source directory, either to apply the simplification or to preview the proposed edits.
Why use it?
It targets hard-to-read constructs such as nested conditional expressions, unclear streams, one-use helpers, and methods with option flags without changing behavior.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: agent in frontmatter; reads .claude/ paths.

Good fit Use it on files under the specified source directory, either to apply the simplification or to preview the proposed edits.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/loiane/specs-driven-development-spring-angular/code-simplify
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/loiane/specs-driven-development-spring-angular

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-simplify

README.md
[![agentmods](https://agentmods.dev/badge/commands/loiane/specs-driven-development-spring-angular/code-simplify/github.svg)](https://agentmods.dev/commands/loiane/specs-driven-development-spring-angular/code-simplify)
Your own site
<a href="https://agentmods.dev/commands/loiane/specs-driven-development-spring-angular/code-simplify"><img src="https://agentmods.dev/badge/commands/loiane/specs-driven-development-spring-angular/code-simplify/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-simplify

Your own site · 80×15
<a href="https://agentmods.dev/commands/loiane/specs-driven-development-spring-angular/code-simplify"><img src="https://agentmods.dev/badge/commands/loiane/specs-driven-development-spring-angular/code-simplify.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 539 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.00023 $0.00539
Opus 5.5 $0.00009 $0.00216
Sonnet 5.5 $0.00005 $0.00108
Haiku 4.5 $0.00002 $0.00054

Measured 2mo ago against content hash a5a326db0309, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

code-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 2mo 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/code-simplify.md · 46 lines

What it actually says

/code-simplify

Phase: 6 (meta) — clarity sweep Owning agent: .claude/agents/spring-code-reviewer.md Skills used: clarity-over-cleverness, tdd-red-green-refactor

Purpose

Apply the clarity-over-cleverness rules to a single file or a directory while keeping tests green. This is the same pass /build's simplify phase performs, but on demand.

Inputs

  • <path> (positional). A file under src/main/** or a directory.
  • Optional --dry-run to print proposed edits without writing.

Reads

  • <path> (the target file/directory).
  • .claude/skills/clarity-over-cleverness/SKILL.md (authoritative checklist).

Writes

  • The targeted files (in place).
  • A diff summary appended to .specs/<feature-id>/05-implementation-log.md under a ### simplify-pass block, or to a fresh clarity-pass-<date>.md if no active feature.

Process

  1. Refuse if mvn test is not green right now (run it first; abort on failure).
  2. For each file in scope, apply the 7 rewrite targets in order:
    1. Untangle nested ternaries → if/else.
    2. Streams only when clearer than a loop; otherwise loop.
    3. Inline once-used helpers.
    4. Kill option flags (split into two methods).
    5. Name domain concepts (no data, info, manager, helper, util).
    6. Remove premature abstraction (interface with one impl, factory with one product).
    7. Prefer early returns over deep nesting.
  3. Re-run mvn test after each file. If anything goes red, revert that file's edits and record it as a Skipped item.
  4. Emit a summary: files touched, rewrites applied per category, tests run, regressions encountered.

Refuse if

  • Tests are not green at start.
  • The path is under src/test/** (test clarity is governed by /test, not this command).

Done when

All in-scope files are either simplified or explicitly skipped, and tests are green.

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. 2mo ago First seen · 46 lines · 23 tokens per session scan A a5a326db0309

Subscribe to this mod's changes

code-simplify is a command published in the GitHub repository loiane/specs-driven-development-spring-angular (62 stars, last pushed 19d ago), licensed MIT. It adds 23 tokens to every session and 539 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-30.

Related

Other commands, from other repositories

devkit.github.review-pr

Provides comprehensive GitHub pull request review with code quality, security, and best practices analysis. Use when reviewing a PR before merging.

giuseppe-trisciuoglio/developer-kit · 26 tokens

devkit.java.code-review

Validates Java code quality for enterprise Spring applications with security, performance, architecture and best practices analysis. Use when reviewing code changes or before merging pull requests.

giuseppe-trisciuoglio/developer-kit · 31 tokens

sddp-qc

Command description: Run quality control against the implemented feature. Argument hint: [optional: testing focus such as unit tests, security audit, requirements sync] Command category: feature-delivery Prerequisites: spec, plan, tasks, implementation:complete.

attilaszasz/sdd-pilot · 0 tokens

util.gh-pr-review

Generate pull request review using architecture overview context.

stefaniuk/loadout · 8 tokens

review.speckit-code

Review the implementation against the entire spec-driven development documentation set (including the constitution) for compliance; detect and explain drift among code↔spec↔plan↔tasks - provide prioritised, actionable recommendations (including refactoring) to bring all artefacts into alignment.

stefaniuk/loadout · 53 tokens

review.speckit-test

Review the test automation implementation against the specification and the desired test pyramid shape; detect and explain misalignment - prioritise unit tests, identify high-value gaps and brittle tests, and provide actionable recommendations (including refactoring) to improve behavioural confidence.

stefaniuk/loadout · 47 tokens