Skip to content
agent-init-deep logo

Init Deep — Progressive Disclosure CLAUDE.md

agent-init-deep

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 disclosu...

SKILL.md

Full skill instructions

Init Deep — Progressive Disclosure CLAUDE.md

Set up or migrate to a progressive disclosure CLAUDE.md structure using docs/​agents/ for topic-specific guidance.

Context Model

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 invoked

Root CLAUDE.md should be ~40-50 lines. Everything else belongs in docs/​agents/ or skills.

Target Structure

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 needed

Workflow

Step 1: Detect State

Check 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

Step 2a: Greenfield Path

Ask the user:

  1. Project name and one-line description
  2. Tech stack (frontend, backend, database, etc.)
  3. Package manager (pnpm, npm, yarn, bun)
  4. Key guardrails (multi-tenancy, secrets, etc.)
  5. Definition of done (test coverage, lint, types, format)

Then generate:

Root CLAUDE.md with:

  • Project identity (1-2 lines)
  • Tech stack list
  • 3-5 key rules (only things the agent consistently gets wrong)
  • 4-stage workflow: Plan → Execute → Validate → Commit
  • Links to docs/​agents/ files with routing signals

docs/​agents/ files based on answers. Common files include:

  • tooling.md — package manager rules, linting config, hooks
  • commands.md — how to run scripts, filter by package, pass args
  • guardrails.md — data isolation, secrets, library docs
  • definition-of-done.md — specific thresholds and commands

Adjust filenames and topics to match the project's actual needs.

Step 2b: Migration Path

  1. Read existing CLAUDE.md

  2. Classify each section:

    • Root-worthy: identity, tech stack, key rules (3-5 max), workflow
    • docs/​agents/​: detailed tooling, commands, guardrails, definition of done
    • Skill-worthy: complex workflows, procedures, domain expertise
  3. Present proposed split to user:

    ROOT CLAUDE.md:
    - Project identity
    - Tech stack
    - Key rules: [list]
    - Workflow (Plan/​Execute/​Validate/​Commit)
    - Links to docs/​agents/
    
    docs/​agents/​tooling.md:
    - [extracted sections]
    
    docs/​agents/​commands.md:
    - [extracted sections]
    
    ... etc
    
  4. Ask user to confirm or adjust

  5. Create docs/​agents/ files

  6. Rewrite root CLAUDE.md

Step 3: Post-Setup

After creating the structure:

  1. List all created files
  2. Show the root CLAUDE.md
  3. Suggest additional improvements:
    • "Consider adding CLAUDE.md files in app subdirectories for app-specific rules"
    • "Run /​agent-add-rule to add new rules to the right location"
    • "Run /​skills to see available skills"

Root CLAUDE.md Template

# 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

Classification Heuristic

When deciding what stays in root vs moves to docs/​agents/:

CriteriaRootdocs/​agents/
Agent gets wrong without it?YESmaybe
Applies to every task?YESno
Under 2 lines?YESany length
Detailed reference?NOYES
Procedural/​workflow?only the 4-stage loopYES

Principles

  • Minimal root: Every line in root costs tokens on every conversation. Only include what the agent consistently gets wrong without being told.
  • Routing signals: Each link description helps Claude decide whether to follow it. Be specific: "pnpm conventions, ESLint config" not just "tooling".
  • One level deep: All docs link from root. No cross-references between docs/​agents/ files.
  • docs/​agents/ not docs/​: The agents/ subdirectory separates agent instructions from human documentation.

More Productivity & Planning skills

brainstorming logo
Productivity & Planning

brainstorming

Structured design dialogue that validates ideas before implementation begins.

295.4K 385.7K
View
ui-ux-pro-max logo
Productivity & Planning

ui-ux-pro-max

Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.

133.1K 383.9K
View
writing-plans logo
Productivity & Planning

writing-plans

Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.

295.4K 268K
View
using-superpowers logo
Productivity & Planning

using-superpowers

Introduction to the obra skills system with mandatory skill invocation rules and best practices.

295.4K 259.8K
View
executing-plans logo
Productivity & Planning

executing-plans

Execute a written implementation plan with critical review and task checkpoints.

295.4K 229.1K
View
dispatching-parallel-agents logo
Productivity & Planning

dispatching-parallel-agents

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View
using-git-worktrees logo
Productivity & Planning

using-git-worktrees

Isolated git worktrees with smart directory selection and safety verification.

295.4K 205.2K
View
webapp-testing logo
Productivity & Planning

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View
content-strategy logo
Productivity & Planning

content-strategy

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View
repo-intake-and-plan logo
Productivity & Planning

repo-intake-and-plan

README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.

497 139.6K
View
marketing-ideas logo
Productivity & Planning

marketing-ideas

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
site-architecture logo
Productivity & Planning

site-architecture

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View

Productivity AI tools

Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View
SaveDay logo
Productivity

SaveDay

Capture, organize, and utilize your knowledge effortlessly.

Free
View
A
Productivity

Any Summary

Instant Summaries of Audio & Video Interviews with AnySummary

Freemium
View
M
Productivity

Map This

Transform PDFs into engaging mind maps.

Freemium
View
ChatPDF logo
Productivity

ChatPDF

Chat with any PDF instantly

Free
View
I
Productivity

intellisay

Create an optimal daily plan using your voice

Paid
View
A
Productivity

Aurora AI

A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.

Paid
View
AskYourPDF logo
Productivity

AskYourPDF

AskYourPDF Pricing Plans: Tailored to Your Needs

Free
View