maintain-claude-md

maintain-claude-md is a command for Claude Code from acaprino/daodan. It costs 68 tokens per session (4,844 once invoked), scanned A, original, MIT.

A command for auditing and maintaining an existing CLAUDE.md file, which gives Claude Code instructions for a project. It compares the document with the current codebase before suggesting changes.

In plain words
What is it for?
It helps review project instructions, report discrepancies, request approval, and update or move documentation when needed.
Why use it?
It finds outdated or unsupported instructions while preserving correct existing information and keeping the file within its size limit.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; mentions subagents; names the AskUserQuestion tool.

Part of the project-setup plugin — 2 commands, 1 agent shipped together

Good fit It helps review project instructions, report discrepancies, request approval, and update or move documentation when needed.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/acaprino/daodan/maintain-claude-md
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.

Clone the repo
git clone --depth 1 https://github.com/acaprino/daodan

Made for: Claude Code.

Or install project-setup, the plugin that ships this one along with the rest of its 2 commands, 1 agent.

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 maintain-claude-md

README.md
[![agentmods](https://agentmods.dev/badge/commands/acaprino/daodan/maintain-claude-md/github.svg)](https://agentmods.dev/commands/acaprino/daodan/maintain-claude-md)
Your own site
<a href="https://agentmods.dev/commands/acaprino/daodan/maintain-claude-md"><img src="https://agentmods.dev/badge/commands/acaprino/daodan/maintain-claude-md/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 maintain-claude-md

Your own site · 80×15
<a href="https://agentmods.dev/commands/acaprino/daodan/maintain-claude-md"><img src="https://agentmods.dev/badge/commands/acaprino/daodan/maintain-claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,844 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.00068 $0.04844
Opus 5 $0.00034 $0.02422
Sonnet 5 $0.00014 $0.00969
Haiku 4.5 $0.00007 $0.00484

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

Security

Grade A, and why

maintain-claude-md 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 7d 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.

exports/claude/plugins/project-setup/commands/maintain-claude-md.md · 334 lines

How it starts

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

Maintain CLAUDE.md File

CRITICAL RULES

  1. Keep CLAUDE.md under 40,000 characters. This is a hard cap (Claude Code surfaces a performance warning above this threshold). Run wc -c CLAUDE.md after every edit. Target <35k to leave headroom. If the audit finds the file already over 40k, the primary fix is to extract sections to docs/<topic>.md and replace them with thin Read docs/<topic>.md pointers. Never finalize an edit that leaves the file over 40k.
  2. Verify against codebase. Every claim in CLAUDE.md must be checked against actual files, commands, and dependencies.
  3. Show findings before changing. Present the audit report and get approval before modifying anything.
  4. Preserve existing content by default. NEVER remove existing references, sections, paragraphs, bullets, or pointers from CLAUDE.md unless a cross-verification against the codebase, dependency manifests, or external sources proves them false or obsolete. Length, perceived redundancy, "old-style" formatting, or personal aesthetic preference are NOT valid reasons to remove content. Extraction to docs/<topic>.md with a pointer is acceptable (the information stays accessible); silent deletion is not.
  5. ALWAYS ask the user about every drift identified. For each drift (incorrect path, broken command, obsolete dependency, missing claim, stale code snippet, internal duplication candidate flagged by Phase 4b, oversized section, anything else flagged by the audit), the agent MUST surface it to the user via AskUserQuestion and let the user decide the action. Do NOT batch-apply fixes autonomously, even for "obviously correct" critical issues. Dedup merges are deletions of the redundant occurrences and fall under the same per-item gate (rule 4 + rule 5). The audit report enumerates findings; the user chooses, per finding, among concrete options such as [fix as proposed / keep verbatim / extract to docs/<topic>.md with pointer / merge into the most actionable occurrence / replace with cross-reference / skip for now / other]. Default action on a finding the user has not yet decided is leave unchanged. The only edits the agent applies without per-item confirmation are the user's already-given answers, in the same session.
  6. Never delete user preferences unless the user explicitly approves. Preferences (coding style, workflow choices) are intentional.
  7. Never enter plan mode. Execute immediately.
  8. Backfill the canonical Working Principles block. Audit is not just detection - it is active upgrade. Maintain MUST always check and propose insertion of the canonical ## Working Principles block, independent of other findings. Three states to handle, all severity High:
    • Block missing entirely: insert verbatim (5 principles, with 3 sub-bullets under each of principles 1-4).
    • Block present, missing one or more principles (in particular the locally authored #5 Centralize Shared Logic, which CLAUDE.md files created before plugin v1.12.0 will not contain): insert the missing principles surgically without rewriting unrelated user additions.
    • Block present with all 5 principles, but missing the 3 sub-bullets under principles 1-4 (the case for any CLAUDE.md created before plugin v1.14.0): insert the sub-bullets in place via surgical Edit. Never substitute the block with an external GitHub link or a docs/agentic-coding-guidelines.md pointer. The deeper meta-rules ship as inline sub-bullets so the block is self-contained.
  9. Verify the canonical Test-Suite Rules block (conditional). When the project has a test suite (test directories or runner config present), check the presence and integrity of the canonical ## Test-Suite Rules block (7 rules, see the agent's CONDITIONAL SECTION). Missing, gutted, or weakened (a rule rewritten to permit what it forbids) is a High finding surfaced per rule 5, with an offer to insert the canonical text verbatim. When the project has no tests, absence is correct and is NOT a finding.

Read the full file on GitHub · 334 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. 7d ago First seen · 334 lines · 68 tokens per session scan A d03ef411399b

Subscribe to this mod's changes

maintain-claude-md is a command published in the GitHub repository acaprino/daodan (9 stars, last pushed yesterday), licensed MIT. It adds 68 tokens to every session and 4,844 once invoked, about $0.0003 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-09-05.