claude-md-optimizer

claude-md-optimizer is a skill for Claude Code from CaesiumY/dding-dong. It costs 118 tokens per session (1,397 once invoked), scanned A, original, MIT.

A tool for shortening and improving a CLAUDE.md file, which contains instructions for an AI coding assistant working in a project. It keeps project-specific traps and unusual rules while removing details the assistant can discover from the code.

In plain words
What is it for?
Use it to analyse a CLAUDE.md file, find undocumented gotchas in the source, and produce either an updated file, a preview of changes, or a report.
Why use it?
It reduces repeated or unnecessary instructions that can make an assistant less effective, while preserving knowledge that is easy to miss by inspecting the repository.

Skill for Claude Code

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

Part of the dding-dong plugin — 12 skills, 4 hooks shipped together

Good fit Use it to analyse a CLAUDE.md file, find undocumented gotchas in the source, and produce either an updated file, a preview of changes, or a report.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/caesiumy/dding-dong/claude-md-optimizer
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 CaesiumY/dding-dong --skill claude-md-optimizer
Clone the repo
git clone --depth 1 https://github.com/CaesiumY/dding-dong

Made for: Claude Code.

Or install dding-dong, the plugin that ships this one along with the rest of its 12 skills, 4 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 claude-md-optimizer

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/caesiumy/dding-dong/claude-md-optimizer"><img src="https://agentmods.dev/badge/skills/caesiumy/dding-dong/claude-md-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,397 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.00118 $0.01397
Opus 5 $0.00059 $0.00698
Sonnet 5 $0.00024 $0.00279
Haiku 4.5 $0.00012 $0.00140

Measured 9d ago against content hash bca8e1faa993, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

claude-md-optimizer 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 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/line-count.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/skills/claude-md-optimizer/SKILL.md · 145 lines

How it starts

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

CLAUDE.md Optimizer

Optimize CLAUDE.md files by applying the discoverability filter: remove information agents can discover from code, keep only non-discoverable operational knowledge (gotchas, landmines, non-standard conventions), and mine source code for undocumented gotchas.

Research shows redundant context (directory trees, data flow diagrams) degrades agent performance by 15-20%, while human-authored operational knowledge reduces runtime by ~28%.

Flag Parsing

Parse $ARGUMENTS for optional flags:

Flag Effect
--dry-run Analyze and show diff without modifying the file
--report-only Output statistics and classification table only
--path <path> Target CLAUDE.md path (default: ./CLAUDE.md)
--help Display usage and exit

If --help is present, display available flags and a brief description of the 4-step workflow, then stop.

Workflow

Step 1: Baseline Analysis

Read the target CLAUDE.md. Collect line statistics:

node .claude/skills/claude-md-optimizer/scripts/line-count.mjs '<TARGET_PATH>'

Classify each ##/### section into one of three categories:

Category Meaning Action
discoverable Agent can find this via Glob/Grep/Read within 10 seconds Remove
operational Non-discoverable, operationally significant Keep
verbose Operational knowledge but overly detailed Compress

To classify, actually read the source files referenced in each section. Verify whether the information is truly discoverable. Detailed classification criteria are in references/methodology.md.

Present results as a table:

## Baseline Analysis — <filename>

Total: XXX lines (YY sections)

| Section | Lines | Category | Rationale |
|---------|-------|----------|-----------|
| Directory Structure | 63 | discoverable | Glob **/* reveals this instantly |
| Design Rules | 8 | operational | Non-standard constraints, not in code |
| Config & State | 24 | verbose | Operational but compressible to ~6 lines |

Removal candidates: XX lines (XX%)

Read the full file on GitHub · 145 lines

Files

What ships with it

4 files 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. 9d ago First seen · 145 lines · 118 tokens per session scan A bca8e1faa993

Subscribe to this mod's changes

claude-md-optimizer is a skill published in the GitHub repository CaesiumY/dding-dong (2 stars, last pushed 6mo ago), licensed MIT. It adds 118 tokens to every session and 1,397 once invoked, about $0.0006 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.

Related

Other skills, from other repositories

engram

Read and write the project's durable reasoning memory (decisions, principles, cautions, problems, insights) through the Engram MCP tools. Recall relevant memory before non-trivial work; capture only durable, high-value knowledge silently at natural stopping points; keep the graph honest (judge suspects, close answered…

techtheist/engram · 78 tokens

engram-digest

Seed or top up this project's Engram graph from the existing codebase — an explicit, user-invoked digestion of the current working tree into typed memory nodes (decisions, principles, cautions, problems, insights, intents). Use when the user says "digest this project", "ingest the codebase into memory", "seed the…

techtheist/engram · 98 tokens

persona-triggers

A detailed guide for matching Korean and English trigger phrases to working viewpoints, such as security, testing, design, operations, and AI. A trigger phrase is wording in a request that activates a particular response approach.

sodam-ai/SoDam-Persona · 91 tokens

persona-format

A Korean-language response format for coding, debugging, and implementation work. It asks for structured reasoning, multiple expert viewpoints, a recommended solution, execution steps, verification, and prevention of repeat problems.

sodam-ai/SoDam-Persona · 71 tokens

persona-marketer

A review guide for marketing and sales work, including copywriting, content, search visibility, advertising, landing pages, and customer retention. It looks at the work from the viewpoint of an experienced marketer and salesperson.

sodam-ai/SoDam-Persona · 94 tokens

persona-safety

A safety guide for coding, user-interface, security, deployment, deletion, and force-push work. It requires extra checks for secrets, sensitive data, risky changes, cleanup paths, and mobile layouts.

sodam-ai/SoDam-Persona · 69 tokens