Skip to content
claudemd-maintainer logo

CLAUDE.md Maintainer (Smart Router)

claudemd-maintainer

Context-aware guidance for maintaining and improving CLAUDE.md files. Use when editing CLAUDE.md, discussing documentation structure for AI assistants, or optimizing project instructions.

SKILL.md

Full skill instructions

CLAUDE.md Maintainer (Smart Router)

Purpose

Context-aware guidance for maintaining and improving CLAUDE.md files. Helps ensure the file stays effective, concise, and follows best practices for LLM instruction files.

When Auto-Activated

  • Editing or discussing CLAUDE.md
  • Keywords: claude.md, project instructions, onboarding claude, context file
  • Discussing documentation structure for AI assistants

🚨 CRITICAL RULES

  1. Keep under 300 lines - Research shows LLMs handle ~150-200 instructions reliably; performance degrades with more
  2. Never auto-generate - Manually craft each line; auto-generated content often contains noise
  3. Universal applicability only - Remove task-specific or narrow-scope guidance
  4. File references over code snippets - Code embeds become outdated; paths stay accurate

📊 Effective CLAUDE.md Principles

What To Include (WHAT, WHY, HOW)

CategoryIncludeAvoid
StackTechnologies, architecture overviewExhaustive dependency lists
Critical RulesMust-follow behaviors (consolidated)Duplicate rules across sections
Quick CommandsEssential build/​run commandsFull command reference
File ReferencesPaths to detailed guidesEmbedded code that can outdated
Common MistakesDocumented actual failuresHypothetical warnings

What To Exclude

  • Code style guidelines → Use linters instead (SwiftFormat, ESLint, etc.)
  • Exhaustive command references → Point to tool documentation
  • Task-specific instructions → Put in skills or separate docs
  • Code snippets → Use file:line references instead

🎯 Progressive Disclosure Pattern

Level 1: CLAUDE.md (~100-150 lines ideal, max 300)
├─ Critical rules (must-follow behaviors)
├─ Quick start (essential commands only)
├─ High-level architecture
└─ Pointers to Level 2 and 3

Level 2: Skills (.claude/​skills/)
├─ Domain-specific quick references
├─ Decision trees and workflows
└─ "→ Routes to" comprehensive docs

Level 3: Specialized Guides
├─ Complete technical documentation
├─ Full examples and edge cases
└─ Troubleshooting guides

📋 Quick Audit Checklist

When reviewing CLAUDE.md:

  • Line count under 300? (wc -l CLAUDE.md)
  • No duplicate rules? (Search for repeated concepts)
  • Code snippets minimized? (Replace with file path references)
  • Narrow-scope items removed? (Move to skills)
  • Critical rules consolidated? (Single authoritative location)
  • File references current? (Paths still valid)
  • Common mistakes documented? (Actual failures, not hypotheticals)

🔄 Optimization Workflow

Reducing Line Count

  1. Find duplicates: Search for repeated concepts

    # Find potential duplicates
    grep -n "NEVER" CLAUDE.md | head -20
    
  2. Consolidate rules: Move all critical rules to one section

  3. Replace code with references:

    # ❌ Before (takes 10+ lines)
    ### Typography
    ```swift
    AnytypeText("Title", style: .uxTitle1Semibold)
    AnytypeText("Body", style: .bodyRegular)
    

    ✅ After (1 line)

    Typography → path/​to/​TYPOGRAPHY_MAPPING.md

  4. Move narrow guidance to skills: If it applies to < 20% of tasks, it's a skill

Adding New Guidance

Before adding, ask:

  1. Does this apply to most tasks? (If no → skill or specialized doc)
  2. Is there existing guidance? (If yes → consolidate, don't duplicate)
  3. Can a linter/​tool enforce this? (If yes → use the tool instead)
  4. Will this code example outdated quickly? (If yes → use file reference)

⚠️ Common Mistakes

Accumulating Hotfixes

# ❌ WRONG - Adding one-off rules
### Special Note (2025-01-15)
Remember to always check X when doing Y...

# ✅ CORRECT - Add to appropriate skill or remove

Duplicating Rules

# ❌ WRONG - Same rule in 3 places
## Critical Rules: NEVER add AI signatures
## Pre-Commit: NO AI signatures
## PR Format: No "Generated with Claude"

# ✅ CORRECT - Single consolidated rule
## Critical Rules
2. **NEVER add AI signatures anywhere** - No Co-Authored-By, no emoji signatures

Embedding Code That Outdates

# ❌ WRONG - Code will outdated
```swift
Image(asset: .X32.qrCode)  // What if asset name changes?

✅ CORRECT - File reference stays accurate

Icons → Modules/​Assets/​.../​ImageAsset.swift:45


## 📚 Research & Best Practices

**Source**: Based on industry practices and LLM behavior research

### Key Findings
- LLMs handle ~150-200 instructions reliably
- Performance degrades with additional instructions
- Irrelevant context may be ignored entirely (Claude adds "this context may or may not be relevant")
- Code snippets in docs become maintenance burden
- Progressive disclosure reduces context overhead

### Recommended Metrics
| Metric | Target | Max |
|--------|--------|-----|
| Total lines | 100-150 | 300 |
| Code blocks | 2-4 | 6 |
| Critical rules | 3-5 | 10 |
| Sections | 6-8 | 12 |

## 🔗 Related

- `.claude/​skills/​README.md` - Skills system overview
- `.claude/​skills/​skills-manager/​SKILL.md` - Managing the skills system
- Progressive disclosure architecture documentation

---

**Navigation**: This skill helps maintain CLAUDE.md quality. For skills system management, see `skills-manager`. For adding new skills, see `.claude/​skills/​README.md`.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View