agents-md-optimizer

agents-md-optimizer is a skill for Claude Code, Codex from MSApps-Mobile/claude-plugins. It costs 208 tokens per session (2,383 once invoked), scanned A, original, MIT.

A tool for reviewing or writing CLAUDE.md and AGENTS.md files, which contain instructions for coding agents. It applies a short “recipe book” structure so essential rules stay easy to scan.

In plain words
What is it for?
Use it to audit an existing instruction file, rewrite it with an extraction plan, or create one for a new project.
Why use it?
Instruction files often grow into long tutorials, copied documentation, or outdated notes that consume context and distract the agent. This identifies that excess and proposes a leaner structure.

Skill for Claude CodeCodex

Part of the agents-md-optimizer plugin — 1 skill 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/msapps-mobile/claude-plugins/agents-md-optimizer
Any agent
npx skills add MSApps-Mobile/claude-plugins --skill agents-md-optimizer
Clone the repo
git clone --depth 1 https://github.com/MSApps-Mobile/claude-plugins

Made for: Claude Code, Codex.

Or install agents-md-optimizer, the plugin that ships this one along with the rest of its 1 skill.

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 agents-md-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/msapps-mobile/claude-plugins/agents-md-optimizer.svg)](https://agentmods.dev/skills/msapps-mobile/claude-plugins/agents-md-optimizer)
Your own site
<a href="https://agentmods.dev/skills/msapps-mobile/claude-plugins/agents-md-optimizer"><img src="https://agentmods.dev/badge/skills/msapps-mobile/claude-plugins/agents-md-optimizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 208 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,383 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.00208 $0.02383
Opus 5 $0.00104 $0.01192
Sonnet 5 $0.00042 $0.00477
Haiku 4.5 $0.00021 $0.00238

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

Security

Grade A, and why

agents-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 3d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/audit.py), 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.

plugins/agents-md-optimizer/skills/agents-md-optimizer/SKILL.md · 156 lines

How it starts

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

agents-md-optimizer

What this skill does

CLAUDE.md is loaded into every Claude session for the project it belongs to. That means every line is a recurring tax on the context window — paid before any real work starts, across every session, forever. Most CLAUDE.md files drift into bloat: people copy-paste API docs, write step-by-step tutorials, hoard historical state, stack negative "don't do X" rules. The result is a ~2,000-token baseline cost that degrades focus and wastes budget.

The fix is to treat CLAUDE.md like a focused recipe book: essential guidance only, everything else extracted to a location that loads on-demand. This skill does two things:

  1. Audit mode — read an existing CLAUDE.md, diagnose what's bloat, and produce a slimmed rewrite plus an extraction plan (what moves where).
  2. Author mode — interview about a new project and write a lean CLAUDE.md from scratch using the template.

When to pick a mode

Detect mode from input:

  • The user points at an existing file, or one is visible in context → audit mode.
  • The user wants a fresh CLAUDE.md for a new or undocumented project → author mode.
  • Both (they showed a file but also want a rewrite philosophy applied to a second project) → run audit first, carry the principles into the author pass.

If it's ambiguous, ask one clarifying question: "Are we trimming an existing one, or writing a new one?"

The four-layer hierarchy — know where things actually belong

Every recommendation in this skill depends on understanding that CLAUDE.md isn't monolithic. Claude loads four layers in precedence order:

  1. Enterprise policy — organization-wide, set by admins.
  2. ./CLAUDE.md — project-level, committed to the repo. This is what most people mean by "CLAUDE.md." Shared with every collaborator.
  3. ~/.claude/CLAUDE.md — user-level, personal defaults that apply across every project. Communication prefs, your own account info, your shell aliases.
  4. ./CLAUDE.local.md — project-local overrides, gitignored. Personal notes about this specific repo that shouldn't be shared with collaborators.

Read the full file on GitHub · 156 lines

Files

What ships with it

3 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. 3d ago First seen · 156 lines · 208 tokens per session scan A 8091e5db2c90

Subscribe to this mod's changes

agents-md-optimizer is a skill published in the GitHub repository MSApps-Mobile/claude-plugins (9 stars, last pushed 7d ago), licensed MIT. It adds 208 tokens to every session and 2,383 once invoked, about $0.0010 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

extract

Run the full Semantica semantic extraction pipeline on a file or selected text — NER, relations, events, coreference resolution, triplets, and validation. Clears result cache before each run. Returns Markdown tables with entity/relation/event/triplet results and inline validator warnings.

semantica-agi/semantica · 59 tokens

watch

File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills. Poll-based via git diff against the last scan commit. Writes intake items for batch processing and routes marker actions through /do. Use for automatic reactions to file changes; do NOT use for…

SethGammon/Citadel · 70 tokens

review

5-pass structured code review — correctness, security, performance, readability, consistency.

SethGammon/Citadel · 17 tokens

live-preview

Mid-build visual verification loop. Takes screenshots of components during construction, not just after. Catches visual regressions and invisible features before they compound. Requires Playwright or similar screenshot tool.

SethGammon/Citadel · 40 tokens

marshal

Meta-orchestrator that takes any direction — broad, specific, or vague — and autonomously chains skills and context into actionable work. Gathers context from codebase, docs, and memory. Only asks the user when it genuinely cannot proceed. Single-session orchestrator.

SethGammon/Citadel · 56 tokens

wiki

Markdown-first knowledge base where the LLM acts as librarian. Ingests raw sources, compiles and interlinks topic files, self-maintains an index. No vector DB or embeddings required -- uses LLM-native navigation over structured markdown up to 400K words.

SethGammon/Citadel · 56 tokens