Skip to content

Chapter 2 of 7

Project Context and Configuration

Beyond the working directory, the most effective way to give Claude Code persistent project knowledge is through a `CLAUDE.md` file placed in the project root. Claude Code automatically reads this markdown file at the start of every session, so it should contain a project overview, the tech stack, coding conventions, common commands, environment setup instructions, and any behavioral preferences you want the assistant to follow. A well-crafted `CLAUDE.md` reduces the need to repeat the same context in every prompt and helps the assistant stay consistent with the rest of your team. You can also use the file to set persistent exclusions, which is a clean alternative to reminding Claude on every request not to touch a particular path.

When joining a new project, you can prompt Claude to explore the structure and produce a high-level overview: "Explore the project structure and give me an overview of the architecture, key files, and how the main features work." For local setup, a prompt like "Read the project structure and tell me exactly what commands I need to run to set up this project locally from scratch" yields a precise, step-by-step answer. To make configuration reproducible across contributors, ask Claude to "Create `.env.example` / config files for this project with all required environment variables documented with descriptions and examples."

You can also ask Claude to explain any third-party package it encounters: "Explain what [library/package] does, why it's used in this project, and what would need to change if we removed it." If you need Claude to leave certain files alone during a particular task, instruct it inline with "Do not modify [filename]. Only change [other file]," or codify the exclusion in `CLAUDE.md` so the rule persists across sessions.

All chapters
  1. 1Getting Started with Claude Code
  2. 2Project Context and Configuration
  3. 3Reading, Searching, and Understanding Code
  4. 4Writing, Editing, and Refactoring Code
  5. 5Testing, Debugging, and Code Review
  6. 6APIs, Data, and Infrastructure
  7. 7Architecture, Documentation, and Release Workflow

Drill it

Reading is not remembering. These come from the Claude Code Prompts deck:

Q

What is Claude Code?

Claude Code is Anthropic's official AI-powered CLI tool that helps developers write, edit, debug, and understand code directly in the terminal.

Q

How do you start Claude Code?

Run `claude` in your terminal from any project directory to start an interactive session with the AI assistant.

Q

What is the key benefit of working in Claude Code's agentic mode?

Claude Code can read files, write code, run tests, and execute shell commands autonomously, completing complex multi-step tasks end-to-end.

Q

How do you give Claude Code access to your entire project?

Navigate to your project root before starting Claude Code — it will automatically have context of all files in the working directory.