Software Engineeringunpacked

Claude Code tutorial for beginners: plan mode, CLAUDE.md, subagents, skills, hooks and MCP

Claude Code is an agentic coding tool: you describe a goal, and it reads your project, edits files, runs commands and checks its own work, asking permission for what you have not allowed. To start, install it with one command, run claude in your project folder and ask questions before asking for code. Then learn five things in order: permission modes, plan mode, CLAUDE.md, the context commands (/context, /compact, /clear, /rewind) and git review. Subagents, skills, hooks and MCP servers come later, each when a specific need shows up.

Video · Claude Code Tutorial for Beginners: Plan Mode, CLAUDE.md, Subagents, Skills, Hooks and MCP · 19:40

What is Claude Code?

Prefer to watch? The 19-minute video covers the same ground with diagrams for every concept.

Claude Code is an agentic coding tool made by Anthropic. "Agentic" means it does more than answer: it acts. You describe a goal in plain words, and it searches your project, reads the files it needs, edits code, runs commands such as your tests, and checks the result before it reports back.

That is the difference from the two tools most developers already know. A chat assistant answers questions while you copy code in and out. Autocomplete suggests the next lines in the file you have open. Claude Code works across the whole project and decides which files to read and which commands to run.

This guide is a beginner's map. It follows one small feature from the first prompt to the commit and explains each Claude Code feature at the moment you need it, with a link to a deeper guide for every topic.

Where Claude Code runs

Claude Code has several surfaces, and they all connect to the same engine, so your project instructions, settings and MCP servers work in each of them.

Surface What it is Good for
Terminal (CLI) The full command line tool, started with claude Everything; this guide uses it
VS Code, Cursor, JetBrains Extensions and a plugin inside your editor Inline diffs, working next to your code
Desktop app A standalone app with a Code tab Visual diffs, several sessions side by side
Web claude.ai/code in a browser, no local setup Long tasks, repos you don't have locally

If you wonder how Claude Code relates to the Claude API, the Agent SDK and MCP, the comparison of the four sorts them out.

How to install Claude Code

The official docs recommend the native installer, which also keeps Claude Code up to date in the background:

Homebrew and WinGet installs do not update themselves, so upgrade them yourself now and then. Open a new terminal and run claude --version; a version number means it worked.

Your first Claude Code session

Go to a project folder and type claude. On first use it asks you to log in, with a Claude subscription, a Claude Console account or a supported cloud provider.

Our running example is Pantry, a small recipe web app where you can browse and search recipes. The feature we will add is favorites: a heart button on each recipe, saved for each user, a page that lists your saved recipes, and tests.

Do not start by asking for code. Start with questions:

Claude reads the files it needs and answers. You never paste code in; it finds the context itself.

How Claude Code works: the agentic loop

Every task runs through what the docs call the agentic loop, with three phases: gather context, take action, verify results. Claude searches and reads files to understand the code, edits files and runs commands, then checks its work, for example by running the tests. If a test fails, it reads the error and goes around again until the task is done.

It acts through tools, in five groups: file operations, search, execution (shell commands, tests, git), web (search and fetch documentation) and code intelligence (type errors and definitions, once you install a plugin for your language). The model decides which tool to use; Claude Code is the layer around it, the harness, that runs the tools and decides what needs your permission.

You stay in the loop. Press Esc to stop Claude at once, or type a correction while it works; it reads your message before its next step.

Claude Code permission modes

A permission mode sets what Claude may do without asking you first. Press Shift+Tab to cycle through them.

Mode Runs without asking Use it when
Manual Reading files in your project Learning, sensitive code
Accept edits Reads, file edits, simple file commands such as mkdir and mv You will review the diff afterwards
Plan Reads only; Claude proposes a plan Before a change that touches several files
Auto Most actions; a classifier model blocks risky ones Everyday work you still review

Recent versions start new terminal sessions in auto mode when it is available. Its classifier stops actions such as force pushes and production deploys, but the docs are clear that it reduces prompts rather than guaranteeing safety. A bypass mode that approves everything exists for isolated containers only.

For finer control, add permission rules to .claude/settings.json: allow trusted commands like Bash(npm test *) so Claude stops asking, and deny things like Read(.env). Deny rules apply in every mode, and /permissions shows them. The full rule syntax is in the Claude Code permissions guide.

Claude Code plan mode

In plan mode, Claude explores the code and writes a plan, but does not edit your source files. Enter it with Shift+Tab until the status bar shows plan mode on, start a single prompt with /plan, or launch with claude --permission-mode plan.

For Pantry we type /plan add favorites: a heart button on each recipe, saved per user, and a favorites page. Claude reads the recipe model, the API routes and the recipe card, then proposes a favorites table, the API endpoints, the heart button, the new page and tests. This is the cheapest moment to change your mind: should favorites need an account?

Then you choose Yes, and use auto mode, Yes, manually approve edits or No, keep planning, and Ctrl+G opens the plan in your editor. Skip plan mode for one-line fixes. The Claude Code plan mode guide covers when it pays off.

CLAUDE.md and /init

Every session starts with a fresh context, so Claude does not remember yesterday's conversation. CLAUDE.md is the markdown file Claude Code reads at the start of every session, and it is where your project's rules live.

File For whom Commit it?
./CLAUDE.md (or ./.claude/CLAUDE.md) The whole team, this project Yes
~/.claude/CLAUDE.md You, in every project No
./CLAUDE.local.md You, in this project No, add it to .gitignore

Run /init to start: Claude analyzes the codebase and writes a starter CLAUDE.md with the build commands, tests and conventions it finds. Keep only what Claude cannot learn from the code: the test command, conventions such as "use the existing API client", and gotchas such as "start the test database first". The docs suggest under 200 lines. When Claude gets the same thing wrong twice, add one line.

Claude also keeps its own notes from your corrections, called auto memory; /memory opens both. Levels, imports and path rules are in the CLAUDE.md guide.

Claude Code slash commands for beginners

Type / at the prompt to see every command available to you. The ones a beginner uses most:

Command What it does
/help Shows help and the available commands
/init Writes a starter CLAUDE.md
/plan Plan mode for one prompt
/model Switches the model
/permissions Allow and deny rules
/mcp MCP connections and sign-in
/diff Reviews the changes in your working tree
/resume Reopens an earlier conversation
/context Shows what fills the context window
/compact Summarizes the conversation to free space
/clear Starts a fresh conversation
/rewind Rolls code or conversation back to a checkpoint

Custom commands are now skills, covered below.

Context: /context, /compact and /clear

The context window is everything Claude sees at once: your conversation, the files it read, command output, CLAUDE.md and its own instructions. As it fills, Claude Code compacts it automatically by summarizing older parts, and early details can get lost. That is one more reason to keep standing rules in CLAUDE.md.

/context shows what is using the space. /compact summarizes now, and accepts a focus, such as /compact focus on the favorites API. /clear starts a fresh conversation; use it between unrelated tasks, and after two failed corrections, when a new, better prompt beats a third correction.

Checkpoints and /rewind

Claude Code takes a checkpoint at every prompt you send, a snapshot of the files it edits. Press Esc twice on an empty prompt, or run /rewind (also /undo), and pick an earlier prompt. You can restore the code and conversation, only the conversation, or only the code, or summarize part of the conversation.

Know the limits. A file changed only by a shell command is not restored, and nothing undoes a database change, an API call or a deploy. Checkpoints are a quick undo inside a session; git stays your real history.

Subagents, skills, hooks and MCP: what each is for

These four extensions are where beginners get lost, because they sound alike. Each solves a different problem.

Subagents are helpers that run in their own context window with their own instructions and tools; only a summary comes back. Built-in ones include Explore (read-only search) and Plan (research during plan mode), and you can add your own as markdown files in .claude/agents/. Reach for one when a side task would flood your conversation, or for a review by fresh eyes. See Claude subagents.

Skills are instructions in a SKILL.md file inside .claude/skills/<name>/. You run one with /name, or Claude loads it when your task matches its description. For Pantry, a /ship-check skill could run the tests and the linter and review the diff before each commit. See Claude skills.

Hooks are commands Claude Code itself runs at lifecycle events such as PreToolUse (can block a tool call), PostToolUse, Notification and Stop. A CLAUDE.md line is a request; a hook always runs. Use one to format every edited file or block edits to .env. See Claude Code hooks.

MCP servers connect Claude to outside systems through the Model Context Protocol, an open standard. Add one with claude mcp add --transport http <name> <url> and check it with /mcp. Connect only servers you trust, since fetched content can carry prompt injection. See what MCP is.

Your situation Reach for
Claude should always know it CLAUDE.md
You keep typing the same steps A skill
A side task floods the conversation A subagent
It must happen every time, no exceptions A hook
The data lives in another system An MCP server
Another repository needs the same setup A plugin (bundles all of the above)

From prompt to commit: git and reviewing diffs

Here is the favorites feature end to end. Ask Claude to create a branch called favorites. Run the plan, approve it with manual edit approval, and Claude edits the files and runs the tests. Two fail; it reads the errors, fixes the code and runs them again until they pass. The loop closed itself because it had a check to run.

Now review. Ask for the test output as evidence, then run /diff and read every change. For a second opinion, /code-review reviews the diff in a fresh subagent that never saw your conversation. Finally, ask Claude to commit with a descriptive message, and push only after you have read it. If your team rebases, the merge vs rebase guide helps.

A Claude Code workflow checklist for beginners

Specific prompts make every step better. "Add favorites" makes Claude guess; "a heart on each recipe card, saved per user, a favorites page, use the existing API client, tests for the endpoints" does not. For a bug, describe the symptom and ask for a failing test first. Type @ and a path to point Claude at a file. More habits are in Claude Code best practices.

Common Claude Code beginner mistakes

  1. The endless session. One conversation for everything, so old tasks crowd the new one. Clear between tasks.
  2. Correcting a third time. After two failed corrections, clear and write one better prompt.
  3. No check to run. Without tests or a build, Claude stops when the work looks done, and you become the test suite.

  4. Approving on autopilot. Read what you approve; turn the rules that matter into deny rules or hooks.

  5. A giant CLAUDE.md. Hundreds of rules dilute each other. Keep it short.
  6. Rewind instead of git. Checkpoints are a quick undo. Commit often, on a branch.

Recap

Claude Code gathers context, takes action and verifies results in a loop while you steer. Permission modes decide what it may do without asking, and plan mode lets you approve a plan first. CLAUDE.md carries your rules into every session. /context, /compact, /clear and /rewind manage what it sees and undo its edits. Subagents isolate side work, skills package repeated steps, hooks enforce rules and MCP connects outside tools. And the workflow stays the same: explore, plan, code, test, commit.

Independent explainer, not affiliated with Anthropic.

Sources: Claude Code overview; Quickstart; How Claude Code works; Permission modes; Configure permissions; How Claude remembers your project; Commands; Checkpointing; Extend Claude Code; Subagents; Skills; Hooks guide; MCP; Best practices (all opened 2026-12-04).

FAQ

What is Claude Code?

Claude Code is an agentic coding tool from Anthropic. It reads your codebase, edits files, runs commands and works with tools such as git. It runs in the terminal, in VS Code and JetBrains IDEs, in a desktop app and on the web at claude.ai/code, and every surface uses the same engine and the same project settings.

How do I install Claude Code?

On macOS, Linux or WSL, run the native installer: curl -fsSL https://claude.ai/install.sh | bash. On Windows PowerShell, run irm https://claude.ai/install.ps1 | iex. Homebrew (brew install --cask claude-code) and WinGet (winget install Anthropic.ClaudeCode) also work but do not update themselves. Check with claude --version, then run claude in your project and log in.

What is the difference between CLAUDE.md, skills, subagents, hooks and MCP?

CLAUDE.md holds rules Claude should know in every session. A skill packages instructions or a workflow you run with /name or that Claude loads when relevant. A subagent does a side task in its own context and returns a summary. A hook is a command Claude Code always runs at a lifecycle event. An MCP server connects Claude to an outside system such as a database or an issue tracker.

Can I undo what Claude Code changed?

Yes, within limits. Press Esc twice on an empty prompt or run /rewind to restore the code, the conversation or both to an earlier prompt. Checkpoints only cover files Claude edited with its own edit tools; files changed only by shell commands, database changes and deployments are not undone, so commit to git often.

Which permission mode should a beginner use?

Manual mode, where Claude asks before every edit and every command that is not read only, is the clearest way to learn what it does. Plan mode is for exploring and agreeing on a plan before any change. Recent versions start new terminal sessions in auto mode when it is available; switch modes at any time with Shift+Tab.