No history yet

Installation and Setup

Getting Started

Before you can start using Claude Code to help with your projects, you need to install its command-line interface (CLI) on your computer. This tool lets you talk to Claude directly from your terminal, making it a powerful assistant for coding tasks. Let's walk through the setup process.

Installation

There are a few different ways to install the Claude Code CLI. The best method for you depends on your operating system and the tools you already have installed.

You'll only need to choose one of the following installation methods.

If you have Node.js and npm (Node Package Manager) on your system, you can install it with a single command. This is a common method for developers who work with JavaScript.

npm install -g @anthropic-ai/claude-code

For macOS users, Homebrew is another straightforward option. If you use Homebrew to manage your software packages, this command will feel familiar.

brew install anthropic-ai/tap/claude-code

Perhaps the most universal method for macOS and Linux is using a simple installer script. You can run it directly from your terminal using curl.

curl -fsSL https://claude.ai/install.sh | bash

Logging In

With the installation complete, the next step is to connect the CLI to your Claude.ai account. This authentication step ensures that the tool knows who you are and has the right permissions to work with your projects.

To begin, run the login command.

claude login

After you run this command, your web browser should open automatically, prompting you to log in to your Claude.ai account. Simply follow the on-screen instructions to authorize the CLI. Once you've successfully logged in, you can close the browser tab and return to your terminal.

Starting a Session

Now you're ready to start your first interactive session. This is where you'll be able to chat with Claude, ask it to perform tasks, and get help with your code. To launch a new session, just type claude and press Enter.

claude
Lesson image

You’ll see a prompt, and you can start typing your requests directly. Try asking something simple, like "What can you do?" to get a feel for how it works. You've now successfully installed and configured Claude Code.

Quiz Questions 1/4

Which of the following is NOT a method mentioned in the documentation for installing the Claude Code CLI?

Quiz Questions 2/4

True or False: After running the claude login command, you must manually copy and paste an authentication token from the website back into your terminal.

With the setup complete, you're ready to explore what Claude Code can do.