In the previous chapter, we sorted AI coding tools into three types and chose Claude Code — the one you can hand large chunks of implementation to — as the star of this course. In this chapter, we finally get our hands dirty. Step by step, and paying close attention to the spots people usually trip over, we'll walk through the whole sequence — install → launch → log in → give the first instruction → approve the diff — until Claude Code is up and running in your own terminal.

What you'll be able to do after this chapter

The goal: get Claude Code to do its first real job in your own environment

Get it installed
Prepare the prerequisites and install Claude Code with a single command, then launch it.
Give instructions
Ask in plain language and run the basic loop of plan → edit → review the diff → approve.
Use it safely
Grasp the basics of permission modes and CLAUDE.md so you can delegate without letting it run wild.

What Claude Code Is (a recap)

To say it in one line again: Claude Code is an "CLI agent" made by Anthropic. Instead of copy-pasting code into a browser chat, it works right inside your terminal — reading your project's files, editing them, running commands, and executing tests. You just tell it, in plain language, "here's what I want," and the AI plans its own approach and carries out work that spans multiple files. It's genuinely like a partner sitting beside you, working alongside you.

📖 Two official pages to read first. The steps in this chapter are a beginner's signpost. For exact system requirements, the latest installation methods, and pricing plans, always confirm against primary sources — bookmark both the official documentation at code.claude.com/docs and the product page at anthropic.com/claude-code, and they'll serve you well from here on.

Getting set up — installation

Claude Code is installed and run on top of a Node.js environment. There's no complicated setup. First, let's get two prerequisites in place.

① Node.js

The foundation Claude Code runs on. If you don't have it yet, grab the LTS version from the official site nodejs.org. To check whether it's already installed, run node -v — if it prints a version number, you're set.

② A terminal

The screen where you type commands. On macOS use "Terminal," on Windows use "PowerShell" or WSL, and on Linux the standard terminal is fine. As long as you can do the basic operations we covered in the previous chapter, you're good.

Once you're ready, type the following single command into your terminal. All it does is use npm (the package manager that comes with Node.js) to install Claude Code so it's available across your whole system.

Terminal — installation
npm install -g @anthropic-ai/claude-code

-g means "install it globally" — that is, so you can call it from any folder. Once it finishes, launch it with the next command.

Terminal — launch
claude

⚠️ If you see claude: command not found. The install succeeded, yet the command isn't recognized — this is one of the classic first stumbles for newcomers. It's usually caused by a Node.js/npm path setting, and the fix is well-established. Our "command not found / installation error" article lays out how to fix it on each OS.

The finer system requirements, OS-specific recommended steps, and alternative installation methods vary by environment. For the latest, accurate information, always check the official documentation at code.claude.com/docs.

First launch and login

When you first launch it with claude, you'll be asked to log in (authenticate) with your Anthropic account. Just follow the on-screen prompts; in most cases a browser opens, you sign in there, authentication completes, and you're returned to the terminal.

STEP 1
Launch

Type claude in the terminal. The first time, a screen appears for choosing how to log in.

STEP 2
Authenticate

Follow the prompts to sign in to your Anthropic account in the browser. Once you approve, authentication goes through.

STEP 3
Come back

Back in the terminal, you land on a prompt waiting for input. This is the doorway to the conversation. Next up: giving instructions.

You can log in either with a Claude subscription that includes the relevant plan, or with an API key. Which one you can use — and how charges apply — differs by plan, so we won't make blanket claims here. Check the official documentation for the method that fits your subscription.

🔑 If you can't log in or get an authentication error. The browser won't open, the code gets rejected when you paste it, the process stalls partway — authentication issues are another classic stumbling point. We've gathered fixes by cause in our "login / authentication error" article. If that still doesn't solve it, see Chapter 5, "Getting unstuck," which handles being stuck more systematically.

Giving your first instruction — the basic loop

Once you're authenticated, it's showtime. The first thing that matters is to launch Claude Code inside the folder of the project you want to work on. Claude Code treats "the folder you're currently in" as its working target, so if you get this wrong, it'll touch the wrong place.

Terminal — launch inside the project
cd my-project claude

From there, you simply tell it what you want in plain language. You can ask in ordinary words, like "Read the README and explain what this project does" or "Add a contact form to the top page." From here on, the following four steps become the basic loop you'll repeat again and again.

LOOP 1
Ask

Tell it what you want in plain language. The more specific rather than vague, the more it does what you intended.

LOOP 2
Plan

The AI reads the relevant files, works out what to change and how, and gets going.

LOOP 3
Review the diff

Which lines change, and how, is shown as a diff. Green is added, red is removed.

LOOP 4
Approve

If you're happy with it, approve and apply. If not, reject it, describe the fix in words, and let it try again.

The key is LOOP 3, "reviewing the diff." Before rewriting a file, Claude Code first shows you a diff saying "I'll change this to that," and it waits for your approval before applying. Reading the contents here and judging whether they match your intent is the human's role. As we touched on in the previous chapter, reading the code it produces and telling good from bad is your job.

✅ Make your first move "small and verifiable." Rather than asking for a big overhaul right away, get comfortable with small requests whose results you can check with your own eyes — "explain this file," "add one small function." Once that works, gradually widen what you delegate — that's the trick to not taking the long way around.

How you phrase requests themselves (choosing between loosely delegating with "vibe coding" and nailing down the spec first with "spec-driven development") is explored in depth in Chapter 4, "Asking well." For now, being able to run this four-step loop is plenty.

Permission modes — delegating safely

"Won't the AI delete files on its own, or run dangerous commands?" — a perfectly reasonable worry. Claude Code is designed carefully around exactly this: it's built to always insert a confirmation before any impactful operation, such as editing a file or running a command. This is the permission mode system.

Its behavior comes in several levels. Here, let's just get a rough grasp of the concept.

🛡 Normal mode

It asks for confirmation every time it edits or runs a command. Approving one at a time makes this the safest. Start here to get used to things.

📝 Plan mode

Without actually making changes, it just draws up a plan of "what it would do." Handy when you want to settle on an approach before a big piece of work.

⚡ Toward auto-approve

Skips per-action confirmation and proceeds automatically within a set scope of operations. Fast, but be careful — you're looking at the contents less often.

🚨 Bypass (no confirmation)

A powerful mode that skips all confirmations and just runs. Beginners are wise to avoid it. See the note below for when to use it and the dangers.

💡 "Bypass everything because confirming is a hassle" is a bad idea. The mode that skips all confirmations is powerful, but the flip side is that you can't stop unwanted deletions or command executions. If you want speed with safety, the proper approach isn't to jump straight to bypass — it's to first set up permission rules that allow only operations you trust. There's also the option of a "sandbox" that isolates the work and runs it safely.

For now, it's enough to remember just this: "Claude Code doesn't run wild on its own; it inserts confirmations," and "that behavior can be adjusted with modes." For more depth, you can dig in via the dedicated articles and guides.

🔀 Get to know permission modes deeply

For the differences between each mode and how to switch, see the complete guide to permission modes.

⚙️ Configure permission rules

For how to write allow/deny rules, see permission rules and settings.

📦 Isolate and run safely

For the idea behind sandboxing, see an introduction to sandboxes.

CLAUDE.md and configuration basics

As you use Claude Code more, you start to feel that "giving the same reminders every time is a chore." "Indent with two spaces," "Don't touch this folder," "Reply in English" — asking for these project-wide rules every single time is inefficient.

That's where CLAUDE.md comes in. Put a file with this name in your project's root, and Claude Code reads it automatically on launch and works with the written rules in mind. Think of it as the "manual for this project" that you hand to your partner.

CLAUDE.md — a sense of how to write it
# About this project - Language: TypeScript / Framework: Next.js - Write replies and comments in English - Indent with two spaces - Don't touch anything under src/legacy/ - Pass npm run lint before committing

The key is to write "short, specific, and only the things you truly want followed." If it's too long or too vague, it ironically becomes harder to follow. Start with just a few lines, and add to it whenever you notice "I keep saying this every time" — that's just the right way to grow it.

💡 Wrote it in CLAUDE.md but it won't follow? The common cases are: too many rules, too abstract, or contradictory. We've gathered the causes and fixes in our "when CLAUDE.md rules don't take effect" article. Learn the "knack for making them stick," and the AI's accuracy becomes markedly more stable.

Configuration isn't limited to CLAUDE.md. The permission rules from earlier, model selection, and various behaviors can all be fine-tuned in configuration files — but that can wait for later. Just "writing a few lines of project rules in CLAUDE.md" already changes how it feels to use.

Chapter recap
  • Claude Code is a CLI agent from Anthropic. Install it into a Node.js environment with npm install -g @anthropic-ai/claude-code, and launch it with claude.
  • The first time, log in (authenticate) with your Anthropic account. If you get stuck, head to the command-not-found / authentication-error articles.
  • The basics are the loop of ask → plan → review the diff → approve. Reading the diff and judging good from bad is the human's job.
  • Prevent it running wild with permission modes. Beginners should avoid bypass and widen what they delegate while confirming as they go.
  • Writing a few lines of project rules in CLAUDE.md makes the AI more likely to comply.

With that, Claude Code is running in your terminal, and you can hand it its first job. In the next chapter, Chapter 3, "Comparing tools and choosing between them," we'll sort out how it differs from peers like Cursor, GitHub Copilot, and Codex, and build the skill of picking the right one for each situation.