code-simplifier

code-simplifier is a skill for Claude Code from kopp0510/claude-dd. It costs 78 tokens per session (955 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 955 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.00955
Opus 5.5 $0.00031 $0.00382
Sonnet 5.5 $0.00016 $0.00191
Haiku 4.5 $0.00008 $0.00096

Measured 1mo ago against content hash 69f36f438e73, 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 1mo 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。 專案有 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 簽名;有測試必須全過。
輸出:簡化摘要 + 關鍵變更的 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. 1mo ago Changed · +4 lines 69f36f438e73
  2. 1mo ago Changed · +2 lines 67296d3f1776
  3. 1mo ago Changed 6886979038b9
  4. 1mo 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 yesterday), licensed MIT. It adds 78 tokens to every session and 955 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

Other skills, from other repositories

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

openclaw/clawhub · 17 tokens

omh-code-review

This is an OMH code-review workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).

rlaope/oh-my-hermes · 48 tokens

revdiff-plan

Review the last Codex assistant message (plan, analysis, or proposal) with inline annotations in a TUI overlay. Extracts the most recent response from Codex rollout files and opens it in revdiff for review and annotation. Activates on "revdiff-plan", "review plan with revdiff", "annotate plan", "review last response"…

umputun/revdiff · 84 tokens

asplos-writing-style

Use when drafting or revising ASPLOS prose — engineering the first two pages that rapid review actually reads, stating the cross-layer insight as one quotable sentence, structuring per-layer mechanism sections, writing bounded claims, and fitting everything into 11 self-contained pages that include figures and…

brycewang-stanford/Awesome-Journal-Skills · 65 tokens

explore-unknowns

Guide the user through a quadrant walk that maps the unknowns of a task — open by listing the known knowns, then work through known unknowns, unknown knowns, and unknown unknowns one stage at a time, ending with a complete four-quadrant map in the user's hands. Use when a request is ambiguous or underspecified, the…

dzhng/skills · 162 tokens

ring:mapping-feature-relationships

Mapping how features relate and phasing the work: categorizing PRD features, grouping them into domains, charting cross-feature journeys, dependencies, and integration points, and defining the binding Phases that plan.md mirrors one-to-one at Gate 7. Gate 2 of ring:planning-large-features; runs after…

LerianStudio/ring · 104 tokens