Tutorial

Claude Code Tutorial: From First Install to Parallel Agents

How to use Claude Code, start to finish: install and sign in, run your first session, set up CLAUDE.md, use plan mode, pick the right model, add MCP servers, handle permissions, and scale to parallel agents on worktrees.

By Kylian Migot · Updated July 2026 · 12 min read

Quick answer

Claude Code is Anthropic's terminal-based coding agent. To get started: npm install -g @anthropic-ai/claude-code, run claude inside a git repo, and sign in with a Claude subscription or API key. From there the workflow is: describe tasks in plain language, approve edits, add a CLAUDE.md with /init, use plan mode for bigger tasks, and scale to parallel sessions with git worktrees.
Install
npm install -g @anthropic-ai/claude-code
Auth
Claude subscription or Anthropic API key
Models
/model fable · opus · sonnet · haiku, routed by task
Scaling path
One session → plan mode → MCP → parallel worktrees → orchestration
Step 1

Install and Sign In

Claude Code is a CLI, so the whole setup is a package install and a login. You need Node.js and a terminal; macOS, Linux, and Windows all work. Install it globally, then start it from inside a git repository, the tool is dramatically more useful when it can see a real project:

npm install -g @anthropic-ai/claude-code
cd your-project
claude

On first run, Claude Code walks you through authentication. You have two options: sign in with a Claude subscription (usage counts against your plan's limits, which we break down in Claude Code usage limits), or use an Anthropic API key and pay per token. Subscriptions are simpler for individuals; API billing suits teams that want metered spend. Either way, once you see the interactive prompt, you are in a session.

Step 2

Your First Session: Talk, Approve, Repeat

There is no special syntax to learn. You describe what you want in plain language, and Claude Code explores the repo, proposes changes, and asks before doing anything consequential. Good first tasks are small and verifiable:

> explain what this repo does and how it's structured
> fix the failing test in src/utils/date.test.ts
> add a --verbose flag to the CLI entry point

The rhythm of a session is propose, approve, verify. When the agent wants to edit a file, it shows you the diff and waits; when it wants to run a command, it shows you the command and waits. Read what it shows you, especially early on, this is how you calibrate how much to trust it and where it needs guidance. If it goes down a wrong path, interrupt with Escape and redirect. Sessions are conversations, not one-shot prompts: follow-ups like “now add a test for that” or “that broke the build, fix it” are the normal way to work.

Step 3

CLAUDE.md: Give Every Session a Memory

Every new session starts blank, except for one file: CLAUDE.md, which Claude Code reads automatically at startup. It is where you put everything you would otherwise repeat in every session. Generate a first draft from inside a session:

> /init

Three kinds of content earn their place in the file:

  1. 1

    Build and test commands

    Exactly how to install, build, run tests, and lint in this repo, so the agent verifies its own work instead of guessing at commands.
  2. 2

    Conventions

    Code style, naming, directory structure, error-handling patterns, anything a new team member would need to know to write code that fits.
  3. 3

    Boundaries

    What the agent must not touch: generated files, migrations, vendored code, secrets. Explicit exclusions prevent the most annoying category of mistake.

Keep it short, a bloated CLAUDE.md becomes noise the agent skims past. If you want a structured starting point instead of a blank page, our free AGENTS.md / CLAUDE.md generator builds one from a few questions about your stack.

Step 4

Plan Mode: Think Before Editing

For anything bigger than a one-file fix, switch to plan mode (toggle with Shift+Tab). In plan mode, Claude Code researches the codebase and writes a plan, files to change, approach, order of operations, without editing anything. You review the plan, push back on the parts you disagree with, and approve it before implementation starts.

This one habit prevents most bad agent outcomes, because bad outcomes usually come from a bad plan executed quickly. It is also the gateway drug to a stronger discipline: writing the plan down as a spec with acceptance criteria before any code exists, which is covered in spec-driven AI development. The rule of thumb: if the task would take you more than an hour by hand, it deserves plan mode; if it would take a day, it deserves a spec.

Ship your first agent today

Download AIDEN free and point it at your existing Claude Code or Codex setup. No credit card, running in minutes.

Download AIDEN free

Free to start · macOS 12+ · No credit card required

Step 5

Pick the Right Model with /model

Claude Code can run any current Claude model, and the /model command switches mid-session using short aliases. Routing by task is one of the easiest cost and quality wins available, numbers below verified July 18, 2026:

ModelAliasPrice per MTokUse it for
Claude Fable 5/model fable$10 in / $50 outHardest cross-cutting refactors; requires Claude Code v2.1.170+, not the default
Claude Opus 4.8/model opus$5 in / $25 outAnthropic's recommended starting point for complex agentic coding
Claude Sonnet 5/model sonnet$3 in / $15 out (intro $2/$10 through Aug 31, 2026)Routine features, tests, refactors; 1M context standard
Claude Haiku 4.5/model haiku$1 in / $5 outQuick mechanical edits, triage, cheap subagents

A sensible default: start sessions on Opus 4.8, drop to Sonnet 5 for routine work, and reach for Fable 5 only when a task is genuinely hard, it leads the published SWE-bench Verified leaderboard at 95.0%, but costs twice Opus per token. The full decision guide, with benchmarks and per-task recommendations, is in best Claude model for coding.

Step 6

Extend It with MCP Servers

Out of the box, Claude Code can read files and run commands. MCP servers (Model Context Protocol) extend that reach to everything else: your database, your browser, GitHub, issue trackers, documentation sources. You add them with the claude mcp command family, for example:

claude mcp add --transport http github https://api.githubcopilot.com/mcp/

Resist the urge to install ten servers on day one. Each server's tool definitions consume context in every session, so start with the one or two that remove a real manual step (most people start with GitHub or a browser-automation server) and grow from there. Which servers are actually worth installing, and how to configure them, is the subject of MCP servers for AI coding.

Step 7

Permissions and Reviewing Diffs

Claude Code's permission prompts are the safety system, and how you handle them decides whether the tool is a power tool or a hazard. The defaults are sensible: file edits and shell commands require approval, and you can allowlist specific commands you trust (your test runner, your linter) so repeated approvals do not become clicking fatigue.

Two habits matter more than any setting. First, actually read diffs before approving them, an agent that is 95% right is wrong once every twenty edits, and the review moment is where you catch it. Second, be deliberately conservative with anything that leaves your machine or destroys state: pushes, deploys, database commands, rm. Approving those reflexively is how vibe coding accidents happen. Skipping permissions entirely (the “yolo” flag) belongs only in disposable sandboxes, not on a repo you care about.

Step 8

Going Parallel: Worktrees and Multiple Sessions

Once one session feels natural, the obvious next move is running two or three at once, one fixing a bug, one building a feature, one writing tests. The failure mode is just as obvious: two agents editing the same working copy will trample each other's files. The fix is git worktrees, which give each session its own directory and branch backed by the same repository:

git worktree add ../project-feature-auth feature/auth
cd ../project-feature-auth && claude

# or let Claude Code create the worktree for you:
claude --worktree feature-auth

Each agent now works in isolation, and each branch merges back through a normal PR. The complete pattern, including cleanup and the scripts that make it painless, is in parallel agents with git worktrees. What worktrees do not solve is the tracking problem: which session is doing what, which one is stuck, which one is done. Strategies for that, from terminal tabs up, are in managing multiple Claude Code sessions.

Step 9

Where the Tutorial Ends and Orchestration Begins

Everything above scales to about three parallel sessions run by hand. Past that, the bottleneck stops being Claude Code and becomes you: writing task descriptions, creating worktrees, checking on sessions, opening PRs, remembering state. That coordination layer is what orchestration tools exist for, and it is covered in Claude Code orchestration.

AIDEN is our take on that layer: a macOS desktop app that runs your existing Claude Code CLI (same auth, same limits) on a kanban board, where every card gets a drafted spec you approve, an automatic worktree, and a one-click PR. You do not need it to use anything in this tutorial, but if you find yourself juggling five terminal tabs and a sticky note of branch names, that is the problem it removes.

FAQ

How do I install Claude Code?
Install it globally with npm: npm install -g @anthropic-ai/claude-code. Then open a terminal in a git repository and run claude. On first run it walks you through signing in with either a Claude subscription or an Anthropic API key. It runs on macOS, Linux, and Windows; the only real prerequisites are Node.js and a terminal.
Do I need a paid subscription or an API key to use Claude Code?
You need one or the other. Claude Code authenticates either through a Claude subscription plan or through API-key billing, where you pay per token. Subscription plans come with usage limits that reset on a schedule; API billing is pay-as-you-go. Check Anthropic's current pricing pages for plan details, since tiers and limits change.
What is CLAUDE.md and do I need one?
CLAUDE.md is a markdown file at the root of your repo that Claude Code reads at the start of every session. It should contain your build and test commands, code conventions, and boundaries (files or directories the agent should not touch). Run /init inside a session to generate a starting version. You do not strictly need one, but sessions in repos without one waste time rediscovering the same facts, so it is the single highest-value five minutes of setup.
Which Claude model should I use in Claude Code?
Route by task. Claude Opus 4.8 is Anthropic's recommended starting point for complex agentic coding at $5/$25 per million tokens. Claude Sonnet 5 handles routine features and refactors at $3/$15 (intro pricing $2/$10 through August 31, 2026). Claude Haiku 4.5 covers quick mechanical edits at $1/$5. Claude Fable 5 is the frontier tier at $10/$50 for the hardest cross-cutting work; it requires Claude Code v2.1.170+ and is not the default. Switch anytime with the /model command.
What is plan mode in Claude Code?
Plan mode makes Claude Code research your codebase and propose a written plan before it edits anything. You toggle it with Shift+Tab. It is the right mode for any task that touches more than a couple of files: you review and adjust the plan, then approve it, and only then does the agent start changing code. It is a lightweight version of full spec-driven development.
Can I run multiple Claude Code sessions in parallel?
Yes. The safe pattern is one git worktree per session, so each agent works on its own branch in its own directory and they cannot overwrite each other's files. Claude Code supports a --worktree flag to start a session in a fresh worktree, or you can create worktrees manually with git worktree add. Past two or three parallel sessions, most people add some form of orchestration to keep track of which agent is doing what.

Keep reading

Outgrown one terminal tab?

AIDEN runs your existing Claude Code CLI as parallel agents on a kanban board: a spec per story, a worktree per agent, a PR per card. Free for one project.

macOS 12+ · Bring your own Claude Code or Codex · Your code stays local