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.
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:
- Ask in plain English — “the timezone selector breaks on Safari, can you find it?”
- 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.
- Confirm or redirect when it proposes a plan. This is the cheapest moment to course-correct.
- Let it edit, then look at the diff. Don’t skim — actually read the change.
- 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
- Claude Code overview (code.claude.com) — Install methods, surfaces, and what Claude Code does
- Quickstart (code.claude.com) — Login, first session, essential commands
install loop first-run