Lesson 1 of 9 · Claude Code

Install and your first session

One install command, one sign-in, one folder. By the end of this lesson you will have watched a real session build a web page and you will know what every line on the screen meant. Everything here is as of September 2026.

If you want the short version of what Claude Code is, what it costs, and who it is for, read Agents lesson 3, Claude Code and Codex first. That lesson also covers the one real risk: you are handing an agent part of your computer. This lesson assumes you read it and starts at the terminal. It walks through installing, signing in, what a "session" actually is, the loop Claude Code runs on every request, and the handful of commands that matter on day one. Every command below was checked against the docs at code.claude.com on the day this was written.

Four ways to install, and which one to pick

Claude Code is one program that shows up in four places. What changes is the window you talk to it through.

1. The terminal (the native installer). This is what the docs recommend and what the rest of this module assumes. A "terminal" is the plain text window where you type commands: Terminal on a Mac, PowerShell or Command Prompt on Windows. Paste the line for your system and press Enter.

# macOS, Linux, or WSL
curl -fsSL https://claude.ai/install.sh | bash

# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

# Windows Command Prompt (CMD)
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

On Windows, the docs give one tell for which window you are in: the prompt starts with PS C:\ in PowerShell and plain C:\ in CMD. Native installs update themselves in the background. Homebrew and WinGet are also documented and do not auto-update. The older npm route (npm install -g @anthropic-ai/claude-code) is still in the docs under advanced options, needs Node.js 22 or later, and installs the same native program. Confirm any install with:

claude --version

It prints a version number followed by "(Claude Code)." The session in this lesson was captured on 2.1.274.

2. The desktop app. The Claude desktop app for macOS and Windows has a Code tab, and the docs say no terminal is required. It includes Claude Code, so you do not install the command-line program separately unless you also want to type claude in a terminal. You pick a folder, type a request, and review changes in a visual diff view instead of reading text output.

3. The VS Code extension. Search "Claude Code" in the Extensions view of VS Code (or Cursor) and install. The extension bundles its own copy of the program for its chat panel. If you also want to run claude in VS Code's built-in terminal, install the native version too.

4. The JetBrains plugin. IntelliJ, PyCharm, WebStorm, GoLand, and the rest. This one does not bundle the program. Install the native version first, then the Claude Code plugin from the JetBrains Marketplace, then restart the IDE.

Pick the terminal if you plan to follow this module. Every later lesson shows terminal commands, and the other three sit on top of the same program.

Signing in

Type claude in any folder and the first run asks you to log in. Your browser opens, you approve, and you are back in the terminal. As of September 2026 the accounts that work are a Claude Pro, Max, Team, or Enterprise subscription, or a Claude Console account, which is API access with pre-paid credits. The setup docs say it plainly: the free claude.ai plan does not include Claude Code. To switch accounts later, type /login inside a session.

One thing worth knowing before your first prompt: on Pro, Max, and Team plans, a fresh terminal session now starts in what the docs call auto mode, where a classifier reviews actions instead of asking you. The session you will watch below was run in a different mode, accept edits, which is why one of its notes mentions Manual mode. Lesson 2, Permission modes and safety, explains every mode and how to choose. For today, know that Shift+Tab cycles between them and the mode indicator on screen shows which one is active.

What a session is

A session is one conversation tied to one folder. You open a terminal, cd into the folder you want Claude to work in, type claude, and everything from then until you exit is one session. Claude Code can read and change files in that folder and below it, run any command you could run, and see your git state if the folder is a repository.

The part that trips people up: each new session starts with a fresh context window. The context window is the model's working memory for one conversation. Your prompts, every file it read, every command result, and its own replies all live there. When you exit, that conversation is saved to disk under ~/.claude/projects/, but the next time you type claude you get an empty window. It does not remember yesterday unless you reopen yesterday or wrote something down. That one fact is the reason lesson 3 exists, and it gets its own callout below.

The work loop, and a real session to watch

Anthropic describes what happens after you press Enter as three phases: gather context, take action, verify results. In practice you will see it as five beats that repeat: it reads what it needs, plans in a sentence or two, edits a file, runs something to check, and reports back. A question about your folder might only need the read. A bug fix loops through all five several times. You can interrupt at any beat.

Here is a real one. On the day this was written I opened Claude Code in an empty folder and asked for a one-page site for a made-up side-by-side rental shop in Hurricane. Tap through it. Each step is labeled with what it is, and the notes under the steps are the teaching points.

A real first session, step by step

  1. 1. You typed

    Build a one-page website for Zion Ridge UTV Rentals, a fictional side-by-side rental company in Hurricane, Utah. Single index.html with inline CSS, no frameworks. Include a hero with a headline, three rental options with day rates, hours, and a contact section with a phone number. Keep it under 150 lines. When done, list the files you created.

    One prompt with the goal, the constraints, and the finish line. Same four ingredients as everyday prompting.

1 of 17

Real Claude Code session, captured 2026-09-17 and trimmed for length. Prompts and tool calls are verbatim.

What you just watched, beat by beat:

  • The prompt. Step 1 is the request. Notice it carries a goal, constraints (single file, inline CSS, under 150 lines), and a finish line (list the files). That is the same recipe as everyday prompting, just pointed at a folder instead of a chat box.
  • The tool call. Step 3 is Claude Code using its Write tool to create a file. A "tool" is an action the agent can take: Read, Edit, Write, Bash (run a command), Glob and Grep (find files and text), WebFetch, WebSearch, and a few more. Every action Claude Code takes on your computer goes through one of these, which is what makes them controllable.
  • The result. Step 4 is what the tool returned. The agent reads results the same way it reads your prompt, so a command that fails feeds the failure straight back into its next decision.
  • The verify step. Step 5 is Bash counting the lines it just wrote. Nobody asked for that. Good agents check their own work.
  • The reply. Step 7 reports what it did and, more important, what it decided on its own: three specific UTV models and three specific day rates. Those are your review points. If the prices are wrong for your shop, that is the next prompt.
  • The second turn. Step 8 says "the phone number" without naming the file, and the agent knows exactly what you mean because the whole first turn is still in its context. It also pushes back on half the request because the link already existed. Then three Edit calls, the FAQ, its styling, and one small unrequested nav link that it disclosed, another verify, and a before-and-after table.

Nothing in there required you to write code. It did require you to read the replies.

What the terminal shows while it works. In the real terminal, each tool call shows up as a line naming the tool and what it touched, with the output collapsed under it. Press Ctrl+O to open the transcript viewer, which shows the full detail of every tool call and result, and press it again to go back. In Manual mode, a file edit or command pauses with a permission prompt: the proposed change, then Yes or No. Esc declines.

Stopping it. Press Esc once to stop Claude mid-turn. It cancels the running tool call, keeps whatever work is already done, and waits for you. Ctrl+C also interrupts a running operation; when nothing is running, the first press clears what you typed and a second press exits. To leave on purpose, type /exit or press Ctrl+D twice. In the desktop app there is a stop button. You can also just keep typing: a message sent while Claude is working is queued and delivered when the current tool call finishes, which is how you steer without stopping.

The four commands to learn first

Anything that starts with a slash is a command to Claude Code itself, not a request to the model. Type / alone to see the full list. These four cover the first week.

  • /help shows help and the available commands. When you forget a name, start here. You can also ask it in plain English how to do something in Claude Code.
  • /context draws the context window as a colored grid: how full it is and what is taking the space. Run it when a session starts feeling slow or forgetful. It also warns you when the window is over its limit and tells you which command frees space.
  • /memory opens your CLAUDE.md files for editing and shows what auto memory has saved on its own. CLAUDE.md is the instructions file Claude reads at the start of every session in that folder. Lesson 3 is entirely about it.
  • /init looks at the folder and writes a starter CLAUDE.md for it. If it finds instruction files for other tools, such as an OpenAI Codex or Gemini CLI config, it offers to carry them over.

Picking up where you left off. Three commands look similar and do different things.

  • /clear, typed inside a session, starts a brand new conversation with an empty context. It does not delete the old one; that is saved and can be reopened. Use it when you switch to an unrelated task and want the window clean. To shrink the current conversation without leaving it, /compact summarizes it instead.
  • claude --continue, typed at the terminal in the same folder, reopens the most recent conversation there, tool calls and all. This is your "same job, next morning" command.
  • claude --resume opens a picker of saved sessions in the current folder so you can choose an older one. Inside a session, /resume does the same switch without exiting. Name a session with /rename and you can reopen it by name later.

Try this yourself

Twenty minutes, any folder. A copy of a folder is safer than the original if you have never done this.

  1. Install with the command for your system above, then run claude --version to confirm.
  2. Open a terminal, cd into a folder you do not mind Claude touching, and type claude. Sign in when the browser opens.
  3. Type /init. When it finishes, open the CLAUDE.md it created and read every line. Ask yourself what it got right about the folder and what it guessed.
  4. Ask for one small change and watch the tool calls go by. Press Ctrl+O once to see the full detail, then again to close it.
  5. Type /context and look at what filled the window in one short task. Then /exit, reopen with claude --continue, and confirm it still knows what you did.

Here is the transcript's prompt with the business swapped for placeholders.

Build a one-page website for [business name], a [what you do] in [town], Utah. Single index.html with inline CSS, no frameworks. Include a hero with a headline, three services with prices, hours, and a contact section with a phone number. Keep it under 150 lines. When done, list the files you created.

When it finishes, read the reply for the decisions it made without asking, then fix one of them in a second prompt. That two-turn rhythm, ask, read, correct, is the whole skill. The next lesson covers what it is allowed to do between your turns, and how to set that on purpose.

Next lesson2. Permission modes and safety

Last updated September 17, 2026