claude-playbook
CLAUDE.md41 starsChanged 2 months agoMITView on GitHub
Keep this file under 200 lines. Claude reads it at the start of every session, so everything here costs tokens in every conversation, including ones where it is irrelevant. Anthropic's guidance: a file that is too long gets ignored. The test for each line: would removing it cause Claude to make a mistake? If not, cut it. Include: commands Claude cannot guess, conventions that differ from the language default, architectural decisions not visible in the code, and gotchas. Exclude: anything…
The file
We split this CLAUDE.md into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 6
Keep this file under 200 lines.
- Distinctive: line 11
If not, cut it.
- Distinctive: line 19
Run /init to generate a first draft from your codebase, then cut it down.
- Distinctive: line 20
Run /doctor and Claude will propose cuts for content it can derive from code.
- Distinctive: line 21
Run /context to confirm this file actually loaded.
- Distinctive: line 56
Run lint and tests before committing.
- Distinctive: line 67
When compacting, preserve the full list of modified files and the test commands that were run.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Project Instructions
<!--
STARTER TEMPLATE. Replace every line below with facts about your project.
Keep this file under 200 lines. Claude reads it at the start of every session,
so everything here costs tokens in every conversation, including ones where it
is irrelevant. Anthropic's guidance: a file that is too long gets ignored.
The test for each line: would removing it cause Claude to make a mistake?
If not, cut it.
Include: commands Claude cannot guess, conventions that differ from the
language default, architectural decisions not visible in the code, and gotchas.
Exclude: anything Claude can learn by reading the code, standard conventions,
file-by-file descriptions, and API documentation. Link to docs instead.
Run /init to generate a first draft from your codebase, then cut it down.
Run /doctor and Claude will propose cuts for content it can derive from code.
Run /context to confirm this file actually loaded.
These HTML comments are stripped before the file enters Claude's context,
so they cost nothing.
-->Commands
<!-- The /verify skill runs these. Get them right and verification works. -->- Build:
npm run build - Test:
npm test - Single test:
npm test -- --grep "test name" - Lint:
npm run lint -- --fix - Type check:
npm run typecheck
Code style
<!-- Only what differs from the language default. -->- ES modules, never CommonJS
- Named exports, not default exports
- TypeScript strict mode is on
Architecture
<!-- Decisions that the code does not state for itself. -->- API routes in
src/api/, business logic insrc/services/, data access insrc/repositories/ - Shared types in
src/types/ - The repository layer owns all database access. Services never query directly.
Workflow
- Feature branches only. Never commit to
main. - Run lint and tests before committing.
Gotchas
<!-- The things that waste a session when nobody wrote them down. -->- The test database resets between runs. Do not rely on seed data.
- Frontend environment variables need the
VITE_prefix or they are not exposed.
Compact instructions
When compacting, preserve the full list of modified files and the test commands that were run.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

