46  46. Your First Claude Code Session

This page walks you through a complete first session: starting Claude Code in a project, asking about the code, making a change, reviewing it, committing it with Git, and coming back later. Along the way you learn the handful of keys you will use every day.

46.1 Before you start

As of Oct 6, 2026 · Official docs: Quickstart

You need Claude Code installed and logged in (Installing Claude Code) and a small project to work on. We use git-tutorial-project from Your First Repository: a tiny website with README.md, css/style.css, and src/index.html. It should be a Git repository with at least one commit, so Git can undo anything that goes wrong (What Is Version Control?).

Download the Git practice project (zip) (unzip it into your ~/projects folder, as described in Your First Repository).

46.2 Start a session

As of Oct 6, 2026 · Official docs: Quickstart · Choose a permission mode

Claude Code works on the folder you start it in, called its working directory. So first cd into the project, then start claude:

cd ~/projects/git-tutorial-project
claude --permission-mode manual

Why --permission-mode manual? Recent versions of Claude Code start in auto mode, where a separate safety model reviews actions instead of you, so Claude edits most files and runs most commands without asking. For your first session, Manual mode is better: Claude asks before every edit and every command that could change something, so you see each step. (You can also start with plain claude and press Shift+Tab once to switch from auto to Manual.) Modes are explained in Permissions, Modes, and Safety.

What you see:

  • The trust question (first time in a folder only). Claude Code asks whether you trust this folder, because a project can contain settings that change what Claude Code does. Say yes for your own projects; look around first in a project you downloaded from a stranger. Don’t start Claude Code in your home directory: trust is never saved there, so you get asked every time.
  • A header showing the Claude Code version, the model (with its effort level), and the working directory.
  • The prompt box, where you type. Before you type, it may show a grayed-out example prompt.
  • A status bar under the prompt box that shows the permission mode, for example ⏸ manual mode on or ⏵⏵ auto mode on.

Type ? on an empty prompt to see the keyboard shortcuts. Want a guided tour? The /powerup command offers short interactive lessons.

46.3 Ask about the project

As of Oct 6, 2026 · Official docs: Common workflows

Start by asking questions in plain English. Claude reads the files it needs; you don’t have to paste anything:

what does this project do?
explain the folder structure, then tell me how the HTML page loads the CSS file

To point Claude at a specific file, type @ and start typing its name; a menu suggests matching paths (Tab or Enter accepts one). The file’s content is added to the conversation:

explain @src/index.html line by line for a beginner

Reading files inside the project doesn’t need your permission, even in Manual mode, so these answers come right away.

46.4 Make a first change

As of Oct 6, 2026 · Official docs: Configure permissions · Checkpointing

Now ask for a small, specific change:

in @src/index.html, replace "Under construction!" with one sentence introducing me: Maria, a business student learning web development

Claude shows the edit it wants to make as a diff (lines starting with - are removed, lines starting with + are added; see Viewing History and Undoing Changes) and, because you are in Manual mode, asks for permission. The prompt offers to approve this edit once, to allow edits for the rest of the session, or to say no. Choose Yes. If you choose No (or press Esc), you can tell Claude what to do differently.

Then review what changed:

  • Type /diff to see the changes in your working tree, file by file.
  • Or run Git yourself in shell mode: a message that starts with ! runs as a command in your shell, and its output is added to the conversation:
! git diff

Don’t like the result? Tell Claude what to change (“make it shorter and more formal”). Or press Esc twice on an empty prompt to open the rewind menu and restore the code to how it was before a message you sent (a checkpoint). Rewind has limits, covered on the safety page; Git is your real safety net.

46.5 Commit with Git

As of Oct 6, 2026 · Official docs: Quickstart · Common workflows

Claude Code can run Git for you. Ask it in plain English:

what files have I changed?
commit my changes with a short, descriptive message

Claude runs commands such as git status, git diff, git add, and git commit. Read-only commands like git status run without asking; in Manual mode it asks before git add and git commit. Read each command before you approve it. By default, Claude Code adds a Co-Authored-By line naming Claude to its commit messages. Check the result yourself:

! git log --oneline -3

46.6 Essential keys

As of Oct 6, 2026 · Official docs: Interactive mode

Key What it does
Enter Send your message
Shift+Enter New line without sending (works in most terminals, including Apple’s Terminal and Windows Terminal)
\ then Enter, or Ctrl+J New line without sending, in any terminal
Esc Stop Claude mid-response; it keeps the work done so far. On a permission prompt, Esc means “No”
Esc Esc On an empty prompt: open the rewind menu. With text typed: clear it
Shift+Tab Cycle through permission modes
Ctrl+C Interrupt. If nothing is running, clears your input; a second press exits
Ctrl+D twice Exit Claude Code
Up arrow Recall earlier prompts
@ Mention a file or folder, with path suggestions
! at the start Shell mode: run a command yourself, for example ! git status
/ at the start Open the menu of commands and skills (Essential Slash Commands)
? on an empty prompt Show the keyboard shortcuts
Ctrl+O Toggle the detailed transcript, which shows every tool call
Ctrl+V (Mac) or Alt+V (Windows) Paste an image from the clipboard (in iTerm2 on a Mac: Cmd+V)

You can also type while Claude is working: your message is queued, and Claude reads it as soon as its current step finishes. That is a gentle way to steer; Esc is the emergency brake.

Screenshots of error messages or web pages are often the fastest way to explain a problem. Copy a screenshot to the clipboard (Mac: Cmd+Ctrl+Shift+4, then drag; Windows: Win+Shift+S) and paste it into the Claude Code prompt with Ctrl+V on a Mac or Alt+V on Windows. It appears as [Image #1] in your message. You can also drag an image file into the terminal window, or just give Claude the image’s path (“look at ~/Desktop/error.png”).

46.7 Ending and coming back

As of Oct 6, 2026 · Official docs: Manage sessions

A conversation with Claude Code is a session. Claude Code saves every session automatically (as a file under ~/.claude/projects/), tied to the folder you started in.

To… Do this
Leave Claude Code Type /exit (or press Ctrl+D twice)
Reopen the most recent session in this folder claude --continue (short: claude -c)
Pick an older session from a list claude --resume (short: claude -r)
Switch sessions without leaving Claude Code /resume
Start a fresh conversation /clear (the old one can still be resumed)
Give a session a name you can resume by claude -n portfolio-intro, or /rename portfolio-intro inside

Then claude --resume portfolio-intro brings that session back. A brand-new session starts with a fresh, empty conversation: Claude does not see your earlier conversations unless you resume one. Instructions you want in every session belong in a CLAUDE.md file (CLAUDE.md and Memory).

46.8 A sample first session

As of Oct 6, 2026 · Official docs: Quickstart

Here is a simplified version of the whole session. Lines starting with $ are typed in the shell, lines starting with > are typed in Claude Code, and square brackets describe what happens on screen (the exact wording varies by version).

$ cd ~/projects/git-tutorial-project
$ claude --permission-mode manual

> what does this project do?

  [Claude lists the folder and reads a few files, then answers:]
  This is a small personal portfolio website. src/index.html is the
  page, css/style.css styles it, and README.md describes the project.

> in @src/index.html, replace "Under construction!" with one sentence
  introducing me: Maria, a business student learning web development

  [Claude shows the edit as a diff and asks permission. You choose Yes.]
  -    <p>Under construction!</p>
  +    <p>Hi, I'm Maria, a business student learning web development.</p>

> /diff
  [A list of changed files opens. You check index.html, then press Esc.]

> commit my changes with a short, descriptive message

  [Claude runs git status and git diff, then asks permission to run
   git add and git commit. You read the commands and choose Yes.]
  Committed: "Replace placeholder text with a personal introduction"

> /exit

Practice Questions

Easy

Question 1 · Short answer

Why do you cd into a project folder before typing claude?

Because Claude Code works on the folder you start it in (its working directory). That folder decides which files Claude can read and edit without extra permission, which CLAUDE.md and project settings load, and where the session is saved.

Question 2 · Matching

Match each key with what it does in Claude Code.

Key What it does
1. Esc A. Run a shell command yourself
2. Esc Esc (empty prompt) B. Cycle permission modes
3. Shift+Tab C. Mention a file
4. @ D. Stop Claude mid-response
5. ! at the start E. Open the commands menu
6. / at the start F. Open the rewind menu

1 → D, 2 → F, 3 → B, 4 → C, 5 → A, 6 → E.

Question 3 · True or false

claude --continue shows you a list of all your old sessions to choose from.

False. claude --continue (or -c) reopens the most recent session in the current folder. claude --resume (or -r), or /resume inside a session, opens the list to pick from.

Question 4 · Short answer

Give two ways to leave Claude Code.

Type /exit, or press Ctrl+D twice. (Pressing Ctrl+C twice when nothing is running also exits: the first press clears the input, the second exits.)

Question 5 · Multiple choice

The first time you start Claude Code in a folder, it asks whether you trust the folder. Why?

  1. To check that you have a paid plan
  2. Because a project can contain settings that change what Claude Code does, so you should only trust folders whose contents you know
  3. To decide which model to use
  4. Because Claude Code can only read trusted files

b. A project folder can include Claude Code settings (for example permission rules), and Claude Code holds some of them back until you trust the folder. It has nothing to do with your plan (a) or the model (c), and it is not a list of readable files (d).

Medium

Question 6 · Write the command

Write the two commands Maria types to start Claude Code in ~/projects/git-tutorial-project so that Claude asks before every edit and command.

cd ~/projects/git-tutorial-project
claude --permission-mode manual

(Starting with plain claude and pressing Shift+Tab once, which switches from auto mode to Manual mode, also works.)

Question 7 · Scenario

Halfway through a task you see Claude editing the wrong file. What do you press right away, and what do you do next?

Press Esc to stop Claude immediately; the running action is canceled and Claude waits for you. Then explain what you actually want (“don’t touch style.css; only change index.html”). If an unwanted edit already happened, press Esc twice on an empty prompt to open the rewind menu and restore the code, or undo it with Git.

Question 8 · Write the prompt

Write a prompt that asks Claude to explain the CSS file to a beginner, making sure Claude looks at exactly that file.

explain @css/style.css to me as a beginner: what does each rule do?

The @css/style.css mention adds that file’s content to the conversation.

Question 9 · Predict the output

Inside Claude Code you type ! git status. What happens, and does Claude need your permission to run it?

The ! puts the message in shell mode: git status runs directly in your shell (you typed it, so there is no permission prompt), its output is shown and added to the conversation, and Claude then responds to that output.

Question 10 · Scenario

Sam wants to write a three-line prompt, but every time he presses Shift+Enter in his terminal, the message is sent. What can he do?

Use a method that works in any terminal: type \ and then press Enter, or press Ctrl+J, to start a new line without sending.

Question 11 · Write the command

Yesterday Maria named a session portfolio-intro. Write (a) the shell command that reopens it, and (b) what she types if she is already inside another Claude Code session.

  1. claude --resume portfolio-intro (from the project folder).
  2. /resume portfolio-intro (or /resume alone to pick from the list).

Question 12 · True or false

After you type /clear, the previous conversation is deleted for good.

False. /clear starts a new conversation with an empty context, but the previous one stays saved, and you can return to it with /resume.

Question 13 · Short answer

Name two ways to show Claude Code a screenshot of an error message.

Any two of: copy the screenshot to the clipboard and paste it with Ctrl+V (Mac) or Alt+V (Windows); drag the image file into the terminal window; or give Claude the image’s path in your message.

Hard

Question 14 · Explain why

Recent versions of Claude Code start in auto mode, where a safety model approves most actions. Why does this page suggest starting your first session in Manual mode anyway?

In Manual mode Claude asks before every edit and every command that could change something, so you see each step of how an agent works: which files it reads, what edits it proposes (as diffs), and which commands it wants to run. That builds the habit of reading actions before approving them. In auto mode most of this happens without prompts, which is convenient once you know what to expect, but it hides the learning, and the safety model is not a guarantee.

Question 15 · Scenario

Claude edited src/index.html with its edit tool, then ran mv css/style.css css/main.css in the shell. You open the rewind menu and restore the code to before that message. What gets restored, and what doesn’t? How can you undo the rest?

Rewind restores src/index.html, because checkpoints track edits made with Claude’s file-editing tools. It does not undo the mv, because changes made by shell commands are not tracked. Undo the rest yourself: git status shows that css/style.css was deleted and css/main.css is new, and moving the file back (mv css/main.css css/style.css) fixes it. Git is what lets you see and repair changes like this, which is why you work in a Git repository with committed work.

Question 16 · Scenario

In Manual mode, Claude runs git status and git diff without asking, but asks before git commit. Explain the difference.

git status and git diff only read information, and Claude Code has a built-in set of read-only commands that run without a prompt. git commit changes the repository (it creates a new commit), so in Manual mode Claude Code asks before running it. That gives you a chance to read the commit command and message first.

Question 17 · Long answer

Describe, step by step, a complete first session that makes one small change to a project and commits it. At which steps are you, the human, responsible for checking Claude’s work?

A good answer includes:

  1. cd into the project (a Git repository with committed work) and start claude, ideally claude --permission-mode manual the first time.
  2. Answer the trust question for your own folder.
  3. Ask questions to understand the project (what does this project do?, @file mentions).
  4. Ask for one small, specific change.
  5. Check the proposed diff before approving it.
  6. Review the result with /diff or ! git diff; ask for corrections or rewind if needed.
  7. Ask Claude to commit; read the git add/git commit commands and the message before approving.
  8. Verify with ! git log --oneline -3 (and by opening the page in a browser).
  9. /exit; later resume with claude --continue or claude --resume.

You stay responsible for every approval and for checking that the result is correct.

Question 18 · Compare

Compare claude --continue with starting a fresh claude session. What does Claude know in each case?

claude --continue reopens the most recent session in that folder with its full conversation history, so Claude still “remembers” what you discussed and did. A fresh claude session starts with an empty conversation: Claude only knows what Claude Code loads at startup (such as your CLAUDE.md files) and what it reads from your files again. Use a fresh session for a new, unrelated task and --continue to pick up unfinished work.

Challenge

Question 19 · Hands-on

Do the whole sample session yourself on git-tutorial-project in Manual mode: ask what the project does, change the paragraph in src/index.html, check the change with /diff, have Claude commit it, and verify with ! git log --oneline -3. Then exit, run claude --continue, and ask Claude “what did we change last time?”. Write down every permission prompt you saw and which option you chose.

A good report lists the prompts in order: typically one edit prompt for src/index.html and one or more command prompts for git add and git commit (read-only commands such as git status and git diff ran without a prompt). It shows the new commit at the top of git log --oneline -3 (a plain git log also shows the Co-Authored-By line in the full message), and notes that after claude --continue Claude could describe the change, because the resumed session kept the conversation history.

© 2025-2026 Y. Rosenthal. All rights reserved.