claude-examples

Getting started

How do I run my first Claude Code session?

Install Claude Code, open it inside an existing repo, and walk through the loop you'll use every day after.

By Kalle · beginner · Updated 2026-04-20

The fastest way to understand Claude Code is to run it once on a real project, not a hello-world.

1. Install

npm install -g @anthropic-ai/claude-code

You’ll need Node 18+ and an Anthropic API key — Claude Code prompts for it on first run and stores it in your OS keychain.

2. Open it inside a real repo

cd path/to/some-project
claude

The CLI launches in the current directory. It picks up your git state, your file tree, and any CLAUDE.md at the root. Don’t start in an empty folder — Claude Code is much more useful when it has code to read.

3. The loop

Every productive session is the same five-step loop:

  1. Ask in plain English — “the timezone selector breaks on Safari, can you find it?”
  2. Wait while Claude reads files. Resist the urge to give more instructions; you’ll get cleaner work if you let it form a picture first.
  3. Confirm or redirect when it proposes a plan. This is the cheapest moment to course-correct.
  4. Let it edit, then look at the diff. Don’t skim — actually read the change.
  5. Run the tests yourself if Claude didn’t, and report back what broke.

That’s it. Everything else on this site is a variation on that loop.

4. End the session

Ctrl-D or /exit. Your conversation is saved — you can resume with claude --continue.

Sources

install loop first-run