3.4 Your First Claude Code Session¶
Everything so far was preparation. This is the moment: you're going to brief an AI agent, watch it work in real time, review what it did like a professional, and commit the result. Twenty minutes from now, "I work with AI agents" will be a factual statement about you.
What you will learn
- Start, run, and exit a Claude Code session.
- Watch the agentic loop happen live and understand what you're seeing.
- Review an agent's work before accepting it — the habit that defines your ceiling.
Builder principle
Direct, don't dictate. Describe the outcome; let the agent choose the keystrokes. Review like it's your name on the work — because it is.
Pre-flight¶
Clean and committed? That's your snapshot. Agent time.
No eligible account or permission to run Claude Code? Follow the Simulation Path using the supplied transcript, permission prompts, and diff. Complete the same decisions and label the evidence simulated.
Lift-off¶
You're now at the Claude Code prompt — same terminal, new conversation partner. This folder is its intended workspace and primary context, not an operating-system boundary. Permission policy, sandboxing, tool configuration, and scoped credentials still determine what actions can reach. Type:
Watch what happens: the agent reads before it speaks — listing files, opening your README and brief. That's the gather step of the loop from Lesson 1.2, live on your screen.
The first real task¶
Give it your quick win — or if you'd rather warm up with something universal, use this:
Build me a single-page personal site: my name, one line about what
I'm learning (agentic AI), and three links (GitHub, LinkedIn, email).
Style: clean, dark background, readable on a phone.
One HTML file, everything included, no frameworks.
Done means: I can open it in a browser and it looks intentional,
not like a homework assignment.
Notice: that's the five-element brief from Lesson 2.3 — goal, context, constraints, and a definition of done. Now watch the loop run:
- Gather — it checks what exists.
- Act — it proposes creating a file; Claude Code asks your permission for actions like file writes and commands. Read what it's asking. Approve.
- Verify — watch it re-read its own output, catch things, adjust.
When it reports done, it will tell you how to look — typically:
There's your website. Made by a machine, directed by you.
The review — where you earn your keep¶
Do not skip this, today or ever:
1. See exactly what changed:
Then verify independently — exit Claude Code (/exit) or open a second
terminal:
git diff shows unstaged changes in tracked files. Pair it with
git status --short so newly created files are not missed. You may not read
HTML fluently yet — inspect the names and recognizable content anyway.
2. Test like a user: open it in the browser. Click every link. Narrow the window to phone width. Does it meet your "done means"?
3. Request one change (this is where agents shine):
The links feel cramped on mobile. Give them more breathing room,
and make the accent color a deep gold.
Watch it edit and verify again. Iterating in plain language — that's the workflow, forever.
4. Accept formally:
$ git status --short
$ git add index.html
$ git commit -m "First agent-built page: personal site v1"
$ git push
Snapshot taken. If an authorized remote is configured, the push stores the commit there. It is public only if you deliberately chose a public repository; private is valid.
If something went sideways¶
- Agent seems confused → your brief was probably vague. Refine and re-ask; no penalty.
- Result is ugly → say what is ugly and what better looks like. Iterate. Three rounds is normal.
- Genuinely broken → inspect
git status --shortandgit diff, then restore only the tracked practice paths you intend to discard. Preview untracked cleanup withgit clean -nd; remove confirmed disposable files individually. External actions need their own undo. Lesson 3.3 defines the boundary.
Watch — now it'll hit different
Mastering Claude Code in 30 Minutes — Boris Cherny, Claude Code's creator. You watched it in Chapter 1 as a spectator. Watch it again as a driver.
Check your understanding¶
- What are the three loop steps you watched, and what did each look like on screen?
- Why does Claude Code ask permission before acting, and why should you actually read those prompts?
- What does
git diffshow you after an agent session? - What's the difference between "the agent said done" and "done"?