Brief, inspect, change, prove
You ask Claude Code to fix one broken toggle. Halfway through, the fix also quietly touches your sign-in code. A safe session is the difference between a small fix and a scary surprise.
20 min · You'll run Claude Code without letting scope driftYou'll write a short brief that makes Claude Code look before it leaps, stay inside a boundary, and stop before it wanders into risky code.
Step 1 of 6: The idea
Step 1 of 6
The one idea this lesson is about, and why it matters.
Complete Pick the right surface first.
Quick recall · Know when to use Claude Code
Two lessons back, a good Claude Code task started with three things. Without scrolling, what were they?
Target, boundary, and proof. What to change, what to leave alone, and how you will check it. This whole safe-session brief is just those three written out in order.
A safe Claude Code session has four moves. Brief, inspect, change, prove.
Session loop: the brief names the task, the source of truth, the boundary, and the proof. The inspect step makes Claude Code read the current files before it edits, so the session starts from fact instead of a guess.
Claude Code has a built-in plan mode for exactly this. In plan mode, Claude reads your files and proposes a plan first, before it changes anything. Here is what that looks like on the settings-toggle task below:
Claude Code v0.0.0
Sonnet (200K context) · Claude Pro
~/project
Read SettingsToggle.tsx and its test. Found it: onChange never calls setState. Plan: (1) fix the handler, (2) run the component's test, (3) show you it passing. Won't touch sign-in or account files. Yes, manually approve edits No, keep planning
You read the plan, then approve it or ask for changes. Only after you approve does Claude Code start editing.
How to turn plan mode on, by surface. A permission mode is a setting for how much Claude Code may do before it asks you. In the desktop app, open the mode selector in the row under the message box and choose Plan.
In the terminal, press Shift+Tab until the bottom bar says plan mode on (it cycles, so it may take two or three presses), or type /plan. A slash command like /plan is a word starting with / that you type into Claude Code's message box.
To leave plan mode, change the mode back the same way. If a mode is missing from the selector, ask Claude Code which mode am I in, and how do I switch?
Tip: ask it what it can do. New session, not sure what is possible? Just ask, in plain words: "what can you help me with here?"
You do not need the right vocabulary first. Asking is the on-ramp, not a sign you are behind.
The change step should stay small enough to review. If Claude finds a bigger problem, it should report that and stop before widening scope.
The proof step is where you accept or reject the work. The strongest proof is one Claude Code can run and show you itself, like a passing test, not just your own eyeballing (its own lesson later; for now, just notice the difference). A useful session ends with changed files, commands run, and any proof the task called for.
For risky work, ask Claude Code to work in a separate, throwaway workspace first, so your main project stays untouched. It calls this a worktree, a separate copy on its own branch. You never set one up by hand, you ask Claude Code for it.
A worktree only works if the project is in git, a tool that saves a history of your files so you can go back. Not sure yours is? Ask Claude Code: Is this folder in git? If not, turn it into a git project and save this version as the first commit.
A commit is one saved snapshot, and lesson 4 uses it to get files back. In the desktop app, you can then turn on the Worktree switch in the row under the message box before you start a session.
Worked example. A settings toggle is broken and you ask Claude Code to fix it.
It reads the toggle component and its test (a small automatic check that the code still works), makes one change, then runs that test and shows you it passing. It stops if the fix starts to touch sign-in or account data, outside the brief.
Claude Code v0.0.0
Sonnet (200K context) · Claude Pro
~/project
Fixed the onChange handler so it calls setState. Ran SettingsToggle's test: 1 passed, 0 failed. No other files changed.
If that test comes back red, that is not a crisis, it is the safety net doing its job. Copy what it says, paste it back, and ask Claude Code: Fix only that, then run the test again. Then check that the test now shows passing.
How to stop it yourself. If Claude Code keeps going when it should have stopped, interrupt it.
In the desktop app, click the stop button. In the terminal, press Esc.
Stopping does not undo what it already finished (lesson 4 covers undoing). You can type what you want it to do instead.
It is also normal to throw a session away and start over. Many practitioners restart a good share of their sessions, and that is routine, not proof you did something wrong. To start fresh, type /clear in the message box (the old conversation stays in /resume), or in the desktop app start a new session (Cmd+N on a Mac, Ctrl+N on Windows).
This pattern matters even for tiny tasks, because it turns Claude Code from an editor that does whatever it wants into a controlled worker you can check.
That is the idea. Next you watch it work.
Step 2 of 6
See one real prompt do one real job, then see which part of it made that work.
You type this
Fix the broken settings toggle. Read the toggle component and its test first, change only what the fix needs, run that one test, and stop if the fix starts to touch sign-in or account data.
Claude Code does this
Claude Code goes next.
Step 3 of 6
Write one part of the prompt yourself, then compare with one good answer.
The stop rule
This task sits next to payment, not sign-in. What danger should make Claude Code pause and check with you here?
Your answer is saved with your progress, so leave out anything private.
Try it before you go on.
Getting it wrong first is what makes it stick.
Step 4 of 6
Do the task on your own work, in your own tool.
Pick one small real task. Write a five-line brief for Claude Code: the task, what to inspect first, what not to touch, the proof to run, and a stop rule if the scope grows.
Go do it for real.
Come back with a result.
Leave out anything private. This uses one of your Course Council messages.
Step 5 of 6
Fill in your own card, then save it to your workbook.
Your takeaway
Loading your card…
Save your card before you go on. It goes in your workbook.
Step 6 of 6
Say it from memory first, then check it.
Pulling this out of your own head now is the part that actually moves it into long-term memory. Re-reading only feels like it does.
From memory, name the four moves of a safe first session in your own words. Then say which one you are most likely to skip when you are in a hurry.
The four moves are brief, inspect, change, prove. Most people skip inspect. They let the agent start editing before it has read the current files, which is exactly when stale guesses sneak in. Naming the move you would skip is how you catch yourself doing it next time.
You can start with a short repo brief
A safe first session is brief, inspect, change, prove. Anything bigger needs a new decision before it continues.
Not sure how to start a safe session? Open Claude Code and say inspect the files first, show me your plan, and wait for my okay before you touch anything. It reads before it edits and stops right there until you approve, so you never have to sound like an expert to stay safe.
That is the lesson. Mark it complete, and its question comes back to you in three days.