Caelan's Domain

Claude Code Guide — Part 1: Install

aiclaudeclaude-codecligetting-startedsetupclaude-code-claude-md

Created: April 27, 2026 | Modified: May 3, 2026

A chat tab forgets between launches. Claude Code remembers, because its memory is a markdown file on disk — CLAUDE.md at the root of the directory you launched from, re-read at the start of every turn. Part 1 gets the CLI installed, runs a first session in a real project, and walks you through writing that first CLAUDE.md from a short conversation rather than a template.

What that buys you:

  • A repo that behaves the same way for you tomorrow as it did today, because the behaviour lives in a file you can open in a text editor.
  • A file you commit, review in pull requests, and edit alongside the rest of the codebase — no hidden settings, no per-machine drift.

Install the CLI

Install paths change. Rather than copy commands here that go stale, follow the official setup page (see Set up Claude Code in the official docs). It covers macOS, Linux, WSL, and Windows. Come back when claude --version prints a version string in a fresh shell.

Run your first session

cd into a real project — a repo you actually work in. Not your home directory, not /, not a tmp folder. Then run claude.

cd ~/code/your-project
claude

The first time you launch, Claude Code walks you through login. Sign in with whatever credential you have — Pro, Max, Team, Enterprise, a Console API key, or cloud-provider routing through Bedrock, Vertex, or Foundry. Any of them works. Nothing in this series depends on the choice.

After login you land at a prompt with a hint about /help and a status line showing the model and the working directory. Type /help once to see what's available; the full CLI and slash-command surface lives in the official reference (see CLI reference in the official docs).

Don't launch claude from / or your home directory. Claude Code reads CLAUDE.md and .claude/ from the current directory and walks up the parent tree. Launch from ~ and you pull every Claude Code file in any project under your home onto every turn. Launch from a project root and you get just that project.

What Claude reads at the start of every turn

CLAUDE.md is a markdown file Claude Code reads at the start of every session and prepends to the model's context. Plain text, nothing magic. What makes it powerful is the loading rule: every session you run from a directory containing CLAUDE.md, or any subdirectory of one, starts with that file in context. The lines you write ride along on every prompt without you retyping them.

Two consequences fall out of that rule.

First, every line costs every turn — in tokens and in attention. Keep the file lean. The docs recommend a soft cap around 200 lines before adherence drops; shorter is better. If it takes more than a minute to read end-to-end, it's too long.

Second, every line applies project-wide. A line that says "use pnpm, not npm" binds every session in the repo, every collaborator running claude from the root, every subagent that spawns under it.

The file lives in your repo. You commit it, review it in pull requests, and edit it with your editor. There's no Claude Code UI for managing it — you open it, change it, save it.

Claude Code also keeps a .claude/settings.json next to it for permissions and other settings, but you don't write that file by hand. Claude Code maintains it for you as you click "Always allow" or "Deny" on permission prompts during sessions. Leave it alone — Part 2 is the tour of what's in there and which doc page to open when.

Write yours

The first prompt in the panel writes your CLAUDE.md from scratch. It's a short conversational interview — Claude asks you three or four plain-language questions about your project and how you want it to behave, then writes the file to ./CLAUDE.md and tells you what changed about how it'll respond from now on.

There's no template to fill in and no exact headers to hit. The file ends up shaped around your project, not a generic scaffold. Open the prompts panel (right side on desktop, the floating button on mobile), copy Prompt 1, and paste it into your Claude Code session.

Make sure Claude understood

The second prompt is the check. Claude reads ./CLAUDE.md back to you in plain language — not by repeating the file, but by telling you what the file will change about how it responds — and then asks you about anything thin, contradictory, or missing.

That asking happens through a tool called AskUserQuestion. It's the model pausing to ask you a clarifying question rather than guessing past a gap. This is the first time you'll see Claude Code use it on you, and it shows up throughout the rest of the series. After you answer, Claude updates the file, shows you the diff, and asks whether to keep going. The loop runs until you say you're done.

Copy Prompt 2 from the panel when you're ready.

When you're done

You have a CLAUDE.md at the root of your project and a working install. That's the whole maintenance story: open the file, read it, edit it, commit it. No UI, no per-machine drift. New material lands in this file (or in the files Part 2 introduces alongside it), not in a settings menu.

Next: Part 2 — The .claude directory tours .claude/ and the rules folder, and shows how CLAUDE.md actually loads — parent-directory walk, @path imports, user-scope file, and the 200-line cap.