Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Initialize or migrate to nested CLAUDE.md structure for progressive disclosure. Claude auto-loads CLAUDE.md from any directory it enters, so nested files get discovered automatically. Use when setting up a new project's agent config, refactoring a bloated CLAUDE.md, or adding progressive disclosure to an existing repo. Triggers on: '/agent-init-deep', 'setup progressive disclosure', 'refactor claude.md', 'split claude.md', 'claude.md is too big'.
.claude/skills/majiayu000-agent-init-deep/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-17 | ✗→✓ | ▲ Improved | 28% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 50% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 4% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 83% | 0% |
Set up or migrate to a progressive disclosure CLAUDE.md structure using docs/agents/ for topic-specific guidance.
Static (root CLAUDE.md) — loaded every conversation, minimal, high-value
Semi-dynamic (docs/agents/) — linked from root, loaded on-demand when relevant
Fully dynamic (skills) — triggered by metadata match, loaded only when invokedRoot CLAUDE.md should be ~40-50 lines. Everything else belongs in docs/agents/ or skills.
CLAUDE.md # Root: identity, tech stack, key rules, workflow, links
docs/agents/
├── tooling.md # e.g. package manager, linting, formatting, hooks
├── commands.md # e.g. script execution, build filters, passing args
├── guardrails.md # e.g. data isolation, secrets, library docs
├── definition-of-done.md # e.g. coverage, lint, type-check, format requirements
└── [topic].md # Additional topic-specific files as neededCheck for:
- CLAUDE.md exists?
- docs/agents/ exists?
- How many lines is CLAUDE.md?If no CLAUDE.md → Greenfield path If CLAUDE.md exists → Migration path
Ask the user:
Then generate:
Root CLAUDE.md with:
docs/agents/ files based on answers. Common files include:
tooling.md — package manager rules, linting config, hookscommands.md — how to run scripts, filter by package, pass argsguardrails.md — data isolation, secrets, library docsdefinition-of-done.md — specific thresholds and commandsAdjust filenames and topics to match the project's actual needs.
ROOT CLAUDE.md:
docs/agents/tooling.md:
docs/agents/commands.md:
... etc
After creating the structure:
/agent-add-rule to add new rules to the right location"/skills to see available skills"markdown# Project Context [One-line project description] ## Tech Stack - [list technologies] ## Key Rules - [3-5 rules the agent consistently gets wrong without being told] ## Workflow Every task follows four stages. Identify which stage you're in and follow its rules. Plan → Execute → Validate → Commit ↑ | └── fix ────────────────────────┘ 1. **Plan** — Understand the task, research code, design approach. Be concise; list unresolved questions. 2. **Execute** — Implement changes AND write tests together. No implementation is complete without tests. 3. **Validate** — ALL checks must pass with zero errors before moving on: - [list validation commands] If ANY check fails → return to Execute, fix, re-validate. Pre-existing errors are NOT exempt. 4. **Commit** — Only after Validate passes completely. Never commit with failing checks. ## Detailed Guidance When working on tasks involving these topics, read the linked doc: - [Topic](docs/agents/file.md) — brief routing signal describing when to read this - Run `/skills` to see available patterns and workflows
When deciding what stays in root vs moves to docs/agents/:
| Criteria | Root | docs/agents/ | | ---------------------------- | --------------------- | ------------ | | Agent gets wrong without it? | YES | maybe | | Applies to every task? | YES | no | | Under 2 lines? | YES | any length | | Detailed reference? | NO | YES | | Procedural/workflow? | only the 4-stage loop | YES |
agents/ subdirectory separates agent instructions from human documentation.Other measured skills in the registry, with their headline benchmark lift.