Claude Code

Claude Code tutorial: what it is, install and first steps

This Claude Code tutorial covers what it is, how to install it and what to do first. Autocomplete finishes the line you are typing. Claude Code takes the whole task: "add input validation to the signup form and update the tests". It reads the repo, edits several files, runs the tests, reads the failure, fixes it and shows you the diff.

What Claude Code actually is#

It is a coding agent: a language model running in a loop with tools. You give it a goal. It decides which tool to use next (read a file, search, edit, run a command), looks at the result, and repeats until it is done or needs you.

Gather contextread files, search,git logTake actionedit files, runcommandsVerifyrun tests, check thediffyou can interruptat any point
The agent loop. You stay in it: approve actions, redirect, or stop.

The important word is verify. An agent that can run your tests is far more useful than one that only writes code, because it can find out it was wrong.

Install it#

The official docs recommend the native installer. It updates itself in the background.

bash
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash
powershell
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

Homebrew (brew install --cask claude-code) and WinGet also work, but they do not auto-update, so you upgrade them yourself. Open a new terminal and check:

bash
claude --version

Start your first session#

bash
cd /path/to/your/project
claude

On first use it asks you to sign in. A Claude subscription (Pro, Max, Team or Enterprise), a Claude Console account, or a supported cloud provider all work. You do not need to paste files in: Claude Code reads what it needs.

Five things to try first#

  1. Explore: what does this project do? then where is the main entry point?
  2. A small change: add a hello world function to the main file. Approve the edit when it asks.
  3. A real bug: users can submit the empty form. Fix it and add a test.
  4. Git: what files have I changed? then commit my changes with a descriptive message.
  5. A refactor: refactor the auth module to use async/await, run the tests after each file.

Commands you will use daily#

CommandWhat it does
claudeStart an interactive session
claude "task"Start with a first prompt
claude -p "query"Run once and print the answer (good for scripts)
claude -cContinue the most recent conversation
claude -rPick a previous conversation to resume
/clearWipe the conversation context
/helpList commands
Shift+TabCycle permission modes

Permissions: what it can do without asking#

By default it asks before editing files or running commands. The session's permission mode controls how much it can do on its own, and Shift+Tab switches modes. Start strict, loosen it only for tasks you trust, and read every diff before you commit. If something must never happen, enforce it with a hook rather than hoping the instructions are followed.

How to get good results#

  • Be specific. "Fix the login bug where users see a blank screen after entering wrong credentials" beats "fix the bug".
  • Let it explore first. Ask it to analyze before you ask it to change.
  • Give it a way to check itself. Tests, a linter, a type check. Tell it the command.
  • Write down what you keep repeating. Put it in a CLAUDE.md file.
  • Keep tasks small and verifiable. This is delegation: if you cannot tell when it went wrong, keep your hands on it. See the 4D framework.

When Claude Code is the wrong tool#

If you need a one-line answer, a chat is faster. If you cannot review the diff, do not let an agent make it. And if the whole goal is to avoid understanding the code, read vibe coding vs AI-assisted engineering first.

Official quickstart: code.claude.com/docs/en/quickstart.

Frequently asked questions

What is Claude Code?

Claude Code is an AI coding agent. You run it in a project directory, describe a task in plain language, and it reads files, edits code, runs commands and tests, and shows you what it changed.

How do I install Claude Code?

On macOS, Linux or WSL run 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 also work. Then run claude --version to check.

Do I need an API key to use Claude Code?

No. You can sign in with a Claude subscription (Pro, Max, Team or Enterprise) or a Claude Console account, or use a supported cloud provider. If ANTHROPIC_API_KEY is set and you approve it, Claude Code uses that key.

Is Claude Code only for the terminal?

No. It also runs in VS Code and JetBrains IDEs, as a desktop app, on the web, in Slack and in CI through GitHub Actions and GitLab. The terminal version is the most complete.

How is Claude Code different from autocomplete tools?

Autocomplete suggests the next lines while you type. Claude Code is an agent: it plans a task, uses tools across many files, runs your tests, reads the failures and keeps going until the task is done or it needs your decision.