Claude Code tutorial series

CLAUDE.md and project instructions

Write a short file of facts the agent will get wrong without help. Do not paste another team's novel.

Why a markdown file beats a longer prompt

CLAUDE.md is the public, durable place for language, package manager, test command, and forbidden paths. You should not retype those every session.

It is not a vision deck. If a sentence will not change an edit, delete it.

Official docs also describe extra memory the product may keep. This course still starts with a file you can diff in git.

Where it lives

Put the first file at the repo root so every surface can see the same brief. Nested files can wait until a monorepo actually needs them.

User-level notes are for personal habits. If they fight the repo file, keep the one you want and delete the other.

doctor and a new session are how you check that the file loaded. Do not assume save equals a live brief.

  • Root CLAUDE.md first.
  • Commit it if the team should share it.
  • Confirm a new session sees it.
Diagram of CLAUDE.md, skills, and MCP stacked on a repo.
Instructions first. Skills next. MCP last.

What to write

Always-on facts: runtime, package manager, how to run tests, codegen you must not touch, secrets paths.

Write only what the agent will get wrong. Do not recopy the README architecture story.

Use short bullets. Link to a doc instead of pasting a style guide.

  • Test command must run on your machine.
  • Bans are paths, not adjectives.
  • Short first.

Repo, user, and nested scopes

Repo file is the team contract. User file is your laptop. Nested files are for packages that truly differ.

If two files disagree on the test command, the agent will look lucky or stupid at random. Pick one.

  • One source of truth for tests.
  • Nested only when packages differ.
  • No secrets in any of them.

Auto memory is not a substitute

The product may save learnings across sessions. Treat that as bonus, not as the file you skip writing.

Anything the next teammate needs belongs in git, not only in your local memory store.

  • Team facts in CLAUDE.md.
  • Personal shortcuts can stay local.
  • Do not store tokens in memory notes.

Settings are not instructions

Permissions, models, and MCP live in settings files. Do not hide the test command only there.

If you edit settings, run doctor. A typo there looks like a model failure.

  • Instructions = markdown facts.
  • Settings = client behavior.
  • doctor after edits.

How a team uses one file

Review CLAUDE.md like code. A drive-by paragraph that bans a library should get a comment.

Keep it under a size you would actually read in a PR.

  • PR the file.
  • Delete stale bans.
  • Point newcomers at it in onboarding.

Instruction-stage mistakes

Pasting another company's full CLAUDE.md, including their cloud names.

Writing a novel while doctor still cannot find the file.

  • Secrets in markdown.
  • User and repo rules that fight.
  • README clone.

Done looks like this

You can point at three bullets the agent must not ignore.

  1. Root file exists.
  2. Test command is real.
  3. Bans are paths.
  4. No secrets.
  5. New session sees it.

Next: turn repetition into a skill

The skills chapter packages a playbook you keep rerunning.

MCP still waits one more chapter.

FAQ

Is CLAUDE.md required?

Not mandatory, but large repos without it get average-internet edits.

CLAUDE.md or AGENTS.md?

This product's project file is CLAUDE.md. Codex-oriented repos may also have AGENTS.md. Do not maintain two novels.

Can I keep it private?

Yes, a user-level file can stay off git. Team conventions should be shared.

How long?

If you would not read it in two minutes, it is too long for week one.

Does every surface read it?

That is the public intent. Confirm on the surface you actually use.

Markdown format?

Headings and bullets. No need for a custom schema on day one.

What if it is ignored?

Check the path, start a new session, run doctor. Then shorten the file.

All chapters in this series

  1. 1. What Claude Code is (and is not)
  2. 2. Install Claude Code the 2026 way
  3. 3. Finish your first reviewable Claude Code task
  4. 4. CLAUDE.md and project instructions
  5. 5. Claude Code skills you can reuse
  6. 6. Add one MCP server to Claude Code
  7. 7. Claude Code vs OpenAI Codex
  8. 8. Claude Code troubleshooting