agentleFS
0xquinto0xquinto/bcherny-claude/CLAUDE.md

bcherny-claude

CLAUDE.md359 starsChanged 10 months agoMITView on GitHub

This file provides project-specific guidance for Claude Code. Update this file whenever Claude does something incorrectly so it learns not to repeat mistakes. (Describe your project here) Give Claude verification loops for 2-3x quality improvement: After every correction or mistake, update this CLAUDE.md with a rule to prevent repeating it. Claude is good at writing rules for itself. End corrections with: "Now update CLAUDE.md so you don't make that mistake again." Keep iterating until the mistake rate measurably drops. Boris…

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

25 rules. About 0 are common, 13 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before creating PR: run full lint and test suite

    line 19
  2. Very specific:

    Prefer type over interface.

    line 25
  3. Distinctive:

    Use descriptive variable names

    line 26
  4. Distinctive:

    Keep functions small and focused

    line 27
  5. Distinctive:

    Write tests for new functionality

    line 28
  6. Distinctive:

    After every correction or mistake, update this CLAUDE.md with a rule to prevent repeating it.

    line 47
  7. Distinctive:

    Keep iterating until the mistake rate measurably drops.

    line 51
  8. Distinctive:

    Start every complex task in plan mode (shift+tab to cycle)

    line 55
  9. Distinctive:

    When something goes sideways, switch back to plan mode and re-plan.

    line 57
  10. Distinctive:

    Use plan mode for verification steps too, not just for the build

    line 58
  11. Very specific:

    Keep the guardrails when running unattended: scoped allow-lists in settings.json, worktrees for isolation, and the Stop hook that nudges a …

    line 68
  12. Distinctive:

    When working in parallel, only one agent should edit a given file at a time

    line 74
  13. Very specific:

    Use /loop to run a skill on a recurring interval (e.g., /loop 5m /babysit)

    line 80
  14. Very specific:

    Use /schedule to schedule Claude to run on a cron-based schedule, up to a week

    line 81
  15. Very specific:

    Use /branch to fork a session, or claude --resume <session-id> --fork-session from CLI

    line 86
  16. Very specific:

    Use /btw for side queries without interrupting the agent's current work

    line 87
  17. Very specific:

    Use /teleport to continue a cloud session on your local machine

    line 88
  18. Very specific:

    Use /remote-control to control a local session from your phone or browser

    line 89
  19. Very specific:

    Use /voice (CLI) or the voice button (Desktop) for voice input

    line 90
  20. Very specific:

    Use --add-dir (or /add-dir) to give Claude access to additional repositories

    line 94
  21. Very specific:

    Add "additionalDirectories" to settings.json to always load extra folders on startup

    line 95
  22. Very specific:

    Don't use any type in TypeScript without explicit approval

    line 101
  23. Distinctive:

    Don't skip error handling

    line 102
  24. Distinctive:

    Don't commit without running tests first

    line 103
  25. Distinctive:

    Don't make breaking API changes without discussion

    line 104

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

CLAUDE.md - Project Instructions for Claude Code

This file provides project-specific guidance for Claude Code. Update this file whenever Claude does something incorrectly so it learns not to repeat mistakes.

Project Overview

<!-- Customize this section for your project -->

(Describe your project here)

Development Workflow

Give Claude verification loops for 2-3x quality improvement:

  1. Make changes
  2. Run typecheck
  3. Run tests
  4. Lint before committing
  5. Before creating PR: run full lint and test suite

Code Style & Conventions

<!-- Customize these for your project's conventions -->
  • Prefer type over interface; never use enum (use string literal unions instead)
  • Use descriptive variable names
  • Keep functions small and focused
  • Write tests for new functionality
  • Handle errors explicitly, don't swallow them

Commands Reference

# Verification loop commands (customize for your project)
npm run typecheck        # Type checking
npm run test            # Run tests
npm run lint            # Lint all files
npm run format          # Format code

# Git workflow
git status              # Check current state
git diff                # Review changes before commit

Self-Improvement

After every correction or mistake, update this CLAUDE.md with a rule to prevent repeating it. Claude is good at writing rules for itself.

End corrections with: "Now update CLAUDE.md so you don't make that mistake again."

Keep iterating until the mistake rate measurably drops.

Working with Plan Mode

  • Start every complex task in plan mode (shift+tab to cycle)
  • Pour energy into the plan so Claude can 1-shot the implementation
  • When something goes sideways, switch back to plan mode and re-plan. Don't keep pushing.
  • Use plan mode for verification steps too, not just for the build

Auto Mode

Boris Cherny's current #1 tip: run in auto mode — no permission prompts.

  • Cycle to auto mode with shift+tab (default → auto-accept → plan mode)
  • Auto mode is the building block for multi-clauding: start a session, and while it runs unattended, work on another session in parallel
  • Pair it with worktrees (/worktree, claude -w) and subagents so parallel sessions don't collide
  • Make it sticky by setting the default permission mode (defaultMode) in .claude/settings.json
  • Keep the guardrails when running unattended: scoped allow-lists in settings.json, worktrees for isolation, and the Stop hook that nudges a session to keep going

Parallel Work

  • For tasks that need more compute, use subagents to work in parallel
  • Offload individual tasks to subagents to keep the main context window clean and focused
  • When working in parallel, only one agent should edit a given file at a time
  • For fully parallel workstreams, use git worktrees: git worktree add .claude/worktrees/<name> origin/main

Automation

  • Use /loop to run a skill on a recurring interval (e.g., /loop 5m /babysit)
  • Use /schedule to schedule Claude to run on a cron-based schedule, up to a week
  • Turn repetitive workflows into skills, then loop them for hands-free automation

Session Management

  • Use /branch to fork a session, or claude --resume <session-id> --fork-session from CLI
  • Use /btw for side queries without interrupting the agent's current work
  • Use /teleport to continue a cloud session on your local machine
  • Use /remote-control to control a local session from your phone or browser
  • Use /voice (CLI) or the voice button (Desktop) for voice input

Multi-Repo Work

  • Use --add-dir (or /add-dir) to give Claude access to additional repositories
  • Add "additionalDirectories" to settings.json to always load extra folders on startup

Things Claude Should NOT Do

<!-- Add mistakes Claude makes so it learns -->
  • Don't use any type in TypeScript without explicit approval
  • Don't skip error handling
  • Don't commit without running tests first
  • Don't make breaking API changes without discussion

Project-Specific Patterns

<!-- Add patterns as they emerge from your codebase -->

Update this file continuously. Every mistake Claude makes is a learning opportunity.

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.