Claude md

From luongnv89/claude-howto · View interactive version

Claude md is an AI agent skill from the GitHub repository luongnv89/claude-howto. Create or update CLAUDE.md files following best practices for optimal AI agent onboarding

How to use this skill

Skill file

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty). User may specify:

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

  1. 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.
  1. Universal Applicability: Only include information relevant to EVERY session. Task-specific instructions belong in separate files.
  1. Don't Use Claude as a Linter: Style guidelines bloat context and degrade instruction-following. Use deterministic tools (prettier, eslint, etc.) instead.
  1. 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:

  1. Check for existing CLAUDE.md files:
  1. Identify the project structure:
  1. Review existing documentation:

2. Content Strategy (WHAT, WHY, HOW)

Structure CLAUDE.md around three dimensions:

WHAT - Technology & Structure
WHY - Purpose & Context
HOW - Workflow & Conventions

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:

  1. Target Length: Keep it under 200 lines; shorter is better
  2. No Style Rules: Remove any linting/formatting instructions
  3. No Task-Specific Instructions: Move to separate files
  4. No Code Snippets: Use file references instead
  5. 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:

7. Validation Checklist

Before finalizing, verify:

Output Format

For `create` or default:

  1. Analyze the project
  2. Draft a CLAUDE.md following the structure above
  3. Present the draft for review
  4. Write to the appropriate location after approval

For `update`:

  1. Read existing CLAUDE.md
  2. Audit against best practices
  3. Identify:
  1. Present changes for review
  2. Apply changes after approval

For `audit`:

  1. Read existing CLAUDE.md
  2. Generate a report with:
  1. Do NOT modify the file, only report

AGENTS.md Handling

If the user requests AGENTS.md creation/update:

Since v2.1.277, Claude Code reads AGENTS.md directly as project instructions — but only when the working directory and every directory above it contain no CLAUDE.md, .claude/CLAUDE.md, or CLAUDE.local.md. ~/.claude/CLAUDE.md, managed CLAUDE.md, and .claude/rules/ do not count for that check and keep loading alongside. Which files are read is controlled by Project instructions in /config: claude-md-or-agents-md (default), claude-md-and-agents-md, claude-md, or managed-only. Where direct reading is unavailable — versions before v2.1.277 (before v2.1.281 on Bedrock/Vertex/Foundry, LLM gateways, or with telemetry disabled), with the built-in plugin that reads AGENTS.md disabled in /plugin, or in some cases the first session after upgrading from v2.1.276 or earlier — fall back to importing it from CLAUDE.md with @AGENTS.md, or symlinking CLAUDE.md to it.

AGENTS.md is a cross-tool project-context file — the same category of document as CLAUDE.md, not an agent-definition format. It exists so several coding agents can share one set of project conventions:

Subagents are defined separately, in .claude/agents/*.md — not in AGENTS.md.

Apply similar principles:

Notes


Last Updated: October 18, 2026

Claude Code Version: 2.1.302

Sources:

Compatible Models: Claude Fable 5.2, Claude Fable 5.1, Claude Fable 5, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Sonnet 5, Claude Sonnet 4.6, Claude Opus 4.8, Claude Haiku 5.5, Claude Haiku 4.5

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.