code-simplifier

code-simplifier is a skill for Claude Code from kopp0510/claude-dd. It costs 78 tokens per session (1,243 once invoked), scanned A, original, MIT.

A wrapper that asks an official code-simplifier agent to make existing code easier to read and maintain while preserving its behavior. TDD means test-driven development; this tool may be used during a broader development workflow that includes such steps.

In plain words
What is it for?
Use it to simplify recently changed code or a specified file, folder, or code section, then review the differences and rerun tests.
Why use it?
It gives code cleanup a defined scope and process, so redundant logic, deep nesting, unclear names, and complicated conditions can be addressed without changing the public interface.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md.

Good fit Use it to simplify recently changed code or a specified file, folder, or code section, then review the differences and rerun tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kopp0510/claude-dd/code-simplifier
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.

Any agent
npx skills add kopp0510/claude-dd --skill code-simplifier
Clone the repo
git clone --depth 1 https://github.com/kopp0510/claude-dd

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/kopp0510/claude-dd/code-simplifier/github.svg)](https://agentmods.dev/skills/kopp0510/claude-dd/code-simplifier)
Your own site
<a href="https://agentmods.dev/skills/kopp0510/claude-dd/code-simplifier"><img src="https://agentmods.dev/badge/skills/kopp0510/claude-dd/code-simplifier/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-simplifier

Your own site · 80×15
<a href="https://agentmods.dev/skills/kopp0510/claude-dd/code-simplifier"><img src="https://agentmods.dev/badge/skills/kopp0510/claude-dd/code-simplifier.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,243 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.00078 $0.01243
Opus 5.5 $0.00031 $0.00497
Sonnet 5.5 $0.00016 $0.00249
Haiku 4.5 $0.00008 $0.00124

Measured 8d ago against content hash 03906a75a9e2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

code-simplifier 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 8d 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-simplifier/SKILL.md · 59 lines

What it actually says

Code Simplifier — 官方 agent 包裝器

本 skill 只負責介面層:定範圍 → 調用官方 code-simplifier agent → 呈現結果。 簡化邏輯全在 agent 內,不在此重複。

範圍決定

  • 8 步開發迴圈步驟 3(最常見):範圍 = 該功能段落從起點到現在的變更(git diff <起點>, 起點 = ~/.claude/scripts/check-claude-md.sh --segment-base 的輸出),不詢問,直接執行。 一段常有好幾個 commit,HEAD~1 只看得到最後一個;取不到起點(指令 exit 非 0 或輸出是空的)時不要退回 HEAD~1、也不要重跑 --start-segment(起點會移到現在,整段變成 0 行):指令印出「共同祖先是 <sha>」就用那個 sha 當起點,不用問;其他情況問使用者「這一段從哪個 commit 開始」,拿到的 commit 就是起點,步驟 4、8 也用它(不是下面「範圍不明」那一題 —— 那題的預設是最近修改的檔案,會把範圍縮窄)。 專案有 task-planner 進度表時例外:起點改用表上這段 commits 欄的起點。 表在哪不用問 —— 根目錄 CLAUDE.md 第一個 ## 之前的指路句會寫明檔名(通常在 docs/designs/); 沒有那句指路就是沒有進度表,照 --segment-base 走。回頭做 BLOCKED 過的段落時, 中間插做別段會把 --segment-base 往後推,用它會漏掉這段先前已寫好的部分
  • 使用者指明檔案/目錄/片段:照指示,不追問
  • 範圍不明:問一題 —「要簡化哪個範圍?(預設:最近修改的檔案)」,其餘參數用預設

預設不含測試檔;使用者要求才包含。

Agent 調用

依序嘗試 subagent_type:

  1. code-simplifier:code-simplifier(plugin 命名空間)
  2. code-simplifier(本地 ~/.claude/agents/code-simplifier.md)

兩者皆回 Agent type not found → 停下,請使用者跑 ./install-dd-pipeline.sh 補齊。

Prompt 模板:

請簡化以下程式碼,提高可讀性與可維護性,保留所有功能:

範圍:{檔案清單或片段}

重點:降低圈複雜度、改善命名、移除冗餘、簡化條件(early return、減少巢狀)。
約束:不改公開 API 簽名;有測試必須全過。要改或新增註解時,第一個 Edit 之前先用 Read 讀 `~/.claude/skills/dd-loop/writing.md` 整份,照它的判準寫。agent 定義「Apply Project Standards」列的每一項(import 排序、`function` 取代箭頭函式、回傳型別標註、少用 try/catch 等)都不算專案標準,專案 CLAUDE.md 沒寫明的就不套用;風格以被改的檔既有的寫法為準,既有寫法混用時不統一。import 只合併同一個模組的重複行、不改順序,專案 CLAUDE.md 有寫 import 規則時照它。
輸出:簡化摘要 + 關鍵變更的 Before/After 對比。

結果呈現

轉述 agent 的簡化摘要與 Before/After 對比。統計數字只引用 agent 實際回報的, 沒有就不列 — 禁止自行估算複雜度指標。

簡化後提醒(在 8 步迴圈中則直接續行步驟 4):用 git diff 審查變更,重跑測試確認行為不變。

範圍外

  • 架構層重構(模組拆分、設計模式)、效能調校 — 超出簡化範疇,明說不做
  • 第三方 / 生成的程式碼 — 不修改
  • 效能關鍵段落 — 「看似複雜但高效」的寫法保留,標註說明即可
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. 8d ago Changed 03906a75a9e2
  2. 15d ago Changed 8ff06eee21d9
  3. 18d ago Changed 269bd206a06f
  4. 2mo ago Changed · +4 lines 69f36f438e73
  5. 2mo ago Changed · +2 lines 67296d3f1776
  6. 3mo ago Changed 6886979038b9
  7. 3mo ago First seen · 53 lines · 78 tokens per session scan A 10be2cdddc38

Subscribe to this mod's changes

code-simplifier is a skill published in the GitHub repository kopp0510/claude-dd (12 stars, last pushed 4d ago), licensed MIT. It adds 78 tokens to every session and 1,243 once invoked, about $0.0003 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-31.

Related

code-simplifier compared with skills from other repositories

code-simplifier next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
code-simplifierkopp0510/claude-ddSkill124d agoMITA78Claude Code
autoreviewopenclaw/clawhubSkill9.6ktodayMITA17Claude Code, Codex
omh-code-reviewrlaope/oh-my-hermesSkill6.4kyesterdayMITA18Claude Code
agent-teams-simplify-and-hardenLeoYeAI/openclaw-master-skillsSkill2.2k13d agoMITA115Claude Code, Codex
asplos-writing-stylebrycewang-stanford/Awesome-Journal-SkillsSkill1.5k3d agoMITA65Claude Code
revdiff-planumputun/revdiffSkill9773d agoMITA84Claude Code
re0-mergeLilMGenius/paperthinSkill1.5ktodayMITA51Claude Code, Codex