How to Set Up Claude Code CLI (Beginner Guide)

Claude Code is Anthropic’s command-line AI coding assistant. You run it in your terminal, point it at your codebase, and talk to it in plain English. It reads your files, understands your project structure, and helps you write, debug, and improve code. If you’ve been curious about AI-assisted development, this is the tool to try.

Before You Start

You need three things:

  • A computer – Windows, macOS, or Linux all work
  • A terminal – Terminal on Mac, PowerShell on Windows, or any Linux shell
  • A Claude account – Claude Code connects to Anthropic’s cloud service, so you need an account (free tier works)

Installation

Pick the command that matches your system and run it in your terminal.

macOS or Linux

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

Windows (PowerShell)

irm https://claude.ai/install.ps1 | iex

If You Already Have Node.js

Node.js 18+ required. This works on any platform:

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

Verify It Worked

Close your terminal, open a new one, and run:

claude --version

You should see a version number. If you get “command not found,” restart your terminal and try again.

Using Claude Code

Claude Code works inside project folders. Navigate to your code and start it:

cd your-project
  claude

The first time you run it, you’ll authenticate with your Claude account. After that, you’re in a conversation with an AI that can see and modify your code.

What You Can Do

Once Claude is running, type what you want in plain language:

  • “Explain what this file does” – Get a breakdown of any code file
  • “Find and fix the bug in the login function” – Debug with context
  • “Write tests for the payment module” – Generate test coverage
  • “Refactor this to use async/await” – Modernize code patterns
  • “Add error handling to the API calls” – Improve robustness

Claude reads your files, proposes changes, and can edit code directly with your approval. It’s a conversation, not a one-shot prompt.

Troubleshooting

  • Command not found? Restart your terminal. The installer updates your PATH, but existing sessions won’t see it.
  • Windows issues? Use PowerShell as Administrator, or better yet, install WSL and use the Linux instructions.
  • Authentication problems? Make sure you have a valid Claude account at claude.ai.

The Short Version

  1. Run the install command for your OS
  2. Verify with claude --version
  3. Navigate to a project folder and run claude
  4. Start talking to your code

Claude Code turns your terminal into a collaborative coding environment. You describe what you want, it reads your codebase, and together you build. The learning curve is about five minutes. The productivity gain is immediate.