Skip to content

Day 1 of 52 · about 20 min · Context

Set up Claude Code and write your first CLAUDE.md

Claude Code starts every session knowing nothing about your project. A short CLAUDE.md gives it your commands, rules and files to leave alone, before you type a word.

You’ll finish with

  • Claude Code installed and logged in
  • A short CLAUDE.md with your commands and rules
  • Proof that Claude answers from it

You’ll need

  • A Claude Pro, Max, Team or Enterprise plan, or a Console account (not the free plan)
  • macOS 13+, Windows 10 1809+, Ubuntu 20.04+ or Debian 10+
  • Node.js 22+ for the practice project

Before you start

Tell us about your setup and the steps change to fit it. Your answers stay in this browser, and you can change them at any time.

Which system are you on?

Commands differ between systems. Pick the one you’ll run Claude Code on.

Which project will you use?

The steps

One step at a time. When a step’s check matches, tick it and the next one opens.

0 of 4 steps done0%
  1. Step 1 of 4: Install Claude Code

    Run the official installer, then check it.

    For macOS, Linux and WSL

    Terminal

    Run: curl -fsSL https://claude.ai/install.sh | bash

    What happens: Then open a new terminal.

    Run: claude --version

    On WSL, use your Linux shell.

    For Windows

    PowerShell

    Run: irm https://claude.ai/install.ps1 | iex

    What happens: Then open a new PowerShell window.

    Run: claude --version

    No Administrator rights needed.

    The installer shows no progress while it downloads.

    Check it worked

    claude --version prints a version number.

    If it didn’t work

    `claude` isn’t found or recognized

    Open a new terminal. If that fails, add the install folder to your PATH.

  2. Step 2 of 4: Open your project and log in

    Run claude in your project folder.
    Terminal

    What happens: Practice: download the project, unzip it and run the tests in its folder.

    Run: npm test

    What happens: Own project: open a terminal in its root folder.

    Run: claude

    What happens: Trust the folder if you know its code.

    What happens: First run: log in, in your browser, with your plan’s account.

    You type: /status

    Claude works on the folder you start it in.

    Check it worked

    Practice tests: pass 8, fail 0. /status shows your plan’s account; Esc closes it.

    If it didn’t work

    The browser doesn’t open or shows a code

    Press c to copy the login URL. If the browser shows a code, paste it at Paste code here if prompted.

  3. Step 3 of 4: Write your CLAUDE.md

    Let /init draft it, then keep only what the code doesn’t show.

    Type /init: Claude drafts a CLAUDE.md, or suggests improvements to yours.

    Keep

    • Commands it can’t guess
    • Non-default rules
    • How to check work
    • Files to leave alone, and why

    Cut

    • What the code shows
    • Standard conventions
    • What changes often
    Stay well under 200 lines: longer files are followed less reliably.

    For “The practice project”

    Then use our finished file:

    CLAUDE.mdMarkdown
    # Acme Quotes
    
    A command-line quote calculator for a small services business. It prices hours
    per role from a rate card, takes off an optional discount, adds VAT and prints
    the total. Plain Node.js with no dependencies.
    
    ## Commands
    
    - `npm test`: run every test in `test/` with Node's built-in test runner.
    - `npm run quote -- design:10 dev:24 --discount 10`: print a sample quote.
    - Needs Node 22 or newer. Ask before adding any npm package.
    
    ## Code rules
    
    - `src/quote.js` stays pure: no file, network or console access. Input and output belong in `src/cli.js`.
    - ES modules with `import`/`export`. Relative imports keep the `.js` extension.
    - Money is whole cents (integers) inside `src/quote.js`. Only `formatMoney` turns cents into text.
    - Round to the cent with `Math.round` at each step: each line, the discount, the VAT.
    - The discount comes off before VAT is added.
    - Throw an `Error` with a message the user can act on. `src/cli.js` prints it and exits with code 1.
    - 2-space indentation, single quotes, semicolons.
    
    ## Before you say a task is done
    
    1. Run `npm test`. Show the pass and fail counts from the output.
    2. If you touched pricing, run `npm run quote -- design:10 dev:24 --discount 10`.
       The total is EUR 3,326.40 unless the task was meant to change it.
    3. New behaviour in `src/quote.js` needs a test in `test/quote.test.js`.
    
    ## Don't edit by hand
    
    - `data/rates.json`: prices are the owner's call. Change them only when asked, and list what changed.
    - `.env`: holds secrets. Don't open, print or commit it. `.env.example` is safe to edit.
    

    Also in the finished kit.

    For “My own project”

    Then tighten the draft:

    Paste into Claude Code
    Read CLAUDE.md and check it against this project. Keep only what you can't work out from the code:
    
    - Commands: install, test, run and lint, including how to run one test file.
    - Code rules that differ from the usual defaults.
    - Before you say a task is done: the commands that must pass and the proof to show me.
    - Don't edit by hand: generated files, secrets and files someone else owns, each with the reason.
    
    Ask me about anything you can't confirm. Keep it well under 200 lines. Show me the file before you save it.

    Or use our template:

    CLAUDE.mdMarkdown
    <!--
    Template for your own project. Save it as CLAUDE.md in your project root,
    replace every <placeholder> and delete the lines that don't apply.
    
    Write rules Claude can check: "Run npm test before saying you're done", not
    "Test your changes". Leave out what Claude can see in the code, such as what
    each folder holds. Keep it short; add a line when Claude makes the same
    mistake twice. Claude Code strips block-level HTML comments like this one
    before the file reaches Claude's context, so these notes cost nothing if you
    leave them in.
    -->
    
    # <Project name>
    
    <One or two sentences: what the project does and who uses it.>
    
    ## Commands
    
    - `<install command>`: <installs dependencies>
    - `<test command>`: <runs the tests; add how to run a single test file>
    - `<run or build command>`: <starts the app or builds it>
    - `<lint or format command>`: <checks style; say whether it also fixes files>
    
    ## Code rules
    
    - <A rule you could check in a review, such as "Use 2-space indentation">
    - <A convention a new teammate gets wrong, such as where new API routes go>
    - <A library or pattern to use, and one to avoid>
    
    ## Before you say a task is done
    
    1. <A command that must pass, such as `npm test`>
    2. <A second check, such as the type checker or the linter>
    3. <The proof to show, such as the test summary line>
    
    ## Don't edit by hand
    
    - `<generated or owned file>`: <why, and what to change instead>
    - `.env`: holds secrets. Don't open, print or commit it.
    

    Check it worked

    Your project root holds a short CLAUDE.md.

  4. Step 4 of 4: Prove Claude reads it

    Restart, find it in /context all, then ask what only CLAUDE.md can answer.
    In Claude Code

    You type: /exit

    What happens: Start claude again: CLAUDE.md loads at startup.

    You type: /context all

    What happens: Listed under Memory files.

    Without all, fullscreen folds the list away.

    Then ask:

    Paste into Claude Code
    Answer from your project instructions, without opening any files:
    
    1. Which files must you not edit by hand, and why?
    2. What do you do before you tell me a task is done?

    Check it worked

    • Practice: Claude names data/rates.json and .env, and says it runs npm test and shows the counts.
    • Own project: it matches your CLAUDE.md.

    If it didn’t work

    CLAUDE.md isn’t under Memory files

    Name it exactly CLAUDE.md (Windows can hide a .txt ending) and start claude in its folder.

    Claude stopped reading your AGENTS.md

    Claude reads it only when there’s no CLAUDE.md. Put @AGENTS.md on CLAUDE.md’s first line.

Finish · 4 of 4 steps to go

Claude Code knows your project

When Claude repeats a mistake, add one short line to CLAUDE.md.

What you’ll have checked

  • /context all lists CLAUDE.md
  • Claude answers from it

Lesson updates by email

Get lesson updates by email

Leave your email and we’ll tell you when we add or update a lesson.

We’ll email you when we add or update a lesson. We use your email only for this. Privacy policy

Claude Code for your team

Want Claude Code set up across your team?

HorizonLux sets up and repairs Claude Code for teams: CLAUDE.md rules, hooks that enforce them and reviewed MCP servers. Book a free call to talk it through.

Questions

Questions about Day 1

Does Claude always follow CLAUDE.md?

Not always: it’s context, not enforced configuration. For anything that must never happen, use a hook ([Day 14](/resources/claude-code-challenge/day-14-hooks)).

Sources

Checked against the official Claude Code docs on .

Independent resource, not affiliated with Anthropic. HorizonLux wrote this lesson; Claude Code is made by Anthropic.