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
- Distinctive: line 19
Before creating PR: run full lint and test suite
- Very specific: line 25
Prefer type over interface.
- Distinctive: line 26
Use descriptive variable names
- Distinctive: line 27
Keep functions small and focused
- Distinctive: line 28
Write tests for new functionality
- Distinctive: line 47
After every correction or mistake, update this CLAUDE.md with a rule to prevent repeating it.
- Distinctive: line 51
Keep iterating until the mistake rate measurably drops.
- Distinctive: line 55
Start every complex task in plan mode (shift+tab to cycle)
- Distinctive: line 57
When something goes sideways, switch back to plan mode and re-plan.
- Distinctive: line 58
Use plan mode for verification steps too, not just for the build
- Very specific: line 68
Keep the guardrails when running unattended: scoped allow-lists in settings.json, worktrees for isolation, and the Stop hook that nudges a …
- Distinctive: line 74
When working in parallel, only one agent should edit a given file at a time
- Very specific: line 80
Use /loop to run a skill on a recurring interval (e.g., /loop 5m /babysit)
- Very specific: line 81
Use /schedule to schedule Claude to run on a cron-based schedule, up to a week
- Very specific: line 86
Use /branch to fork a session, or claude --resume <session-id> --fork-session from CLI
- Very specific: line 87
Use /btw for side queries without interrupting the agent's current work
- Very specific: line 88
Use /teleport to continue a cloud session on your local machine
- Very specific: line 89
Use /remote-control to control a local session from your phone or browser
- Very specific: line 90
Use /voice (CLI) or the voice button (Desktop) for voice input
- Very specific: line 94
Use --add-dir (or /add-dir) to give Claude access to additional repositories
- Very specific: line 95
Add "additionalDirectories" to settings.json to always load extra folders on startup
- Very specific: line 101
Don't use any type in TypeScript without explicit approval
- Distinctive: line 102
Don't skip error handling
- Distinctive: line 103
Don't commit without running tests first
- Distinctive: line 104
Don't make breaking API changes without discussion
≈ “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
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:
- Make changes
- Run typecheck
- Run tests
- Lint before committing
- Before creating PR: run full lint and test suite
Code Style & Conventions
<!-- Customize these for your project's conventions -->- Prefer
typeoverinterface; never useenum(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 commitSelf-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
Stophook 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
/loopto run a skill on a recurring interval (e.g.,/loop 5m /babysit) - Use
/scheduleto 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
/branchto fork a session, orclaude --resume <session-id> --fork-sessionfrom CLI - Use
/btwfor side queries without interrupting the agent's current work - Use
/teleportto continue a cloud session on your local machine - Use
/remote-controlto 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
anytype 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.
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.

