Real-World Case Files

CLAUDE.md Examples

18 real CLAUDE.md and AGENTS.md files from public repositories, each annotated to show how it organizes agent conventions — persona, code style, invariants, skill authoring, and unattended loops.

These are examples, not templates. Every file is a real project's own config, picked for a section that demonstrates a technique you can adapt — study the highlighted parts rather than copying a whole file. Each link is verified live to the file on its default branch.

01How to read this

A Case Museum, Not a Template Library

Most CLAUDE.md files in the wild are a specific project's own documentation — build commands, a source-tree map, house rules — and copying one wholesale would import details that make no sense in your repo. So this page does not hand you a fill-in-the blanks template.

Instead, each entry below points at a real file and calls out the one or two sections worth borrowing — the way a persona is framed, how conventions are expressed as good/bad pairs, where an edit boundary is drawn, what a "definition of done" looks like. Read the technique, then write your own. For a broader tour of how these files fit the agent stack, see Harness Engineering.

02Library

18 Annotated Examples

Each card links to the real file, notes why it's worth studying, and lists the sections you can lift into your own config. Deep-link any example with its anchor, e.g. /claude-md-examples#ponytail-lazy-senior-dev.

AGENTS.md~2,600 charsuniversal

Why it's notable: A persona file that is actually a decision procedure: the 'lazy senior dev' framing resolves into a concrete 7-rung ladder (YAGNI → reuse → stdlib → one line → minimal code) plus an explicit list of what NOT to be lazy about. It turns a vibe into checkable behavior.

Sections worth borrowing

  • persona framing as a decision ladder
  • explicit not-lazy-about carve-outs
  • root-cause-over-symptom rule
AGENTS.md~6,820 charsuniversal

Why it's notable: A masterclass in structuring a multi-skill agent system in one file: three named flows (Setup / Decide / Deliver), a skill catalog, and a full 'Definition of Ready' + label state-machine for running the agent unattended over an issue tracker. Shows how to encode an entire operating model, not just rules.

Sections worth borrowing

  • three-flow decomposition
  • definition of ready
  • label namespaces as a state machine
  • out-of-scope section

Why it's notable: The clearest way to express code conventions to an agent: every rule (inline single-use vars, no unnecessary destructuring, early returns over else, snake_case Drizzle columns) is a tight Good/Bad code pair, not prose. The Knip section shows how to encode a tool's failure modes and the exact fix for each.

Sections worth borrowing

  • good/bad code-pair conventions
  • single verify command (bun run check)
  • per-tool failure→fix table (knip)
AGENTS.md~4,999 charsuniversal

Why it's notable: A rare example that spends most of its length defining boundaries: what the skill must exclude (architecture opinions, formatting, tool instructions) and a suggest-vs-require rubric ('consider' for optimizations, 'always/never' only for correctness). A strong template for keeping a domain skill focused and non-opinionated.

Sections worth borrowing

  • explicit exclude list
  • suggestions-vs-requirements rubric
  • four self-check questions for new content
AGENTS.md~2,526 charsuniversal

Why it's notable: Organizes guidance around a dedicated Anti-Patterns section — SQL injection, secrets, resource cleanup, missing compatibility_date — each a NEVER/ALWAYS code pair. Also shows how to flag a non-obvious repo fact (this repo uses jujutsu, not git) so the agent doesn't reach for the wrong tool.

Sections worth borrowing

  • anti-patterns section with never/always pairs
  • declaring the VCS/toolchain up front
  • where-to-look task table
AGENTS.md~1,829 charsuniversal

Why it's notable: A compact, well-annotated map of a monorepo that ships parallel Claude Code and Codex editions from one source tree. Cleanly separates analysis skills (return findings) from workflow skills (act on them), and points at the edition-specific AGENTS.md rather than duplicating rules.

Sections worth borrowing

  • annotated directory tree
  • analysis-vs-workflow skill distinction
  • delegating to a nested AGENTS.md

Read the file

tobihagemann/turbo
CLAUDE.md~4,344 charsclaude-code

Why it's notable: Nails the single most common agent footgun in a build-step repo: a load-bearing 'edit src/, NEVER edit plugins/' invariant, spelled out with the build note that generated diffs are expected and must be staged. The Session Resilience section (commit per logical unit, rate limits can kill a session) is broadly transferable.

Sections worth borrowing

  • source-vs-generated edit boundary
  • session resilience / commit cadence
  • DO/DON'T before-committing checklist
CLAUDE.md~5,149 charsclaude-code

Why it's notable: A fully worked example of using CLAUDE.md as the agent's persistent identity and voice spec — Core Truths, Vibe, emoji budget, boundaries — treating the file as memory reloaded every session. Useful as a reference for the persona/voice half of an agent config, distinct from the engineering rules other examples cover.

Sections worth borrowing

  • voice and tone rules with examples
  • boundaries for external vs internal actions
  • CLAUDE.md-as-persistent-memory framing
AGENTS.md~1,834 charsuniversal

Why it's notable: Demonstrates the pointer pattern done well: AGENTS.md declares CLAUDE.md the single source of truth and links the architecture/contributing docs, then still carries the handful of essentials (minimal-intrusion, YAGNI, invariants, verify commands) an agent needs before opening anything else. Includes a crisp AI-assisted vs AI-authored attribution rule.

Sections worth borrowing

  • pointer-to-canonical-doc pattern
  • coding-standards essentials
  • AI attribution (assisted vs authored)

Read the file

ethanhq/cc-fleet

Why it's notable: An unusually disciplined content policy for skill authors: add a use case only when it beats fetching the docs, put 'when to use' guidance in exactly two places and nowhere else, and never commit code that will go stale. The reasoning ('a reference body is read only after the agent chose to open it') is a portable mental model.

Sections worth borrowing

  • only-if-it-beats-the-docs rule
  • where routing text belongs (and doesn't)
  • required_access metadata tokens
  • semver bump policy

Read the file

langfuse/skills
CLAUDE.md~1,946 charsclaude-code

Why it's notable: The most actionable take on SKILL.md frontmatter: the exact allowed fields, the lowercase-hyphen name rule, and a validation-error → fix table so the agent can self-correct. A clean model for encoding a spec's constraints plus its common failure modes in one place.

Sections worth borrowing

  • allowed-fields whitelist
  • validation-error→fix table
  • before-committing checklist
AGENTS.md~3,037 charsuniversal

Why it's notable: Frames a markdown-authoring repo as red-green-refactor with the validator as the test gate, and gives an explicit 'Definition of Done — run before every commit' block of exact commands. The Gotchas section (generated README tables, description length limit) captures the tribal knowledge that usually lives only in reviewers' heads.

Sections worth borrowing

  • definition of done command block
  • validator-first (red/green/refactor) framing
  • gotchas for generated files

Read the file

pproenca/dot-skills
CLAUDE.md~1,087 charsclaude-code

Why it's notable: A model of restraint: the file opens by stating it is intentionally short, links the canonical AGENTS.md / instructions / architecture docs, and lists only the few ground rules that must be seen first. It even encodes the conflict-resolution rule — trust the linked source and delete the duplicate here — which keeps the file from drifting.

Sections worth borrowing

  • intentionally-short entry point
  • read-first link list
  • conflict-resolution / anti-drift rule

Read the file

gastownhall/beads

Why it's notable: A complete, transferable playbook for a skills repository: the directory contract, the SKILL.md frontmatter, the token/line budget, the 'body is written for Claude, not end users' rule, and the exact marketplace.json edit needed to register a new skill. Concrete about the steps that are easy to forget.

Sections worth borrowing

  • skill directory contract
  • token/line budget with a checker
  • register-a-new-skill steps (marketplace.json)

Read the file

posit-dev/skills

Why it's notable: One of the most-copied skill-authoring references: a full SKILL.md skeleton (How It Works / Usage / Output / Present Results / Troubleshooting), a context-efficiency section explaining progressive disclosure and the 500-line budget, and hard script requirements (set -e, JSON to stdout, status to stderr).

Sections worth borrowing

  • SKILL.md skeleton
  • context-efficiency / progressive disclosure guidance
  • script requirements (stdout/stderr contract)

Why it's notable: Distills skill authoring to a numbered quick checklist plus a 'What Makes a Good Skill' rubric (concise, third-person description, what+when, one-level-deep references, no redundancy). Pairs well with the longer Vercel template when you want the short version of the same standard.

Sections worth borrowing

  • quick checklist for a new skill
  • good-skill rubric
  • flat references/ with prefix grouping
CLAUDE.md~1,218 charsclaude-code

Why it's notable: A tight, transferable style guide for a TypeScript MCP server: ESM with .js import extensions, zod for tool-input validation, and the non-obvious '.nullable() instead of .optional() for MCP tool params (gpt-5 compatibility)' rule — exactly the kind of cross-model gotcha worth encoding once so the agent doesn't rediscover it.

Sections worth borrowing

  • MCP-server code style rules
  • zod input-validation convention
  • cross-model compatibility gotcha
  • single ./check gate

03FAQ

CLAUDE.md FAQ

What is a CLAUDE.md file?

CLAUDE.md is a Markdown file Claude Code loads automatically at the start of every session, giving the agent durable, project-specific context: conventions, architecture notes, build commands, and rules to always follow. Other agents read an equivalent AGENTS.md; many repos keep one file and symlink the other. It is the static-memory layer of the harness — the ground rules the agent sees before it does anything.

Are these templates I can copy directly?

No — and that is deliberate. These are real CLAUDE.md and AGENTS.md files from public repositories, chosen because a specific section demonstrates a transferable technique: a persona expressed as a decision ladder, conventions written as good/bad code pairs, a source-vs-generated edit boundary, a validator-first definition of done. Study the highlighted sections and adapt the pattern to your project; copying a whole file wholesale would import another project's private details.

What makes a good CLAUDE.md file?

The best examples here share a few traits: they lead with the few things an agent must see first and link the rest, they express conventions as concrete code pairs rather than prose, they name the load-bearing invariants (what never to edit, what to run before committing), and they keep the file dense. Several explicitly cap their own length or point to a canonical doc to avoid drift.

Should I use CLAUDE.md or a memory tool?

Both, for different jobs. CLAUDE.md is static memory you write by hand — identity, conventions, and rules that hold across sessions. A memory tool is dynamic memory the agent maintains itself as it works. Start with a good CLAUDE.md, then add a memory tool when the agent needs to remember what happened, not just the rules it should follow. See our directory of agent memory tools for the dynamic side.

04Next

Keep Going

Stay Updated with Claude Skills

Subscribe to get the latest Claude Skills, tutorials, and community highlights delivered to your inbox.

We respect your privacy. Unsubscribe at any time.