# 15 CLAUDE.md Rules Solo SaaS Founders Actually Need in 2026

> 15 concrete CLAUDE.md rules for solo SaaS founders — scope and length, writing rules from actual corrections, and solo-specific framing like deploy commands and files to never touch without asking — plus a copy-paste template.

Canonical: https://www.agentickit.co/blog/claude-md-rules-solo-saas-founders-2026
Last updated: 2026-11-17

**Short answer:** the CLAUDE.md rules that actually change behavior aren't generic ("write clean code") — they're specific corrections pulled from a mistake Claude already made in your repo. The 15 below cover scope and length (how much to put in CLAUDE.md versus a skill), how to turn a correction into a durable rule, and framing specific to running a SaaS alone with no second engineer to catch what a rule misses. If you want the deletion test behind "keep it short," see [the 200-line rule breakdown](/blog/claude-md-200-line-rule); if you want annotated real files to copy from, see [15 real CLAUDE.md files from production SaaS repos](/blog/claude-md-examples-production-saas).

## Why generic CLAUDE.md advice does nothing

Most "CLAUDE.md best practices" posts converge on the same five lines: write clean code, follow best practices, use meaningful names, keep it concise, document your stack. None of these change what Claude does on your next task, because Claude already defaults to clean names and readable code, and your stack is one `ls` or `package.json` read away from being obvious without a line telling it so. A rule only earns its place in CLAUDE.md if removing it would make Claude guess wrong about a real command, path, or invariant on a real task — the same deletion test that applies to length applies to every individual rule, not just the file as a whole.

The rules below are written to pass that test. Each one either states something Claude can't derive on its own, or it exists because Claude got something wrong once and the correction is worth not repeating by hand every session.

## Rules 1-5: scope and length

**1. Keep CLAUDE.md under what the deletion test survives, not under a fixed number.** "200 lines" gets repeated across 2026 guides as if it's an Anthropic rule — it isn't one. What Anthropic's docs actually say is that CLAUDE.md loads into context at the start of every session, so length has a real, continuous cost. Delete any line where removing it wouldn't change what Claude does differently on a real task; the resulting length is whatever it is. Full breakdown in [the 200-line rule post](/blog/claude-md-200-line-rule).

**2. Split global rules (`~/.claude/CLAUDE.md`) from project rules (`<repo>/CLAUDE.md`).** Global is for things true across every repo you touch solo — your git commit style, your general code-review bar, your own name/handle for attribution. Project-level is for things true only in this repo — the ORM, the test runner, the deploy command. Putting project-specific commands in the global file means every unrelated repo pays context for a command it'll never run.

**3. Import your README instead of restating it.** CLAUDE.md supports `@README.md`-style imports, which pull the referenced file's content into context without you hand-copying it. A CLAUDE.md that duplicates "this is a Next.js app with Postgres and Stripe" alongside a README that says the same thing drifts the moment one gets updated and not the other. Import once; write CLAUDE.md rules for what the README doesn't cover — the behavioral constraints, not the architecture description.

**4. One CLAUDE.md per package in a monorepo, not one giant file at the root.** If you run a monorepo with a `web` app and an `api` service, a rule like "Server Actions for mutations" only applies in `web`. A root-level file forces every session in `api` to load a rule that's irrelevant there. Nested CLAUDE.md files that Claude Code reads based on which directory you're working in keep each file short and keep rules relevant to the code actually being touched.

**5. Move task-specific procedures into a skill, not CLAUDE.md.** A rule that only matters when you're touching Stripe webhooks or running a migration doesn't need to cost context on every unrelated session. If a rule changes behavior for one recurring task but does nothing the rest of the time, it belongs in a [skill](/skills) invoked on demand. CLAUDE.md is for things true on every single task in the repo; skills are for things true on one class of task.

## Rules 6-10: writing rules from actual corrections

**6. Write a rule the moment you correct Claude, not from a template.** The highest-signal rules in any production CLAUDE.md didn't come from a "best practices" list — they came from Claude doing something wrong once, getting corrected, and that correction getting written down so it doesn't happen again. "Never edit `drizzle/*.sql` by hand — generate migrations with `pnpm db:generate`" is a rule that exists because someone watched Claude hand-edit a migration file and drift it from the schema. A rule you can't trace to a specific incident is usually generic filler.

**7. Name the specific failure, not the general principle.** "Be careful with database migrations" doesn't change behavior — Claude already tries to be careful. "Migrations are append-only; never edit a migration file that's already been applied, even to fix a typo" does, because it states the exact thing Claude otherwise doesn't know is forbidden in your repo specifically.

**8. Include the wrong thing Claude did, briefly, as context for the rule.** "Use `AppError` from `lib/errors.ts`, never a bare `Error`" is a rule. "Use `AppError` from `lib/errors.ts`, never a bare `Error` — the error boundary matches on `.code`, so a bare `Error` renders as an unhandled crash instead of the fallback UI" is a rule that survives six months from now when you've forgotten why you wrote it, and that a future instance of Claude can reason from instead of following blindly.

**9. Re-run the deletion test on old rules every few months, not just new ones.** A rule written after a correction six months ago may no longer apply — the library got upgraded, the pattern got refactored away, the footgun got removed from the codebase. A stale rule costs the same context as a live one and can actively mislead Claude into following a pattern you've since abandoned. Audit on a cadence, not never.

**10. Don't write a rule for a mistake Claude only made once and clearly understood after one correction.** If you corrected something and Claude applied the fix correctly for the rest of the session without being told again, it may not need to become a permanent rule — some mistakes are one-off misunderstandings of a specific prompt, not a recurring gap in what Claude knows about your repo. Write the rule when the same category of mistake recurs across sessions, not after every single correction.

## Rules 11-15: solo-founder specific framing

**11. Write the rules a reviewer would have caught, because you have no reviewer.** On a team, a sloppy migration or a wrong error type often gets caught in PR review before it ships. Solo, nothing catches it except you noticing later — or not. CLAUDE.md is the closest thing you have to a second pair of eyes that's awake for every session; invest the correction-writing habit there precisely because there's no backstop downstream.

**12. State your actual deploy and rollback commands, not "deploy carefully."** A solo founder is also the SRE. "Deploy with `pnpm deploy:prod`; rollback with `pnpm deploy:rollback <version>`; never deploy directly to the `main` branch's auto-deploy without running `pnpm typecheck` first" is a rule that prevents an outage you'd otherwise have to debug alone, at whatever hour it happens.

**13. Write your own commit and PR conventions once, globally, so you stop repeating them per repo.** Solo founders often run several small repos. A global CLAUDE.md rule for commit message style, whether you squash-merge, and how you want PR descriptions formatted means every new repo inherits the convention instead of you re-explaining it project by project.

**14. Add a rule for what Claude should never touch without asking — pricing, billing logic, anything customer-facing copy that's already been A/B tested.** With no second approver, an unprompted "while I was in there I also tweaked the pricing copy" is a risk a team would catch and you won't notice until a customer does. Name the specific files or logic that need an explicit go-ahead before any edit.

**15. Keep a running "lessons" section you prune into real rules, not a single sprawling list.** Some founders keep a scratch section at the bottom of CLAUDE.md for one-line notes as they notice friction, then fold the recurring ones into proper rules during a periodic audit (rule 9) and delete the rest. This keeps the habit of capturing corrections cheap in the moment without letting the main file bloat with half-formed notes that never get promoted or cut.

## Template you can copy for a one-person SaaS repo

```markdown
## Stack
@README.md

## Commands
- Test: `pnpm test` (Vitest)
- Typecheck before any commit: `pnpm typecheck`
- Deploy: `pnpm deploy:prod`; rollback: `pnpm deploy:rollback <version>`

## Patterns
- Server Actions for mutations; Route Handlers only for webhooks and external callbacks.
- Errors: throw `AppError` from `lib/errors.ts`, never a bare `Error` — the error boundary matches on `.code`.
- Migrations are append-only. Generate with `pnpm db:generate`; never hand-edit `drizzle/*.sql`, even an already-applied one.

## Ask before touching
- Pricing copy in `app/pricing/`, and anything in `lib/billing/` — these are tuned from live data, not obvious from the code.

## Lessons (prune into rules above or delete, monthly)
- 2026-11-10: tried to inline a Stripe webhook secret in a test file — should've used the test fixture in `test/fixtures/stripe.ts`.
```

Run this through the [CLAUDE.md Linter](/tools/claude-md-linter) once you've filled it in with your own corrections — it flags generic lines you've accidentally left in and checks length against your actual context budget rather than a fixed line count.

## FAQ

**Do I need a CLAUDE.md file for every project, or just the main one?** Every repo you run Claude Code in benefits from at least a short project-level file for stack-specific commands and patterns; global rules in `~/.claude/CLAUDE.md` cover what's true across all of them, like your commit conventions, so you're not repeating those per repo.

**What's the difference between a CLAUDE.md rule and a skill?** A CLAUDE.md rule should change behavior on every session in that repo. A skill should change behavior only for one recurring class of task (a Stripe webhook flow, a migration procedure) and otherwise cost nothing in context. If a rule only matters some of the time, move it to a skill — see [rule 5](#rules-6-10-writing-rules-from-actual-corrections) above.

**Is there really a 200-line limit on CLAUDE.md?** No — that number doesn't appear in Anthropic's documentation. It's a community heuristic reasoning backward from the real cost (CLAUDE.md loads into every session's context). The deletion test matters more than any specific line count; see [the full breakdown](/blog/claude-md-200-line-rule).

**How often should I audit my CLAUDE.md as a solo founder?** Monthly is a reasonable cadence for a single active repo — about as often as you'd notice a rule has gone stale because the pattern it describes got refactored away. Fold anything in your "lessons" scratch section into a real rule or delete it at the same time.

**Where do I find real examples instead of a template?** [15 Real CLAUDE.md Files From Production SaaS Repos](/blog/claude-md-examples-production-saas) has annotated, line-by-line examples from a Next.js + Stripe app, a Postgres/Drizzle schema, and a monorepo, with notes on why each line earned its place.


## Related
- [claude-md-linter](https://www.agentickit.co/tools/claude-md-linter)
- [rules-grader](https://www.agentickit.co/tools/rules-grader)
- [code-reviewer](https://www.agentickit.co/agents/code-reviewer)
- [devops-engineer](https://www.agentickit.co/agents/devops-engineer)
- [project-conventions](https://www.agentickit.co/skills/project-conventions)
- [/audit](https://www.agentickit.co/commands/audit)
