AI-101

Lesson 2

Installing Claude Code

AI Confidence: 90%

AI-generated

Installing Claude Code

Learning Objectives

Verify that your computer meets the system requirements for Claude Code

Choose the right installation method for your operating system

Install Claude Code using the recommended method

Confirm that the installation succeeded

Know how to update Claude Code when new versions are released

Introduction

Now that you understand what Claude Code can do, it is time to install it on your computer. The good news is that installation takes just a few minutes on any major operating system. Whether you use macOS, Windows, or Linux, there is a straightforward path to get started.

This lesson walks you through the entire installation process. We will check that your system meets the requirements, choose the best installation method, run the install command, and verify that everything works. By the end, you will have Claude Code ready to use.

Do not worry if you are new to using the terminal. We will explain each step clearly. If you have installed software from the command line before, you will find this process familiar and quick.

System Requirements

Before installing, make sure your computer meets the minimum requirements. Claude Code is not demanding, but there are a few things to check.

Operating system versions:

macOS 13.0 (Ventura) or later

Windows 10 version 1809 or later

Ubuntu 20.04 or later (other Linux distributions with similar specifications also work)

Hardware:

At least 4 GB of RAM (more is better for large codebases)

A stable internet connection (Claude Code requires connectivity to work)

Windows-specific requirement:

If you use Windows, you need Git for Windows installed. Claude Code uses Git under the hood for many operations. Download it from https://git-scm.com/downloads/win if you do not already have it.

To check your operating system version:

macOS: Click the Apple menu, then "About This Mac"

Windows: Press Windows key + I, then go to System > About

Linux: Run lsb_release -a in your terminal

If your system meets these requirements, you are ready to install.

Installation Methods

Claude Code offers several installation methods. The right choice depends on your operating system and preferences.

Native installer (recommended). This is the easiest option for most people. You run a single command, and Claude Code installs itself. Native installations also update automatically in the background, so you always have the latest version.

Homebrew (macOS and Linux). If you already use Homebrew to manage software, you can install Claude Code as a cask. Note that Homebrew installations do not auto-update. You need to run an upgrade command periodically.

WinGet (Windows). Windows users who prefer WinGet can use it to install Claude Code. Like Homebrew, WinGet installations require manual updates.

For most users, we recommend the native installer. It is simple, works on all platforms, and keeps itself updated. Let us walk through each method.

Installing on macOS or Linux

Open your terminal application. On macOS, you can find Terminal in Applications > Utilities, or search for it with Spotlight. On Linux, use your distribution's terminal emulator.

Using the native installer:

Copy and paste this command, then press Enter:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

This command downloads the installer script and runs it. You will see progress messages as it installs. When it finishes, Claude Code is ready to use.

Using Homebrew:

If you prefer Homebrew, run:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Remember that Homebrew installations do not update automatically. Run this command periodically to get new features and security fixes:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

After installation, you can verify it worked by running:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

This should print the version number of Claude Code. If you see a version number, the installation succeeded.

Installing on Windows

Windows installation requires a few extra considerations. First, make sure you have Git for Windows installed. If you do not have it, download and install it from https://git-scm.com/downloads/win before proceeding.

Next, open a terminal. You can use either PowerShell or Command Prompt (CMD). The installation command differs slightly between them.

Using PowerShell (recommended):

Open PowerShell and run:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Using Command Prompt (CMD):

If you prefer CMD, run:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

A common mistake: if you see an error message about "The token '&&' is not a valid statement separator," you are in PowerShell but trying to use the CMD command. Check your prompt. PowerShell shows PS C:\ at the beginning. CMD shows just C:\>. Use the command that matches your terminal.

Using WinGet:

If you prefer WinGet, run:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Like Homebrew, WinGet installations require manual updates:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

After installation, verify it worked:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

If you see a version number, you are all set.

Verifying Your Installation

Let us make sure everything is working correctly. Open a terminal (if you closed it) and try these steps.

Step 1: Check the version.

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

You should see output like claude-code 2.1.95 (your version number may differ). If you see "command not found" or a similar error, the installation may not have completed correctly. Try running the install command again.

Step 2: Check the help output.

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

This shows all available command-line options. You should see a list of flags like --continue, --resume, and --permission-mode. If this works, Claude Code is installed correctly.

Step 3: Run Claude Code.

Navigate to any folder on your computer (it does not need to be a code project yet) and run:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

This starts Claude Code. The first time you run it, you will be prompted to log in. We cover the login process in the next lesson. For now, you can press Ctrl+C (or Cmd+C on macOS) to exit if you just want to confirm the installation works.

If you see the Claude Code welcome screen or a login prompt, congratulations. Your installation is complete.

Keeping Claude Code Updated

Software updates bring new features, bug fixes, and security improvements. How you update depends on how you installed.

Native installer: Good news. Native installations update automatically in the background. You do not need to do anything. The next time you start Claude Code after an update is available, you will be running the new version.

Homebrew: Run this command when you want to update:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

WinGet: Run this command when you want to update:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

To see what changed in recent versions, you can check the release notes. Inside Claude Code, run the /release-notes command to browse the changelog.

If you ever need to uninstall Claude Code, the native installer includes an uninstall option. Run claude uninstall to remove it. For Homebrew, use brew uninstall --cask claude-code. For WinGet, use winget uninstall Anthropic.ClaudeCode.

Key Takeaways

Claude Code runs on macOS 13+, Windows 10+, and Ubuntu 20.04+ with at least 4 GB of RAM

Windows users must install Git for Windows before installing Claude Code

The native installer is the easiest method and includes automatic updates

Homebrew and WinGet work but require manual updates

Run claude --version to verify your installation succeeded

Try It Yourself

Install Claude Code on your computer by following these steps:

Check that your operating system meets the requirements listed above.

If you use Windows, install Git for Windows first (skip this if you already have it).

Open your terminal and run the installation command for your system.

Run claude --version to confirm the installation.

Run claude --help to see the available options.

Once you see the version number and help output, you are ready for the next lesson where we will start your first Claude Code session.

Sources

https://code.claude.com/docs/en/overview - Installation commands for all platforms

https://code.claude.com/docs/en/quickstart - Step-by-step quickstart with system requirements

https://code.claude.com/docs/en/setup - Advanced setup options, manual updates, and uninstallation