simplify

simplify is a skill for Claude Code, Codex from epicsagas/epic-harness. It costs 26 tokens per session (762 once invoked), scanned A, original, Apache-2.0.

A code-cleanup guide for making complicated files and functions easier to read and maintain.

In plain words
What is it for?
Use it to measure complexity, split code by responsibility, extract functions or constants, improve names, and remove unused or unreachable code.
Why use it?
It helps reduce deep nesting, repeated code, oversized functions, and unclear names that make changes risky.

Skill for Claude CodeCodex

Part of the epic plugin — 27 skills, 6 hooks 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/epicsagas/epic-harness/simplify
Any agent
npx skills add epicsagas/epic-harness --skill simplify
Clone the repo
git clone --depth 1 https://github.com/epicsagas/epic-harness

Made for: Claude Code, Codex.

Or install epic, the plugin that ships this one along with the rest of its 27 skills, 6 hooks.

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/skills/epicsagas/epic-harness/simplify.svg)](https://agentmods.dev/skills/epicsagas/epic-harness/simplify)
Your own site
<a href="https://agentmods.dev/skills/epicsagas/epic-harness/simplify"><img src="https://agentmods.dev/badge/skills/epicsagas/epic-harness/simplify.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 762 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.00026 $0.00762
Opus 5 $0.00013 $0.00381
Sonnet 5 $0.00005 $0.00152
Haiku 4.5 $0.00003 $0.00076

Measured today against content hash 8ebf46449a61, 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 today.

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/simplify/SKILL.md · 77 lines

How it starts

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

Simplify — Code Simplification

When to Trigger

  • File exceeds 500 lines
  • Function exceeds 40 lines or nesting exceeds 3 levels of control flow
  • Repeated copy-paste blocks (same shape, 2+ sites)
  • "This is getting hard to follow" feeling

Process

1. Measure

  • Line count, function count, nesting depth
  • Identify the longest/most complex function

Why: You cannot improve what you cannot quantify. Baseline metrics prove simplification actually happened and prevent subjective "it feels cleaner" claims.

2. Extract

  • Extract function: Turn a code block into a named function
  • Extract constant: Replace magic numbers/strings
  • Extract module: Split large files by responsibility

Why: Named abstractions replace "what does this block do?" with "what does this function promise?" — reducing cognitive load per reading unit.

3. Rename

  • Variables: describe what it holds, not how it's computed
  • Functions: describe what it does, not how
  • Files: match the primary export/class

Why: Precise names eliminate the need for comments and make wrong code look wrong. A reader should understand intent from names alone.

4. Reduce

  • Remove dead code (unused imports, unreachable branches)
  • Replace imperative loops with declarative (map, filter, reduce)
  • Merge duplicate logic into shared utility

Why: Every line of code is a line someone must read, understand, and maintain. Fewer lines with the same behavior means lower lifetime cost.

5. Verify

  • All tests still pass after simplification
  • No behavior changes — only structural improvements

Why: Simplification that breaks behavior is not simplification — it is a regression. Tests are the safety net that makes structural changes safe.

Constraints

  • One simplification at a time — verify between each
  • Never simplify and add features in the same change

Anti-Rationalization

Excuse Rebuttal What to do instead
"We might need this later" YAGNI. Code you don't need is code you maintain for free. Add it when you need it. Delete it. When the need arises, write it with current context — not stale assumptions.
"This abstraction makes it more flexible" Flexibility without a concrete use case is complexity. Simple code is flexible code. Abstract only after you see the second use case. Two concrete examples beat one imagined future.
"It's already working, don't touch it" Chesterton's Fence: understand why it exists first. But if it's needlessly complex, simplify it. Understand it, write tests for it, then simplify it. Working code that nobody can read is a ticking bomb.

Read the full file on GitHub · 77 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. today Changed · -1 lines · -6 tokens per session 8ebf46449a61
  2. 4d ago First seen · 78 lines · 32 tokens per session scan A dc612e213e2d

Subscribe to this mod's changes

simplify is a skill published in the GitHub repository epicsagas/epic-harness (17 stars, last pushed today), licensed Apache-2.0. It adds 26 tokens to every session and 762 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.

Related

Other skills, from other repositories

mcporter

List, auth, and call MCP servers/tools from the terminal.

NousResearch/hermes-agent · 16 tokens

article-writing

Write articles, guides, blog posts, tutorials, newsletter issues, and other long-form content in a distinctive voice derived from supplied examples or brand guidance. Use when the user wants polished written content longer than a paragraph, especially when voice consistency, structure, and credibility matter.

affaan-m/ECC · 57 tokens

sector-rotation

行业轮动分析——申万行业景气度评分、行业动量排名、产业链传导、估值/盈利/资金流多维比较框架.

HKUDS/Vibe-Trading · 39 tokens

mem0-oss-to-platform

Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…

mem0ai/mem0 · 273 tokens

complete-partial-pr

Evaluate and complete an issue or PR where the submitted patch fixes only a narrow symptom of the reported pain point. Use when a contribution may miss adjacent integration surfaces, provider/spec semantics, roundtrip behavior, tests, docs, or historical maintainer decisions.

pydantic/pydantic-ai · 55 tokens

deploy-docker-compose

Run the Omnigent server as a Docker compose stack (server + Postgres) on any Docker host — your laptop, a VPS, EC2 by hand, or as the base layer of any container-platform deploy. Invoke when the user wants to build the image, bring up the compose stack, debug the stack on a host they already have, or extend the stack…

omnigent-ai/omnigent · 84 tokens