Claude Lessons / Guides
How to Use Claude Code: The Beginner's Tutorial (2026)
Most people install Claude Code, type a vague prompt, get a mediocre result, and quietly go back to their old workflow. That's not a tool problem — it's a technique problem. This tutorial takes you from install to a productive first session, then teaches the workflow that separates people who ship with Claude Code from people who fight it.
What Claude Code is (and isn't)
Claude Code is Anthropic's agentic coding tool. You type what you want in plain English; it reads your files, plans a change, shows you a diff, and applies it after you approve. It can run your tests, fix what fails, commit the result, and open a pull request — all from the same conversation.
The key word is agent. A chatbot answers questions about code you paste in. Claude Code works inside your actual project: it explores the codebase itself, decides which files matter, and executes multi-step tasks while you review and approve each meaningful step.
It is not autocomplete, and it's not only for engineers. If your work lives in files — code, notes, CSVs, drafts — Claude Code can operate on it. That said, this guide uses coding examples, since that's the core use case.
What you need before installing
- A paid Claude plan. There's no free tier. Pro ($20/month) is enough for learning and light daily use. Usage resets every 5 hours with a weekly cap on top; heavy users graduate to Max plans ($100–$200/month). API billing via the Claude Console is the pay-per-token alternative.
- A terminal. Terminal on macOS, PowerShell on Windows (not Git Bash), anything on Linux. Supported: macOS, Linux, and Windows 11 (native or WSL2).
- Git, strongly recommended. Not required, but it's your safety net for reviewing and rolling back AI-made changes. If you're on a project without git, run
git initfirst.
You do not need Node.js for the native installer, and you don't need to be fluent in the terminal — you'll use maybe five commands total.
Install and authenticate
macOS / Linux / WSL:
curl -fsSL https://claude.ai/install.sh | bash
Windows PowerShell:
irm https://claude.ai/install.ps1 | iex
Verify it worked, then launch it inside a project folder:
claude --version
cd ~/projects/my-app
claude
The first run opens your browser for a one-time sign-in at claude.ai. Credentials are stored locally in
~/.claude/, so you won't log in again each session. The native installer keeps itself
updated automatically.
Heads up: older tutorials tell you to install with
npm install -g @anthropic-ai/claude-code. That method is no longer what the official
docs recommend — use the native installer above. And if claude isn't found after
installing, restart your terminal first; a stale PATH is the most common install issue.
Your first 10 minutes, prompt by prompt
Don't start by asking for code. Start by letting Claude read the project — you'll immediately see how it thinks. Type these, one at a time:
1. Orient it (and yourself):
what does this project do? summarize the stack and the main moving parts
2. Go one level deeper on whatever matters to you:
@src/App.tsx explain what this component does and what depends on it
The @ symbol references a file directly — it's the single most useful habit for keeping
Claude focused on the right code instead of guessing.
3. Make one small, low-stakes change:
update the header text in @src/pages/Home.tsx to say "Welcome"
Claude proposes a diff and waits. Read it. Approve it. Then check the result yourself with
git diff. That review-then-verify rhythm is the entire skill in miniature.
A few interface basics worth knowing on day one:
| Command / key | What it does |
|---|---|
/help | List all commands |
/init | Generate a starter CLAUDE.md for the project |
/clear | Reset the conversation for a new task |
/compact | Compress a long conversation, keep key context |
/rewind (or Esc Esc) | Roll back to a checkpoint before an edit |
/resume | Continue a previous session |
| Shift+Tab | Cycle permission modes, including Plan Mode |
| Esc | Stop Claude mid-action |
! prefix | Run a shell command and feed Claude the output |
Practice this without risking a real codebase
Claude Lessons has 38 free interactive lessons that simulate a real Claude Code workspace — you practice prompts, planning, and reviews in the browser, with feedback on every choice.
Start the free interactive lessonsThe core loop: Explore → Plan → Code → Commit
The biggest jump in results comes from one change: stop letting Claude write code immediately. The workflow that experienced users converge on has four beats:
- Explore. Enter Plan Mode (press Shift+Tab until you see it) — Claude can read files and answer questions but can't change anything. Have it trace the auth flow, map the schema, understand the blast radius.
- Plan. Still in Plan Mode, ask for an implementation plan. Read it critically — this is where you catch a wrong approach for the cost of a paragraph, instead of a pile of wrong edits.
- Code. Approve the plan and let Claude implement it, reviewing diffs as it goes.
- Commit.
git diff, run the tests, commit with a clear message.
Skip Plan Mode for typo-sized fixes. Use it any time a change touches multiple files, you're unsure of the approach, or you're in unfamiliar code.
One more high-leverage habit: give Claude a way to verify its own work. If it can run
npm test and see the failures, it fixes them without being asked. A task with verification
criteria ("done means these tests pass") consistently beats a task described only by vibes.
Set up CLAUDE.md early
CLAUDE.md is a markdown file at your project root that Claude Code reads at the start of every session — think of it as onboarding notes for an AI teammate. Without it, Claude guesses your conventions every time: wrong test runner, wrong import style, wrong branch names.
Run /init once and Claude generates a starter file from your project. Then trim it hard. A good one is short and concrete:
# Tech stack
- React 19 + TypeScript + Vite, tests with Vitest
# Commands
- `npm run dev` — dev server
- `npm test` — run tests (always run before committing)
# Conventions
- Functional components only; named exports
- Never edit files in src/generated/
The test for every line: would removing it cause Claude to make a mistake? If not, cut it. Bloated CLAUDE.md files get ignored; short ones get followed. Skip anything Claude can discover by reading the code, and anything your linter already enforces.
Permissions, checkpoints, and staying safe
By default, Claude Code asks before every file edit and every shell command. As a beginner, keep it that
way — the prompts are how you learn what Claude actually does. As trust builds, use
/permissions to allowlist safe, repeated commands (npm run lint,
git status) so you're only asked about things that matter.
Your three-layer safety net:
- Diffs before changes — read them, don't rubber-stamp them.
- Checkpoints — every edit is snapshotted;
/rewindor Esc Esc rolls back. Note checkpoints only cover Claude's file edits, not shell commands. - Git — commit before any large refactor. Git catches everything checkpoints don't.
You'll eventually see --dangerously-skip-permissions mentioned in forums. The name is
honest. Leave it alone until you've used Claude Code daily for months — and even then, prefer scoped
allowlists. When you're ready to make rules enforced rather than suggested, that's what hooks
are for: see our guide to
Claude Code hooks with copy-paste examples.
Context management: /clear, /compact, start fresh
Claude Code's working memory (the context window) fills up with conversation, file contents, and command output. When it gets crowded, quality drops. Three rules cover 90% of it:
- New task →
/clear. Finished the bug fix and moving to a feature? Clear first. Leftover context actively hurts. - Long task →
/compact. Compresses history while keeping decisions and file state. You can steer it:/compact focus on the API changes. - Two failed corrections → start over. If Claude gets it wrong twice, the context is polluted with failed attempts. A fresh session with a sharper prompt beats a third correction, nearly every time.
Terminal, VS Code, desktop, or web?
Same subscription, several surfaces. The terminal CLI is the most complete: a few things like MCP server
setup and the ! bash shortcut are CLI-only. The official VS Code extension gives you inline
diffs, @-mentions, and Plan Mode inside the editor (it also works in Cursor); a JetBrains plugin covers
IntelliJ, PyCharm, and friends. There's a desktop app with visual diff review, and claude.ai/code runs
in the browser with zero install.
Beginner's answer: start in the terminal, because every tutorial (including this one) speaks CLI. Add the editor extension once the workflow feels natural.
7 beginner mistakes (and the fix for each)
- 1. Vague prompts. "Make this better" gives Claude nothing. State the goal, the file (
@path), and the constraints: "Reduce duplication in @src/utils/date.ts; keep the public API unchanged." - 2. Kitchen-sink sessions. Mixing unrelated tasks in one conversation tanks quality.
/clearbetween tasks, every time. - 3. Correcting in circles. After two failed corrections, stop. Start fresh with what you learned baked into the first prompt.
- 4. Skipping CLAUDE.md. Ten minutes of
/initplus trimming saves hours of repeated corrections. - 5. Letting it code without a plan. For anything multi-file, Plan Mode first. Reviewing a plan is cheap; reviewing a wrong implementation isn't.
- 6. No safety net before big changes. Commit first, then refactor.
/rewindplus git makes almost nothing irreversible. - 7. Trusting output without verification. Ask Claude to run the tests and show results — passed, failed, and what it couldn't verify. Read evidence, not reassurance.
FAQ
Is Claude Code free?
No. Claude Code requires a paid Claude subscription (Pro at $20/month or higher) or API billing through the Claude Console. The Pro plan is enough for learning and light daily use; usage allowances reset every 5 hours, with an additional weekly cap.
Can I use Claude Code if I'm not a programmer?
Yes. Claude Code works on any folder of files, not just code: notes, CSVs, drafts, and documents. Non-programmers use it to organize files, clean up data, draft content, and automate repetitive computer work. The workflow is the same: describe what you want, review what Claude proposes, approve the changes.
Is Claude Code safe to run on my codebase?
By default Claude Code asks permission before every file edit and shell command, shows you diffs before
applying them, and keeps checkpoints you can roll back with /rewind. Combine that with git
commits before large changes and reviewing diffs before trusting them, and the risk is well contained.
What's the difference between Claude Code and regular Claude chat?
Claude chat works with text you paste into a browser. Claude Code is an agent that works directly in your project: it reads your files, edits them, runs commands and tests, and commits code, with your approval at each step. Chat answers questions; Claude Code does the work.
How is Claude Code different from Cursor or Copilot?
The main difference is the default workflow. Cursor and Copilot are IDE-first: you write and edit code with AI assistance inline. Claude Code is delegation-first: you describe a task, the agent plans and executes it across files, and you review at a higher level. Many developers use both styles for different kinds of work.
How does Claude Code handle large codebases?
Claude Code reads files on demand rather than uploading your whole repo. Keep it effective by
referencing specific files with @, running /clear between unrelated tasks, and
using /compact on long sessions so the context window stays focused on the task at hand.
Reading about it ≠ being good at it
The fastest way to build these habits is reps. Practice context packets, Plan Mode, verification, and recovery in a simulated Claude Code workspace — free, in your browser, with instant feedback.
Practice hands-on in the free interactive lessons