Generate or update CLAUDE.md following best practices (concise, progressive disclosure, no linter duties)
Creates or updates CLAUDE.md files to onboard AI coding agents into codebases.
/plugin marketplace add dariuszparys/claudecode-enhancements/plugin install dp-tools@claude-code-toolkitdp/You are helping me create or update a CLAUDE.md file. This file onboards AI coding agents into the codebase.
First, determine where you are:
# Get repo root
git rev-parse --show-toplevel
# Get current directory
pwd
If current directory IS the repo root: → You are creating a ROOT CLAUDE.md (comprehensive, sets up progressive disclosure)
If current directory is BELOW the repo root: → You are creating a SUBDIRECTORY CLAUDE.md (package/app-specific, additive to root) → Read the root CLAUDE.md first to avoid duplication → After creating, offer to update root CLAUDE.md with a reference to this new file
find or treeagent_docs/ or similar directoriesClaude Code tells the model to ignore CLAUDE.md content that isn't relevant to the current task. Every line must be universally applicable or it gets skipped.
Reference external docs instead of embedding:
## Docs
- `docs/database.md` — before DB changes
- `docs/auth.md` — before touching auth
# Project: [Name]
[One sentence purpose]
## Stack
- [Framework + version]
- [Language + config]
- [Database + ORM]
## Commands
- `cmd` — description
- `cmd` — description
## Structure
[High-level: apps, packages, key directories]
## Rules
[Universal hard rules across entire repo]
## Domain
[Business logic, key concepts]
## Docs
- `agent_docs/topic.md` — when to read
## Package Docs
Subdirectories with their own CLAUDE.md:
- `path/to/package/` — brief description
Target: 60-100 lines, comprehensive but lean.
# [Package/App Name]
[One sentence: what this specific package does]
## Commands
- `cmd` — description (only if different from root)
## Structure
[Package-specific directories only]
## Rules
[Package-specific rules NOT covered by root]
## Domain
[Package-specific business logic if any]
Target: 30-50 lines maximum. This is ADDITIVE to root — don't repeat anything already in root CLAUDE.md.
agent_docs/ files that should be created with brief descriptionsAfter creating a subdirectory CLAUDE.md, check the root CLAUDE.md:
If "Package Docs" section exists:
- \path/` — brief description`If "Package Docs" section does NOT exist:
## Package Docs
Subdirectories with their own CLAUDE.md:
- `current/path/` — brief description of what this package does
Present the diff for root CLAUDE.md and ask for confirmation before writing
After confirmation, write the CLAUDE.md file to the current directory.