TL;DR
Claude Code is Anthropic’s terminal coding agent. Install it (native installer or npm install -g @anthropic-ai/claude-code), then sign in with a Claude Pro, Max, Team, or Enterprise account — the free Claude.ai plan does not include Claude Code (verified June 2026). Don’t open with “clean up the repo.” Instead: write a short CLAUDE.md, run Plan Mode so the agent proposes changes before touching files, then execute one named step at a time and commit after each. Your first session should end with a small reviewed PR, not a 40-file diff you can’t read.
What Claude Code is, and how it differs
Claude Code is a command-line agent that reads, edits, and runs code in your terminal. It runs Anthropic models only — Sonnet 4.6 (the default workhorse) on Pro, plus Opus 4.7 on Max plans. That matters because the mental model is different from inline tools:
| Tool | What it does | Best for |
|---|---|---|
| GitHub Copilot | Inline autocomplete in the editor | Single-line / single-block completion |
| Cursor | AI-native IDE; chat + inline edits | File-level edits with a GUI diff |
| Claude Code | Agent that drives the shell, runs tests | Multi-file, multi-step changes |
If a single inline completion would do, read agent vs autocomplete first. Reach for Claude Code when the change touches multiple files, needs the agent to run tests, or requires reading the repo before editing — renames across files, dependency upgrades, adding tests to legacy code, scripted refactors. For browser-side prototyping without a terminal, see a deep Claude Artifacts workflow instead.
What it costs (as of June 2026)
There is no per-session API meter when you sign in with a consumer plan — Claude Code is bundled into your subscription and limited by usage caps, not a token bill:
| Plan | Price (USD/mo) | Includes Claude Code? | Models | Rough capacity |
|---|---|---|---|---|
| Free | $0 | No | — | Claude.ai chat only |
| Pro | $20 ($17/mo annual) | Yes | Sonnet 4.6 | ~40-80 hrs Sonnet/week |
| Max 5x | from $100 | Yes | Sonnet 4.6 + Opus 4.7 | 5x Pro |
| Max 20x | $200 | Yes | Sonnet 4.6 + Opus 4.7 | 20x Pro |
Usage runs on a 5-hour rolling window with a weekly ceiling on top; Pro gets roughly 40-80 hours of Sonnet 4.6 per week (heavy refactors burn faster than light edits). Opus 4.7 is reserved for Max plans. If you’d rather pay per token, you can authenticate against the Anthropic API or Amazon Bedrock / Google Vertex instead — at API rates, Opus 4.7 is $5 in / $25 out per 1M tokens and Sonnet 4.6 is $3 / $15. See the official Claude Code overview and Anthropic pricing for current figures.
Before you start
- Check requirements. Claude Code needs macOS 13.0+, Windows 10 (1809+), or Ubuntu 20.04+/Debian 10+, with 4 GB+ RAM. The npm route additionally needs Node.js 18 or later; the native installer ships its own binary and skips Node entirely.
- Get the repo green. Tests pass, lint passes, you can build. Claude Code amplifies whatever state the repo is in — including breakage.
- Pick a small, low-risk target. Rename a poorly named function, add tests to one module, port one file to a new pattern. Not the whole codebase.
- Commit or stash your current work so the agent’s diff is unambiguous against a clean baseline.
Step by step: setup to first PR
- Install. Native installer is now the recommended path:
On Windows PowerShell usecurl -fsSL https://claude.ai/install.sh | bashirm https://claude.ai/install.ps1 | iex. Prefer npm? Runnpm install -g @anthropic-ai/claude-code(never withsudo). Then confirm withclaude --version, and runclaude doctorif anything looks off. - Sign in. Run
claudein your project folder and follow the browser login. Use your Pro/Max account; the free tier is rejected here. - Generate a CLAUDE.md. Inside the session, run the
/initslash command — Claude scans the repo and drafts aCLAUDE.mdwith build/test commands and conventions. Edit it down to the essentials: language/framework, test command, lint command, and paths the agent must not touch. See AI coding context management for what belongs there. Even a 20-line file changes session quality dramatically. - Enter Plan Mode before any edit. Press
Shift+Tabto cycle the permission mode to plan (the cycle is default → acceptEdits → plan), or start the session withclaude --permission-mode plan. In Plan Mode the agent is read-only: it can search and analyze but cannot write files until you approve. - Ask plan-first. A concrete prompt beats “clean up the repo”:
New to the repo? Do a workflow for AI codebase tours first so you know what you are refactoring.Plan a refactor of src/auth.ts: extract JWT validation into its own module. Do not write code yet. List files to change, new files to create, and tests to add. - Review the plan, then push back. Look for files the agent should not touch, missing test updates, or scope creep. Reply plainly: “Don’t change
database.ts— that’s out of scope.” - Execute one named step at a time. Approve a single change, run tests, commit, then move on. The unit of safety is a clean commit, not a whole task.
- Close the loop. Ask the agent to summarize what changed and what’s still incomplete, and paste that into your PR description.
First-run exercise (20 minutes)
- Pick one smelly function in one file — too long, unclear name, no tests.
- Ask Claude Code to add tests for the current behavior first. Run them; confirm they pass.
- Now ask for a small named refactor: “split this function into
validate/transform/save.” Run the tests again; they should still pass. - Commit. Note what worked, what surprised you, and any prompt worth keeping in
CLAUDE.md.
Quality check after each session
- Run the test suite after every agent step. A clean run is your only objective signal the change is safe.
- Read the diff line by line for your first three sessions. After you trust the agent on a pattern you can skim; before that, read.
- Watch for edits outside scope —
git diff mainto confirm the blast radius. - Re-read
CLAUDE.mdand add the one constraint you wish you’d written before this session. When the agent makes the same mistake twice, add a forbidden rule.
FAQ
- Do I need a paid plan to use Claude Code?: Yes. As of June 2026 the free Claude.ai plan does not include Claude Code. The cheapest path is Claude Pro at $20/mo (or $17/mo billed annually), which runs Sonnet 4.6; Opus 4.7 requires a Max plan ($100 or $200/mo).
- How is Claude Code different from Cursor?: Cursor is an AI-native IDE with inline edits; Claude Code is an agent that drives your shell and runs tests. Different ergonomics — see Claude Code vs Cursor.
- Can I use it without a CLAUDE.md?: Yes, but quality drops fast on real projects. Run
/initonce and trim the result; even a 20-line file helps. - Will it run destructive commands?: By default it asks before running anything risky. Stay out of full auto-accept for the first sessions and review every command.
- What if the agent stalls or hits a limit?: Cancel, narrow the scope, and restart. On a “Claude is at capacity” message, don’t spam retry — it can lengthen the cooldown (Claude retry rate limit).
- Which model should a beginner use?: Stick with the Pro default (Sonnet 4.6) for everyday refactors. Reach for Opus 4.7 (Max plans) only for harder architectural reasoning where the extra capacity earns its cost.
Common mistakes
- Skipping Plan Mode and asking for code immediately — you get a diff you can’t review.
- No
CLAUDE.md— the agent reinvents your conventions and style guide every chat. - Letting it commit unreviewed — even a good diff hides one quiet wrong line.
- Asking for too-big tasks (“refactor the whole module”) instead of named small steps.
- Spamming retry on “Claude is at capacity” — that can lengthen the cooldown (Claude retry rate limit).
- Treating Claude Code as authoritative on architecture — it executes fast but is weaker on “should we do this at all.”
Related
- Claude Code workflow
- Project Prompts for Claude Code
- Claude Code Project Setup
- Claude Code vs Cursor
Tags: #AI coding #Tutorial #Claude Code