agentleFS
smartwhale8smartwhale8/claude-playbook/.claude/CLAUDE.md

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
  1. Distinctive:

    Keep this file under 200 lines.

    line 6
  2. Distinctive:

    If not, cut it.

    line 11
  3. Distinctive:

    Run /init to generate a first draft from your codebase, then cut it down.

    line 19
  4. Distinctive:

    Run /doctor and Claude will propose cuts for content it can derive from code.

    line 20
  5. Distinctive:

    Run /context to confirm this file actually loaded.

    line 21
  6. Distinctive:

    Run lint and tests before committing.

    line 56
  7. Distinctive:

    When compacting, preserve the full list of modified files and the test commands that were run.

    line 67

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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 in src/services/, data access in src/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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.