Most CLAUDE.md files I've seen on GitHub cover code style. Almost none cover what actually causes autonomous runs to break.
I spent 72 hours running Claude Code as an autonomous agent. Here's the template library I wish existed when I started.
What's in the repo
By stack:
- Next.js + Supabase
- FastAPI + PostgreSQL
- React + Vite (TypeScript)
- Express.js API
- Django REST Framework
- Ruby on Rails
- SvelteKit
- Go API
- Python CLI
- TypeScript library / npm package
By team size:
- Solo indie hacker
- Startup team (3-15 people)
- Enterprise (50+ people)
By use case:
- Autonomous agent runs (long sessions, context management)
- Data pipeline / ETL
- React Native (Expo)
- Docker / DevOps
- Monorepo (Turborepo / Nx)
What these cover that most CLAUDE.md files don't
Session recovery — after compaction, the agent re-reads CLAUDE.md but loses conversation context. Most files have nothing about recovery. Every template in this repo has:
## Recovery
After compaction or restart: read tasks/current-task.md
One line. Saves 15 minutes every time context resets.
Error recovery patterns — what to do when a tool call fails. Without this, you get infinite retry loops at 3am.
Negative constraints — "never git add -A" prevents more problems than "be careful with git."
Rate limit documentation — explicit handling for every external API the agent calls.
Approval gates — what requires a human check before proceeding.
How to use
- Clone the repo
- Copy the template closest to your stack
- Fill in the
[placeholder]sections - Update whenever the agent does something unexpected
git clone https://github.com/seankim-android/claude-md-templates
cp claude-md-templates/stacks/nextjs-supabase.md your-project/CLAUDE.md
The philosophy
The most effective CLAUDE.md is one you've updated 20 times based on actual agent behavior. These templates are starting points — not finished documents.
Each one is built from watching Claude Code fail in specific ways in that stack. The rules exist because something broke.
Repo: github.com/seankim-android/claude-md-templates
Built during a live experiment at builtbyzac.com. More context management patterns in the Agent Harness ($29).
Top comments (0)