simplify

A command that reviews changed code for unnecessary complexity, duplication, dead code, naming problems, and inefficient work, then applies safe fixes.

In plain words
What is it for?
Use it after making code changes to inspect the diff, simplify files, and run the project’s checks.
Why use it?
It helps keep recent changes easier to understand and maintain without requiring a separate manual cleanup pass.

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/xsovad06/sova/simplify
Clone the repo
git clone --depth 1 https://github.com/xsovad06/sova

Made for: Claude Code.

Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 438 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.00020 $0.00438
Opus 5 $0.00010 $0.00219
Sonnet 5 $0.00004 $0.00088
Haiku 4.5 $0.00002 $0.00044

Measured 2d ago against content hash e926ba452e1b, 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 2d 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 · 68 lines

What it actually says

Simplify

Review all changed code for opportunities to reduce complexity, eliminate duplication, and improve quality.

Scope: $ARGUMENTS

Instructions

Step 1: Get the Diff Scope

git diff main..HEAD --stat
git diff --cached --stat
git diff --stat

Step 2: Review Each Changed File

For each changed file, read the entire file and check:

  • Code reuse: does new code duplicate existing utilities or helpers? Search the codebase for similar patterns.
  • Over-engineering: unnecessary abstractions, premature generalization, excessive configurability for one-time operations.
  • Dead code: unused imports, unreachable branches, commented-out code.
  • Redundancy: repeated logic that could be a shared helper (only if 3+ occurrences).
  • Complexity: can any function be simplified without losing clarity?
  • Efficiency: redundant computations, repeated file reads, duplicate API calls.
  • Naming: unclear variable or function names that could be more descriptive.

Step 3: Apply Simplifications

Apply each simplification directly. After changes, verify tests still pass:

{{ check_cmd }}

If a simplification is risky, skip it -- only apply safe, clear improvements.

Step 4: Summary

If no simplifications are needed, state that explicitly.

If changes were made, summarize:

## Simplification Summary

**Changes applied**: N
- [brief description of each change]

**Tests**: passing

Rules

  • Do NOT reformat code that was not changed in this branch.
  • Do NOT add docstrings, comments, or type annotations to unchanged code.
  • Do NOT create abstractions for fewer than 3 occurrences.
  • Do NOT add error handling for scenarios that cannot happen.
  • Three similar lines of code is better than a premature abstraction.
  • NEVER use emojis in any output.
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. 2d ago First seen · 68 lines · 20 tokens per session scan A e926ba452e1b

Subscribe to this mod's changes

simplify is a command published in the GitHub repository xsovad06/sova (2 stars, last pushed 2d ago), licensed Apache-2.0. It adds 20 tokens to every session and 438 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-31.