code-simplification

code-simplification is a skill for Claude Code, Codex from shennawardana23/skillme. It costs 74 tokens per session (1,671 once invoked), scanned A, original, Apache-2.0.

A code-cleanup skill for making working code easier to read while keeping its behavior unchanged.

In plain words
What is it for?
Use it to simplify code after it works, especially when maintenance or code review has exposed avoidable complexity.
Why use it?
It reduces confusing nesting, vague names, unused code, and unnecessary abstractions without adding features.

Skill for Claude CodeCodex

Part of the skillme plugin — 137 skills, 2 commands shipped together

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 skills/shennawardana23/skillme/code-simplification
Any agent
npx skills add shennawardana23/skillme --skill code-simplification
Clone the repo
git clone --depth 1 https://github.com/shennawardana23/skillme

Made for: Claude Code, Codex.

Or install skillme, the plugin that ships this one along with the rest of its 137 skills, 2 commands.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/shennawardana23/skillme/code-simplification.svg)](https://agentmods.dev/skills/shennawardana23/skillme/code-simplification)
Your own site
<a href="https://agentmods.dev/skills/shennawardana23/skillme/code-simplification"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/code-simplification.svg" alt="Measured on agentmods" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,671 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.00074 $0.01671
Opus 5 $0.00037 $0.00835
Sonnet 5 $0.00015 $0.00334
Haiku 4.5 $0.00007 $0.00167

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

Security

Grade A, and why

code-simplification 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 4d 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.

skills/code-simplification/SKILL.md · 115 lines

How it starts

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

Code Simplification

Simplify code by reducing complexity while preserving exact behavior. The goal is not fewer lines — it's code a new team member would understand faster than the original. Every change must pass that test.

When NOT to use: the code is already clean; you don't yet understand what it does (comprehend first); it's performance-critical and the simpler version would be measurably slower; you're about to rewrite the module entirely (don't polish throwaway code).

The five principles

  1. Preserve behavior exactly. Same output for every input, same error behavior, same side effects and ordering, all existing tests pass unmodified. If you're not sure a change preserves behavior, don't make it.
  2. Follow project conventions. Simplification means matching the codebase's existing style for imports, error handling, naming, and type annotation depth — not imposing outside preferences. Simplification that breaks project consistency is churn, not simplification.
  3. Prefer clarity over cleverness. Explicit code beats compact code whenever the compact version needs a mental pause to parse — e.g. replace a dense nested ternary chain with a small function of if returns; replace a chained reduce doing inline mutation with a named Map built in a loop.
  4. Maintain balance — don't over-simplify. Watch for: inlining away a helper that gave a concept a name; merging two simple functions into one complex one; removing an abstraction that exists for extensibility or testability, not complexity; optimizing for line count instead of comprehension.
  5. Scope to what changed. Default to simplifying recently modified code. Don't drive-by refactor unrelated code unless asked — it creates diff noise and regression risk.

Process

Step 1 — understand before touching (Chesterton's Fence)

Before changing or removing anything, answer: what is this code's responsibility? What calls it, what does it call? What are its edge cases and error paths? Why might it have been written this way — performance, a platform constraint, history? Check git blame for the original context. If you can't answer these, read more before simplifying.

Read the full file on GitHub · 115 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 115 lines · 74 tokens per session scan A 477b90982118

Subscribe to this mod's changes

code-simplification is a skill published in the GitHub repository shennawardana23/skillme (2 stars, last pushed 7d ago), licensed Apache-2.0. It adds 74 tokens to every session and 1,671 once invoked, about $0.0004 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.