claude-md
What it does
It guides your agent to write or audit the CLAUDE.md file that tells Claude how a project works. It is for developers who want their AI assistant to start each session with the right context.
When to use it
- ✓When you start a new project and want a CLAUDE.md file written.
- ✓When an existing CLAUDE.md file is too long or unclear and needs improving.
- ✓When you want a quality check on a project's CLAUDE.md before sharing it with a team.
Skill link
https://github.com/luongnv89/claude-howto/blob/main/03-skills/claude-md/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you audit my CLAUDE.md and suggest what to cut so it stays short and useful?”
5 new skills a week. 1 minute to read.
How it works
The agent analyzes the project, checks for existing CLAUDE.md files, and then creates, updates, or audits them against a set of principles. It keeps only information that applies to every session.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty). User may specify:
create- Create new CLAUDE.md from scratchupdate- Improve existing CLAUDE.mdaudit- Analyze and report on current CLAUDE.md quality- A specific path to create/update (e.g.,
src/api/CLAUDE.mdfor directory-specific instructions)
Core Principles
LLMs are stateless: CLAUDE.md is the main project file loaded into every conversation (alongside auto memory and unscoped rules). It serves as the primary onboarding document for AI agents into your codebase.
The Golden Rules
Less is More: Frontier LLMs can follow ~150-200 instructions. Claude Code's system prompt already uses ~50. Keep your CLAUDE.md focused and concise.
Universal Applicability: Only include information relevant to EVERY session. Task-specific instructions belong in separate files.
Don't Use Claude as a Linter: Style guidelines bloat context and degrade instruction-following. Use deterministic tools (prettier, eslint, etc.) instead.
Never Auto-Generate: CLAUDE.md is the highest leverage point of the AI harness. Craft it manually with careful consideration.
Execution Flow
1. Project Analysis
First, analyze the current project state:
Check for existing CLAUDE.md files:
- Root level:
./CLAUDE.mdor.claude/CLAUDE.md - Directory-specific:
**/CLAUDE.md - Global user config:
~/.claude/CLAUDE.md
- Root level:
Identify the project structure:
- Technology stack (languages, frameworks)
- Project type (monorepo, single app, library)
- Development tools (package manager, build system, test runner)
Review existing documentation:
- README.md
- CONTRIBUTING.md
- package.json, pyproject.toml, Cargo.toml, etc.
2. Content Strategy (WHAT, WHY, HOW)
Structure CLAUDE.md around three dimensions:
WHAT - Technology & Structure
- Technology stack overview
- Project organization (especially important for monorepos)
- Key directories and their purposes
WHY - Purpose & Context
- What the project does
- Why certain architectural decisions were made
- What each major component is responsible for
HOW - Workflow & Conventions
- Development workflow (bun vs node, pip vs uv, etc.)
- Testing procedures and commands
- Verification and build methods
- Critical "gotchas" or non-obvious requirements
3. Progressive Disclosure Strategy
For larger projects, recommend creating an agent_docs/ folder:
agent_docs/
|- building_the_project.md
|- running_tests.md
|- code_conventions.md
|- architecture_decisions.md
In CLAUDE.md, reference these files with instructions like:
For detailed build instructions, refer to `agent_docs/building_the_project.md`
Important: Use file:line references instead of code snippets to avoid outdated context.
4. Quality Constraints
When creating or updating CLAUDE.md:
- Target Length: Keep it under 200 lines; shorter is better
- No Style Rules: Remove any linting/formatting instructions
- No Task-Specific Instructions: Move to separate files
- No Code Snippets: Use file references instead
- No Redundant Information: Don't repeat what's in package.json or README
5. Essential Sections
A well-structured CLAUDE.md should include:
# Project Name
Brief one-line description.
## Tech Stack
- Primary language and version
- Key frameworks/libraries
- Database/storage (if any)
## Project Structure
[Only for monorepos or complex structures]
- `apps/` - Application entry points
- `packages/` - Shared libraries
## Development Commands
- Install: `command`
- Test: `command`
- Build: `command`
## Critical Conventions
[Only non-obvious, high-impact conventions]
- Convention 1 with brief explanation
- Convention 2 with brief explanation
## Known Issues / Gotchas
[Things that consistently trip up developers]
- Issue 1
- Issue 2
6. Anti-Patterns to Avoid
DO NOT include:
- Code style guidelines (use linters)
- Documentation on how to use Claude
- Long explanations of obvious patterns
- Copy-pasted code examples
- Generic best practices ("write clean code")
- Instructions for specific tasks
- Auto-generated content
- Extensive TODO lists
7. Validation Checklist
Before finalizing, verify:
- Kept under 200 lines; shorter is better
- Every line applies to ALL sessions
- No style/formatting rules
- No code snipp
FAQ
Why keep the file short?
The skill says frontier models can follow only about 150 to 200 instructions, and the system prompt already uses some of that.
Should the agent write it automatically?
No. The skill says not to auto-generate it, and to craft it by hand with care.
Can it work on a file in a subfolder?
Yes. You can give it a path, such as a subdirectory, for instructions that apply only to that folder.
Details
Original description by the author
Create or update CLAUDE.md files following best practices for optimal AI agent onboarding
repo: luongnv89/claude-howto
Popularity
- GitHub stars
- 46k
- Ranking position
- #6321
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
lesson-quiz
46kQuizzes you on one Claude Code tutorial lesson with 10 questions, scores your answers, and points out topics to review.
self-assessment
46kGives you a quiz across 10 Claude Code feature areas, then a score by topic and a learning path for what to study next.
blog-draft
46kGuides your agent through drafting a blog post from your ideas and sources, step by step, with versions tracked as you go.
code-review-specialist
46kReviews code for security problems, performance issues, and maintainability, with a checklist and clearly written findings.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.