Setup & Your First Session
Install it, sign in, open a project, and run your very first task — safely, with an undo button the whole way.
- What you need before installing (and the two ways to install)
- How to sign in and let Claude Code into a project folder
- The anatomy of a session: typing, approving, interrupting, undoing
- Running your first real task from start to finish
Before you start: what you need
- A computer running macOS, Windows, or Linux.
- An Anthropic account — a Claude Pro or Max subscription, or an Anthropic Console (API) account with billing. Either works; the subscription is the simplest for learning.
- About 25 minutes and a small, low-stakes project folder to practice in (we'll create one).
For your first sessions, don't point Claude Code at important work or a folder full of personal files. Make a brand-new empty folder to play in. You'll build confidence without risk.
Step 1 — Install Claude Code
There are two common ways. If one looks unfamiliar, use the other. You type these into your terminal (macOS: open the Terminal app; Windows: open PowerShell or Terminal).
Option A — Native installer (simplest). Anthropic provides a one-line installer that doesn't require anything else first.
$ curl -fsSL https://claude.ai/install.sh | bash # On Windows PowerShell, use: > irm https://claude.ai/install.ps1 | iex
Option B — Install with npm. If you already have Node.js (version 18 or newer) installed, you can use its package manager:
$ npm install -g @anthropic-ai/claude-code
Claude Code also has extensions for VS Code and JetBrains IDEs, and apps for desktop and the web. The terminal is the best place to learn the fundamentals because you can see every step — so that's what this course uses. The skills transfer directly to the other surfaces.
Step 2 — Open a project & sign in
"Opening a project" just means starting Claude Code from inside a folder. Let's make a safe practice folder and start there.
# make a practice folder and move into it $ mkdir claude-practice && cd claude-practice # start Claude Code $ claude
The first time you run claude, it will:
- Ask you to sign in — it opens your browser to log in to your Anthropic account, then returns to the terminal. You only do this once.
- Ask you to trust the folder — confirming you're okay with Claude Code reading and working in this directory. Say yes for your practice folder.
You'll then see a prompt waiting for you to type. That's your session.
Step 3 — Understand the session controls
A few keys do almost everything. Learn these four and you're in control:
Type + Enter
Send Claude Code an instruction in plain English. This is how you ask for anything.
Esc
Interrupt. Stops Claude Code mid-action if it's going somewhere you didn't intend. Use it freely — nothing is committed without your approval anyway.
Esc, Esc (twice)
Rewind the conversation to an earlier point — your "undo" for the session if you want to take a different path.
/help and /clear
/help lists everything you can do. /clear wipes the session's working memory to start fresh on a new task (your files are untouched).
When Claude Code wants to edit a file or run a command, it pauses and shows you exactly what it will do, with options like Yes, Yes and don't ask again for this, or No, tell it what to do differently. Read these. Approving thoughtfully is the core habit of using AI well — we go deep on it in Module 5.
Step 4 — Run your first task
Let's do something real but harmless: ask Claude Code to create a simple file. Type this at the prompt:
> Create a file called notes.md with a short checklist of 3 things I should remember when using an AI coding tool. Claude Code: I'll create notes.md with a 3-item checklist. ┌─ Create notes.md ─────────────────────────────┐ │ # Using an AI coding tool — remember │ - Review every change before approving │ - Never paste secrets or passwords │ - Verify anything important yourself └────────────────────────────────────────────────┘ Approve this change? (y / n / tell me what to change) > y Claude Code: Done. Created notes.md. Anything else?
That's the whole loop you learned in Module 1, in real life: you asked, it proposed, you approved, it acted. Try a few more small asks — "rename notes.md to checklist.md," "add a 4th item about backups." Notice that each change waits for your approval.
In your practice folder, give Claude Code three small tasks in a row and approve each one. Then type /clear and watch the session reset. Finally, try typing /init — in a real project this creates a CLAUDE.md file where Claude Code stores notes about your project (you'll use this in Module 4). Get comfortable; you can't break anything in a throwaway folder.
Knowledge check
You started Claude Code in the wrong folder and it's about to edit files you care about. What's the safe move?
Esc interrupts immediately, and you can always say "no" at the permission prompt. Claude Code never changes files without your approval, so you're never trapped — interrupt, decline, and restart in the right folder.
Key takeaways
- Install with the native script or
npm, then runclaudeinside a project folder. - You sign in once and approve trust for each folder.
- Four controls run everything: type + Enter, Esc to interrupt, Esc Esc to rewind, /help & /clear.
- Always practice in a safe, throwaway folder first — you cannot break anything you don't approve.
Finished this module?