Claude Code CLI Beginner's Guide: From Installation to Your First AI Coding Task
Beginner15 min read
Claude Code CLI Beginner's Guide: From Installation to Your First AI Coding Task

Claude Code CLI Beginner's Guide: From Installation to Your First AI Coding Task

CATAITO Team2026-08-07
Your operating system:

What This Tutorial Teaches

Claude Code is Anthropic's AI coding agent that runs in your terminal. It can read your project, edit files, run commands, and automate development tasks — all from a command line. By the end of this tutorial, you will be able to install Claude Code, sign in, and complete your first AI-assisted coding task.

Which version is covered? This tutorial covers the Claude Code CLI — the version you run in your terminal. It does not cover the desktop app or the web version. If you want the graphical desktop app instead, jump straight to the Claude Code Desktop App: Installation & First Use Guide.

Time needed: 15–20 minutes

Difficulty: Beginner

Before You Start

RequirementDetails
Operating systemmacOS 13 or later, Windows 10 1809 or later, or Linux (Ubuntu 20.04+, Debian 10+, Alpine 3.19+)
AccountA Claude Pro, Max, Team, or Enterprise subscription, or a Claude Console account (pay-as-you-go)
TerminalPowerShell (Windows), Terminal (macOS), or your Linux terminal
HardwareAt least 4 GB of RAM
CostClaude subscription (Pro from $20/month), or pay per API usage

What is a terminal? A terminal (also called command line) is a window where you type commands instead of clicking buttons. On Windows it is called PowerShell; on macOS it is called Terminal. This tutorial uses claude commands, which you type into this window and press Enter.

What is Claude Code? Claude Code is a coding agent from Anthropic. It reads your files, understands how the parts of your project connect, and can edit multiple files, run tests, and fix errors by itself — after asking for your permission.

What is an API key? An API key is a secret code that identifies your account when paying per use. You generate it once in the Claude Console (console.anthropic.com). Treat it like a password — never share it.

How to Open Your Terminal (Step by Step)

If you are not sure how to open a terminal, follow the steps for your system below. You will use it for every command in this tutorial.

Windows — open PowerShell

  1. 1Click the Start button (the Windows logo) at the bottom-left corner of your screen.
  2. 2Type PowerShell — you do not need to click anything first, just start typing.
  3. 3Click the Windows PowerShell or Terminal app that appears in the list.
  • Windows 11 shows Terminal; Windows 10 shows Windows PowerShell. Either one works.
  1. 1If a blue User Account Control window pops up, click Yes.

How to paste a command: right-click anywhere inside the PowerShell window to paste (or press Ctrl + V).

Download and Install

Choose Your Version

VersionBest forNotes
Native installer (recommended)Most usersFully tested, recommended; updates automatically in the background
HomebrewmacOS users who already use HomebrewManage alongside other apps; update manually
WinGetWindows users who already use WinGetWindows package manager; update manually

What is Homebrew? Homebrew is a free package manager for macOS. You type brew install to install programs, just like an app store for the command line. Only choose this option if you already use Homebrew.

What is WinGet? WinGet is the official package manager built into Windows 10 and 11. Only choose this option if you already use it.

Install for Your System

Select your system below. Each tab contains the complete steps for that operating system.

Windows installation

  1. 1Open PowerShell: click the Start button (Windows logo), type PowerShell, then click Windows PowerShell or Terminal.
  2. 2Copy the command below, paste it into the PowerShell window, and press Enter:
powershell
irm https://claude.ai/install.ps1 | iex
  1. 1Wait for the installation to finish. When you can type again, verify the installation by copying and running this command:
powershell
claude --version

If you see a version number followed by (Claude Code) (for example 2.1.211 (Claude Code)), the installation succeeded.

Using CMD instead of PowerShell: if your terminal shows C:\ without PS at the start of the line, you are in CMD. Run this command instead:

cmd
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

If you see The token '&&' is not a valid statement separator, you are in PowerShell — use the irm command above. If you see 'irm' is not recognized as an internal or external command, you are in CMD — use the curl command above.

Update Claude Code: native installations update automatically. To check for updates immediately, run:

powershell
claude update

Optional — WinGet: if you prefer the WinGet package manager:

powershell
winget install Anthropic.ClaudeCode

Update it with:

powershell
winget upgrade Anthropic.ClaudeCode

Sign In

  1. 1Open a terminal and go to a project folder (replace path/to/your/project with your own folder path):
bash
cd path/to/your/project
  1. 1Start Claude Code:
bash
claude
  1. 1The first time, you will be asked to log in. A browser window opens automatically:
  • Sign in with your Claude account — use your Pro, Max, Team, or Enterprise subscription. After you sign in, the browser returns your credentials to Claude Code automatically.
  • Use the Claude Console (API) — if you prefer pay-as-you-go usage, sign in with your Console account instead.
  1. 1After signing in, you will see the Claude Code prompt, ready for your first task. Your login is stored, so you will not need to sign in again.

Note: the free Claude.ai plan does not include Claude Code. You need a paid subscription or a Console account.

Installation Troubleshooting

ErrorCauseFix
claude: command not foundThe install folder is not in your PATHSee the step-by-step fix below for your system
'irm' is not recognized as an internal or external commandYou ran the PowerShell command in CMDUse the CMD install command instead (curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd)
The token '&&' is not a valid statement separatorYou ran the CMD command in PowerShellUse the PowerShell install command instead (`irm https://claude.ai/install.ps1 \iex`)
syntax error near unexpected token '<' or HTTP 403 during installNetwork restriction, or the command was pasted into the wrong shellCheck your internet connection, make sure claude.ai is accessible, and retry in the correct terminal type
Browser login page does not openNetwork restrictions or proxyCheck your internet connection and try again. If you use a VPN or proxy, try turning it off or switching servers
Login expired · Please run /loginYour stored login expiredRun claude, then type /login inside the session and sign in again

Fix for "claude: command not found" — Windows:

  1. 1Press the Windows key, type environment variables, and click Edit the system environment variables.
  2. 2Click the Environment Variables... button.
  3. 3In the lower list (System variables), find Path, select it, and click Edit....
  4. 4Click New, add the folder where Claude Code was installed (default: C:\Users\<your username>\.local\bin), and click OK on every window.
  5. 5Close PowerShell completely and open it again, then run claude --version.

Fix for "claude: command not found" — macOS/Linux:

  1. 1Open Terminal and copy-run this command:
bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
  1. 1Reload the settings:
bash
source ~/.zshrc
  1. 1If you use Bash instead of Zsh, use ~/.bashrc in both commands above.
  2. 2Run claude --version to confirm.

Your First Task

Step 1: Open a project

Go to the project folder you want Claude Code to work on (replace the path with yours):

bash
cd path/to/your/project

You should now see the folder path in your terminal prompt.

Step 2: Start Claude Code

bash
claude

Claude Code starts and shows its prompt with the version, the current model, and the folder you are working in.

Step 3: Ask your first question

Type this request and press Enter:

text
What does this project do?

Claude Code reads the project files and explains what it finds. Try a few more:

  • What technologies does this project use? — identifies the technologies in the project
  • Where is the main entry point? — finds the main file
  • Explain the folder structure — explains how the folders are organized

Step 4: Make your first code change

Type this request and press Enter:

text
Add a hello world function to the main file

Claude Code finds the right file, shows you the proposed changes, and asks for your approval. This is normal and safe — you decide what happens on your machine.

Step 5: Approve or reject changes

When Claude Code wants to edit files or run commands, it asks for your permission first. Type y and press Enter to approve, or n to reject. Review each change — you stay in control.

You can also press Shift + Tab to cycle through permission modes:

  • Default mode — Claude asks before each change
  • acceptEdits mode — file edits are approved automatically (commands still ask)
  • plan mode — Claude only proposes a plan and changes nothing

Step 6: Exit Claude Code

When you are done, type /exit and press Enter, or press Ctrl + D twice.

Useful Commands

CommandWhat it does
claudeStart an interactive session
claude "task description"Start a session with a one-time task
claude -p "query"Run a one-off query and exit (good for scripts)
claude -cContinue your most recent conversation in this folder
claude -rResume a previous conversation
claude updateUpdate to the latest version
claude doctorCheck that your installation is healthy
/helpShow all available commands (inside a session)
/clearClear the conversation history (inside a session)
/loginSwitch accounts or sign in again (inside a session)
/usageShow usage and cost for the session (inside a session)
/exit or Ctrl + D twiceExit Claude Code

Frequently Asked Questions

Do I need a paid plan?

Yes. Claude Code requires a paid Claude subscription (Pro from $20/month billed monthly, Max from $100/month, Team, or Enterprise) or a Claude Console account with pay-as-you-go API usage. The free Claude.ai plan does not include Claude Code. Check the official pricing page for current options.

Does Claude Code work outside a git repository?

Claude Code works best inside a Git project. If you are starting from scratch, create a repository first:

bash
git init

Can Claude Code run my code?

Yes, with your permission. Claude Code can run shell commands and tests on your machine, and it always shows you what it runs before asking. Use the permission modes (Shift + Tab) to control what it can do without asking.

Is my code sent to Anthropic?

When you use Claude Code, your prompts and file contents are processed according to the data controls of your account type. Review Anthropic's data usage documentation for details.

What is MCP?

MCP (Model Context Protocol) is a standard way to connect Claude Code to external tools and data sources, such as databases or internal services. You can add MCP servers later with /mcp inside a session — it is an advanced feature, not required to start.

What's Next

  • Add project guidance: Create a CLAUDE.md file in your repository to give Claude Code durable instructions about your project.
  • Ask better questions: Be specific about what you want — describe the goal and the constraints instead of just "fix the bug".
  • Learn the permission modes: Use Shift + Tab to switch between asking-permission and more autonomous modes as you gain confidence.
  • Try Claude Code elsewhere: Claude Code is also available as a desktop app, in VS Code and JetBrains IDEs, and on the web.
  • Connect tools with MCP: Use /mcp to give Claude Code access to external data and services.
#Claude Code#AI Coding#Terminal#Anthropic

Related Tutorials