Claude Code is one of the most powerful AI coding tools in 2026. But setting it up for the first time can be confusing. Terminal-based. No GUI. No install wizard.

This guide will walk you through everything — from installation to your first real coding session.

What is Claude Code?

Claude Code is an AI coding agent that runs in your terminal. You type what you want in plain English, and it reads your code, makes changes, runs commands, and even handles git — all by itself.

It is not an editor extension like Copilot. It is not a code editor like Cursor. It is a standalone tool that works alongside whatever editor you already use.

Think of it like having a senior developer sitting next to you in the terminal, ready to help with anything.

What You Need Before Starting

Before installing Claude Code, make sure you have:

  • A computer — Mac, Linux, or Windows (with WSL)
  • A terminal — Terminal on Mac, Bash on Linux, or WSL on Windows
  • A Claude account — free account works, but you will want Pro ($20/month) for real usage

That’s it. You don’t need Node.js for the recommended installation method.

Step 1: Install Claude Code

Open your terminal and run this one command:

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

That’s it. The installer downloads Claude Code and sets everything up.

On Mac with Homebrew

If you use Homebrew, you can also install it this way:

brew install --cask claude-code

On Windows

Claude Code works on Windows through WSL (Windows Subsystem for Linux). First, make sure you have WSL installed. Then open your WSL terminal and run:

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

Alternative: Install with npm

If you prefer npm (you need Node.js 18+ for this method):

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

Important: Never use sudo with npm install. If you get permission errors, fix your npm permissions instead.

Verify the Installation

After installing, check that it works:

claude --version

You should see a version number. If you get “command not found”, your PATH needs updating. Add this to your shell config (~/.bashrc or ~/.zshrc):

export PATH="$HOME/.local/bin:$PATH"

Then restart your terminal.

Step 2: Log In

Run Claude Code for the first time:

claude

It will open a browser window asking you to log in with your Claude account. Sign in, approve the connection, and go back to your terminal.

You only need to do this once. After that, Claude Code remembers your login.

Step 3: Your First Session

Now the fun part. Navigate to any project on your computer:

cd ~/my-project
claude

Claude Code starts and shows you a prompt. You can type anything in plain English. Try these:

Ask About Your Project

What does this project do? Give me a quick summary.

Claude Code will read your files and explain your project structure. This is great when you open an unfamiliar codebase.

Find and Fix a Bug

The login button does nothing when clicked. Find the bug and fix it.

Claude Code will search your code, find the issue, and offer a fix. It shows you exactly what it wants to change. You approve or reject each change.

Create Something New

Create a new API endpoint that returns a list of users from the database.

Claude Code will create the necessary files, write the code, and even update related files (like routes or imports).

Run Commands

Run the tests and fix any failures.

Claude Code can run your test suite, read the output, figure out what’s wrong, and fix the code. Then it runs the tests again to make sure everything passes.

Essential Commands

While chatting with Claude Code, you can use slash commands. Type / to see the full list. Here are the ones you will use most:

Commands You Need Every Day

CommandWhat It Does
/helpShows all available commands
/clearClears the conversation and starts fresh
/compactSummarizes the conversation to save context space
/costShows how many tokens you have used (and the cost)
/modelSwitch between AI models

When to Use Each

/clear — Use this when you start a new task. Don’t keep old conversation history from a different task. It wastes tokens and can confuse the AI.

/clear

Then start your new task with a fresh conversation.

/compact — Use this when you are working on a long task and the context is getting full. You can add instructions to tell it what to keep:

/compact keep the database schema and the error we are debugging

/cost — Check this during long sessions. A single complex task can use more tokens than you expect.

/cost

/model — Switch models based on the task:

/model sonnet
/model opus

Use Sonnet for most tasks — it is fast and handles 80% of work. Switch to Opus for complex architecture decisions, subtle bugs, or tasks that need deep thinking. Switch back to Sonnet when the hard part is done.

Set Up CLAUDE.md (Important)

This is the one thing that makes Claude Code 10x better. Create a file called CLAUDE.md in the root of your project:

touch CLAUDE.md

Write basic information about your project:

# Project Overview

This is an Android app built with Jetpack Compose and Kotlin.

## Tech Stack
- Kotlin
- Jetpack Compose
- Room database
- Retrofit for API calls
- Hilt for dependency injection

## Build Commands
- Build: ./gradlew build
- Test: ./gradlew test
- Run: ./gradlew installDebug

## Project Structure
- app/src/main/java/com/example/ — main source code
- app/src/test/ — unit tests
- app/src/androidTest/ — UI tests

Every time Claude Code starts, it reads this file first. It gives the AI immediate context about your project so it doesn’t have to figure everything out from scratch.

This one file saves you time on every single session.

Tips for Writing Good Prompts

The quality of Claude Code’s output depends on how you ask. Here are some tips:

Be Specific

# Bad
Fix the bug.

# Good
The app crashes when the user taps the save button with an empty title field.
Check the SaveViewModel and fix the null pointer exception.

Give Context

# Bad
Add a dark mode toggle.

# Good
Add a dark mode toggle to the Settings screen.
The app uses Material 3 theming. The current theme is in ui/theme/Theme.kt.
The toggle should save the preference using DataStore.

Break Big Tasks Into Steps

# Bad
Build a complete user authentication system with login,
registration, password reset, email verification, and OAuth.

# Good
Let's build authentication step by step.
First, create the login screen with email and password fields.
Use the existing AuthRepository in data/repository/.

Don’t ask for everything at once. Ask for one thing, check the result, then ask for the next.

Tell It What NOT to Do

Add search to the task list screen.
Don't change the existing TaskViewModel.
Create a new SearchViewModel instead.
Use the existing Room DAO — don't create a new one.

This prevents Claude Code from making changes you don’t want.

Using Claude Code with Your Editor

Claude Code runs in the terminal. Your editor runs separately. Here is how to use them together:

The Two-Window Setup

  1. Left side: Your editor (VS Code, Android Studio, whatever you use)
  2. Right side: Terminal with Claude Code

You work in your editor normally. When you need help — switch to the terminal, ask Claude Code, and it makes changes to the same files your editor has open. Your editor shows the changes in real time.

The Flow

1. You see a problem in your editor
2. Switch to terminal
3. Tell Claude Code: "The function on line 45 of UserRepository.kt has a bug..."
4. Claude Code fixes it
5. Your editor shows the updated file
6. You review the change
7. Continue coding

It is like pair programming. You think. Claude Code types.

Common Mistakes

Mistake 1: Not Using /clear

If you are working on Task A and then switch to Task B without clearing — Claude Code still has Task A in its memory. This confuses it. Always clear between different tasks.

Mistake 2: Giving Vague Instructions

“Make it better” or “fix everything” gives bad results. Be specific about what you want.

Mistake 3: Not Setting Up CLAUDE.md

Without CLAUDE.md, Claude Code has to read your entire project every time to understand it. This wastes time and tokens. Spend 5 minutes writing a CLAUDE.md and save hours over the next month.

Mistake 4: Using Opus for Everything

Opus is the smartest model, but it is slower and more expensive. Most tasks work perfectly fine with Sonnet. Save Opus for when you actually need deep thinking.

Mistake 5: Accepting Changes Without Checking

Claude Code shows you every change before applying it. Read the diffs. It usually gets things right, but sometimes it makes assumptions that don’t match your project. A quick look takes 10 seconds and can save you 30 minutes of debugging.

Which Plan Do You Need?

PlanPriceClaude Code AccessBest For
Free$0Very limitedTrying it out
Pro$20/monthYes, with limitsMost developers
Max 5x$100/monthFull access + OpusHeavy daily use
Max 20x$200/monthEverything + agent teamsProfessional/team use

My recommendation: Start with Pro at $20/month. It gives you enough for daily use. If you find yourself hitting limits constantly, upgrade to Max.

Quick Summary

StepWhat to Do
1Install: curl -fsSL https://claude.ai/install.sh | bash
2Log in: run claude and sign in via browser
3Navigate to your project: cd ~/my-project
4Create CLAUDE.md with project info
5Start coding: claude and describe what you need
6Use /clear between tasks
7Use /compact when context fills up
8Use Sonnet for most tasks, Opus for hard problems

Claude Code is the most powerful AI coding tool available in 2026 — once you get past the initial setup. Give it a real project, write a good CLAUDE.md, and see how much faster you can work.