Skip to content
Module
Module 2 of 5Lesson 2 of 2~22 min

Write a CLAUDE.md that actually helps

An instruction file that is too long or too vague gets ignored by the agent, and the team ends up correcting the same drift again and again. This lesson teaches you to write a concise CLAUDE.md for your repository that actually guides Claude Code, to place each instruction at the right level and to improve it as you observe mistakes.

Lesson objective

By the end of this lesson, you will be able to write a short, useful CLAUDE.md for your repository, choose where each instruction belongs (user, project, local, subdirectory, path-scoped rule, import) and evolve it based on the agent's mistakes.

Topics covered

  • CLAUDE.md
  • Claude Code
  • coding agent instructions
  • repository conventions
  • project memory

Where it fits

Master context and CLAUDE.md

What does the agent know about my project at any moment, and how do I give it the right information without drowning it?

Lessons in this module

  1. What Claude Code has in mind, and how to manage it
  2. Write a CLAUDE.md that actually helps (this lesson)

What you will learn in this module

This lesson is part of the course Work with Claude Code on a real project: context, planning, review

  • Explain what fills Claude Code's context window and manage it (/context, /clear, /compact, resuming and naming sessions), taking cost into account.
  • Write a short, useful CLAUDE.md placed at the right level of the hierarchy (user, project, local, subdirectory, path-scoped rules), with imports if needed.