recursive-drift / templates
CLAUDE.md18 starsChanged 9 months agoMITView on GitHub
Copy this to your repo root as CLAUDE.md. Customize sections to match your project.
In this repositoryOne other file it gives its agents.
- claude-code/CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
15 rules. About 0 are common, 11 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
If something goes sideways mid-execution, STOP and re-plan immediately.
- Distinctive: line 12
Use plan mode for verification steps, not just building.
- Distinctive: line 13
Write detailed specs upfront to reduce ambiguity.
- Distinctive: line 17
Use subagents liberally to keep main context window clean.
- Very specific: line 23
After ANY correction from the user: update tasks/lessons.md with the date, context, and lesson.
- Distinctive: line 24
Write rules for yourself that prevent the same mistake from recurring.
- Distinctive: line 29
Never mark a task complete without proving it works.
- Distinctive: line 31
Ask yourself: "Would a staff engineer approve this?"
- Distinctive: line 32
Run tests, check logs, demonstrate correctness.
- Distinctive: line 36
If a fix feels hacky: "Knowing everything I know now, implement the elegant solution."
- Distinctive: line 41
When given a bug report: just fix it.
- Very specific: line 47
Plan First: Write plan to tasks/todo.md with checkable items before starting.
- Distinctive: line 48
Verify Plan: Check in before starting implementation.
- Very specific: line 51
Document Results: Add review section to tasks/todo.md.
- Very specific: line 52
Capture Lessons: Update tasks/lessons.md after corrections.
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 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 Template
Copy this to your repo root as CLAUDE.md. Customize sections to match your project.
Workflow Orchestration
1. Plan Mode Default
- Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions) before writing a single line of code.
- If something goes sideways mid-execution, STOP and re-plan immediately.
- Use plan mode for verification steps, not just building.
- Write detailed specs upfront to reduce ambiguity.
- Plans should be fast and actionable -- plan to build, not plan instead of building.
2. Subagent Strategy
- Use subagents liberally to keep main context window clean.
- Offload research, exploration, and parallel analysis to subagents.
- For complex problems, throw more compute at it via subagents.
- One task per subagent for focused execution.
3. Self-Improvement Loop
- After ANY correction from the user: update
tasks/lessons.mdwith the date, context, and lesson. - Write rules for yourself that prevent the same mistake from recurring.
- Ruthlessly iterate on these lessons until mistake rate drops.
- Review
tasks/lessons.mdat session start.
4. Verification Before Done
- Never mark a task complete without proving it works.
- Diff behavior between main and your changes when relevant.
- Ask yourself: "Would a staff engineer approve this?"
- Run tests, check logs, demonstrate correctness.
5. Demand Elegance (Balanced)
- For non-trivial changes: pause and ask "is there a more elegant way?"
- If a fix feels hacky: "Knowing everything I know now, implement the elegant solution."
- Skip this for simple, obvious fixes.
- Challenge your own work before presenting it.
6. Autonomous Bug Fixing
- When given a bug report: just fix it. Don't ask for hand-holding.
- Point at logs, errors, failing tests -- then resolve them.
- Zero context switching required from the user.
Task Management
- Plan First: Write plan to
tasks/todo.mdwith checkable items before starting. - Verify Plan: Check in before starting implementation.
- Track Progress: Mark items complete as you go.
- Explain Changes: High-level summary at each step.
- Document Results: Add review section to
tasks/todo.md. - Capture Lessons: Update
tasks/lessons.mdafter corrections.
Core Principles
- GET SHIT DONE: Plan fast, build fast, ship working code every session.
- Simplicity First: Make every change as simple as possible.
- No Laziness: Find root causes. No temporary fixes.
- Minimal Impact: Changes should only touch what's necessary.
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.

