CLAUDE.md and Friends: Project Context Files That Actually Work

CLAUDE.md, AGENTS.md, and project context files: what to put in them, how to structure them, and why they fix the re-explaining problem.

LayerFlow Team6 min read
CLAUDE.md and Friends: Project Context Files That Actually Work — LayerFlow blog illustration

CLAUDE.md is a file in your repository that tells AI coding tools how the project works: conventions, architecture, commands, and constraints. AGENTS.md and similar files do the same job across other tools. In 2026, with coding assistants like Claude Code and Cursor reaching 18% work adoption each, these files are becoming the standard interface between teams and AI.

A good context file is the cheapest productivity infrastructure your team can build — and a bad one is noise the model reads every session. This guide covers what belongs inside, how to structure it, and the maintenance rhythm. It complements the LayerFlow workspace approach to context; the docs show the full setup.

What belongs in a project context file

  • Tech stack and versions: Next.js 14, TypeScript, Prisma — no ambiguity.
  • Architecture: where the code lives, how layers talk to each other.
  • Conventions: naming, patterns, testing requirements.
  • Commands: how to build, test, lint, and run.
  • Security rules: never commit keys, validate inputs, no raw SQL.
  • Project state: what is in flight and what is off-limits.

What does not belong: history, personal preferences, and anything the model can discover from the code itself. The file answers the questions that code cannot answer.

A structure that survives teams

Use short sections with a fixed order: project overview (2-3 lines), stack, architecture, conventions, commands, guardrails. Keep every section under ten lines. If a section grows past that, it is documentation that belongs in the docs folder — and the context file should point there.

Write it so a new developer — or a new model — can act correctly on their first session. Test this literally: give the file to a fresh teammate and see if they ask zero setup questions.

The maintenance rhythm

Context files rot faster than code. The fix is small and regular: every time a convention changes, update the file in the same commit. Every time a model does the wrong thing because the file was stale, fix the file on the spot. A quarterly review that reads the file top to bottom and cuts anything unused keeps it honest.

Beyond repositories: project context everywhere

The same pattern extends beyond code: a team wiki page, a shared workspace, a Notion doc. The principle is identical — durable state that every AI session and every teammate consumes instead of recreating. The difference between a file and a workspace is automation: files require tools to read them; workspaces attach context automatically.

Internal next steps

Pair this with Context Engineering and Prompt Folder Structures That Scale. For system prompts in products, read OpenAI System Prompt Best Practices 2026.

Put project context where AI tools and teammates both use it: sign in to LayerFlow or keep it in a file — the discipline is the same. See pricing.

FAQ

What is a CLAUDE.md file?+

CLAUDE.md is a repository file that documents how a project works for AI coding tools — stack, architecture, conventions, commands, and guardrails — so every session starts with the right context.

What should I put in AGENTS.md or CLAUDE.md?+

The non-obvious facts: tech stack, architecture, conventions, build commands, security rules, and current project state. Leave out anything the model can discover from the code itself.

How often should I update my context file?+

Update it in the same commit as any convention change, fix it immediately when a model acts on stale information, and do a quarterly read-through that removes unused sections.

Related posts

LayerFlow

Try the AI workspace

Save prompts, compare models, and set hard budgets in one place.