CLAUDE.md templates that work

Make your always-on rules strong.

The 4-block skeleton

Role, constraints, output format, and common commands — four blocks that cover what Claude can't infer from your code alone.

# CLAUDE.md (skeleton)

## Role
Act as a senior engineer on this project.

## Constraints
- Use pnpm only
- No `any` types
- Destructive git commands: propose, don't run without confirmation

## Output format
- Conventional Commits
- Line-specific code review comments

## Common commands
- Test: `pnpm test`
- Build: `pnpm build`

Keep it short

Official guidance suggests under 200 lines; community practice trends toward ~60. Push detailed procedures into Skills instead of bloating CLAUDE.md.

Project vs user-level (verified live)

Checked on this Mac: `~/.claude/CLAUDE.md` doesn't exist — a global file is optional, and project-level alone works fine. Add a global one once you have preferences that should apply everywhere.

Write rules as commands, not suggestions

"Please try to write tests" is weaker than "Every new function gets a test, or a comment explaining why not."

Don't start from a blank file

ConfigDeck's market has many CLAUDE.md templates and rule sets by industry/use case — install one close to your need and trim it down.

FAQ

What 4 blocks should CLAUDE.md have?
Role, constraints, output format, and common commands.
How long should it be?
Official guidance: under 200 lines. Community practice: around 60.
Is a global CLAUDE.md required?
No — verified on this Mac, ~/.claude/CLAUDE.md doesn't exist and project-level alone works.
Should I avoid words like "please try to"?
Yes — write rules as concrete, conditional commands instead.