Your first session

Claude Code · Essentials · 12 min

These few habits are how you stay in control of an agent that can change your files.

Start claude in a project and simply ask: "what does this project do?" or "where is the entry point?". You do not need to paste code; Claude Code opens the files it needs. To point at a specific file, type @ and start typing its path, for example explain @src/auth/session.ts.

Then ask for a small change: "add input validation to the signup form". Claude finds the right file and proposes an edit. Depending on your permission mode (next lessons) it either asks first, showing the change and options such as Yes or No, or a background safety check approves routine actions for you. When it asks, read the diff (the red and green lines showing what is removed and added) before saying yes.

Three controls matter from day one:

  • Esc stops Claude immediately. The conversation is kept, so you can redirect: "no, keep the old error message".
  • Typing while it works queues your message; Claude reads it after its current step and adjusts.
  • Esc twice (or /rewind) opens the rewind menu. Before each edit Claude snapshots the file, so you can restore code, conversation or both to an earlier point. These checkpoints only cover edits made by Claude's file tools, not things a shell command changed, so they are not a replacement for git.

Other handy keys: / lists commands, the up arrow recalls earlier prompts, and starting a line with ! runs a shell command yourself. /exit (or Ctrl+D twice) ends the session; claude -c later continues the most recent conversation in that folder.

Talk to it like a colleague: be specific, and when the first attempt is off, say what is wrong instead of starting over.

Example

$ claude
> what does this project do? where is the main entry point?
> explain @src/auth/session.ts in plain words
> add a check so signup rejects an empty email, then run the tests
  (Claude shows a diff and asks: Yes / No ... -> read it, then choose)
> Esc                      # stop it if it heads the wrong way
> keep the existing error message text, only add the check
> Esc Esc                  # rewind menu: restore code and/or conversation
> /exit

$ claude -c                # later: continue the last conversation here

Remember

  • Ask questions in plain language; use @ to point at specific files
  • Read each proposed diff before approving it
  • Esc stops, Esc Esc rewinds; checkpoints cover Claude's edits, not shell side effects

Watch out for

  • Approving every prompt without reading it, which turns the safety check into a rubber stamp.

Check yourself

  1. Claude ran a shell command that deleted a build folder. Can the rewind menu bring it back?
  2. What does pressing Esc once do while Claude is working?

Sign in to answer, see the explanations, and get this lesson back as a quick review later.

Official docs: code.claude.com/docs/en/quickstart