# How to use Claude Code: install, set up and build your first project, step by step

> A hands-on guide to Claude Code from the first install command to your first commit: every official install and update method, VS Code, CLAUDE.md, permission modes, rewinding mistakes and fixing common problems.

- URL: https://geeklyplug.com/blogs/how-to-use-claude-code/
- Author: A. Farooq, Editor
- Topic: AI
- Published: 2026-11-23
- Updated: 2026-11-28

## Short answer

To use Claude Code, install it with Anthropic's native installer, open a terminal in your project folder, run `claude` and sign in with a paid Claude plan or Console account. Then describe tasks in plain English. Claude reads your code, proposes edits, runs commands and asks permission based on your permission mode. Add a CLAUDE.md file for project rules and use git to review every change.

Most guides on how to use Claude Code either stop at the install command or assume you already live in a terminal. Then you hit the questions that actually slow you down: which install method to pick, why `claude` is "not found", whether it will edit files without asking, and how to undo a change you did not want.

This guide walks through the whole path in order: what Claude Code is, how to install and update it on each operating system, how to use it in VS Code, a first-project walkthrough from first prompt to commit, and the settings that keep it safe. Every command comes from Anthropic's official docs, checked on November 23, 2026, and we ran the CLI checks shown below on Claude Code 2.1.330 on Linux, then retested an npm install on 2.1.332 on November 28, 2026.

## What is Claude Code, and how does it work?

Claude Code is Anthropic's coding agent. Instead of pasting snippets into a chat window, you start it inside a project and describe what you want. It reads the files it needs, edits them, runs commands such as tests or git, and reports back. It runs in the terminal, in VS Code and other editors, in a desktop app and on the web.

Under the hood, [Anthropic describes](https://code.claude.com/docs/en/how-claude-code-works) an agentic loop with three phases that blend together: gather context, take action and verify results. A simple question may only need the first phase. A bug fix cycles through all three repeatedly: read the code, change it, run the tests, read the failure, change it again. You can interrupt at any point with `Esc`, or type a correction while it works.

To do this, Claude Code has tools for file operations, search, running shell commands, web lookups and code intelligence. It can also connect to outside services through the [Model Context Protocol](https://geeklyplug.com/blogs/model-context-protocol/). If you want the bigger picture of how agents like this are put together, our guide on [how to build an AI agent](https://geeklyplug.com/blogs/how-to-build-an-ai-agent/) covers the same loop from the builder's side.

## Before you start: what you need

- **A paid account.** Anthropic's [setup page](https://code.claude.com/docs/en/setup) says Claude Code requires a Pro, Max, Team, Enterprise or Console account, and the free claude.ai plan does not include it. Companies can also connect through Amazon Bedrock, Google Cloud or Microsoft Foundry.
- **A supported system.** macOS 13.0 or later, Windows 10 1809 or later (or Windows Server 2019), Ubuntu 20.04+, Debian 10+ or Alpine Linux 3.19+, with 4 GB of RAM or more and an x64 or ARM64 processor.
- **A shell and an internet connection.** Bash, Zsh, PowerShell or CMD all work.
- **A project folder,** ideally one tracked with git so you can review and roll back changes.

You do not need Node.js for the recommended installer. Only the npm package needs it, and the setup page asks for Node.js 22 or later.

## How to install Claude Code

Anthropic labels its native installer as the recommended method. It downloads a standalone binary and keeps it updated in the background. Pick the line for your system:

```bash
# macOS, Linux or WSL
curl -fsSL https://claude.ai/install.sh | bash

# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

# Windows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
```

*Native install commands from Anthropic's quickstart and setup docs*

The [quickstart](https://code.claude.com/docs/en/quickstart) warns that the install command shows no progress while it downloads, so give it a minute. When it finishes, open a new terminal window so your shell picks up the new `claude` command.

### Other ways to install it

*Claude Code install methods compared*

| Method | Install command | Auto-updates? | Best for |
| --- | --- | --- | --- |
| Native installer (recommended) | `curl -fsSL https://claude.ai/install.sh \| bash` | Yes, in the background | Most people on any OS |
| Homebrew (macOS, Linux) | `brew install --cask claude-code` | No, unless you opt in | People who manage all tools with Homebrew |
| WinGet (Windows) | `winget install Anthropic.ClaudeCode` | No, unless you opt in | Windows users who prefer a package manager |
| apt, dnf or apk (Linux) | `sudo apt install claude-code` after adding Anthropic's repository | No | Managed Linux servers and fleets |
| npm | `npm install -g @anthropic-ai/claude-code` | No; update with npm | Setups that already standardize on npm (needs Node.js 22+) |

Two details trip people up. Homebrew has two casks: `claude-code` tracks the stable channel, which the setup page says is "typically about a week behind" and skips releases with major regressions, while `claude-code@latest` gets every release. And for npm, Anthropic says not to use `sudo npm install -g`.

### Installing on Windows

You can run Claude Code natively on Windows or inside WSL. On native Windows you do not need to run as Administrator. Anthropic recommends installing [Git for Windows](https://code.claude.com/docs/en/setup) so Claude Code can use its Bash tool; without it, Claude Code falls back to PowerShell. If you use WSL, run the Linux install command inside the WSL terminal and you do not need Git for Windows. WSL 2 also supports sandboxing, which native Windows does not.

### Check that it worked

Run these two commands. The first prints the version. The second, `claude doctor`, prints read-only diagnostics about your install and settings without starting a session. Here is what they returned on our test machine:

```bash
$ claude --version
2.1.330 (Claude Code)

$ claude doctor
Claude Code doctor

Running: native (2.1.330)
Platform: linux-x64
Search: OK (/usr/bin/rg)
Auto-update channel: latest
...
```

*Output from Claude Code 2.1.330 on Linux, trimmed. Your version and paths will differ.*

### What we ran into when we retested it

Five days later we installed it again through npm on a fresh Linux machine with Node.js 24, without signing in, to see what a new user hits first. The install took about five seconds and used 384 MB, most of it the bundled native program. Here is what came up:

- **The version had already moved on.** We got 2.1.332, two releases after the 2.1.330 we first tested. Releases are frequent, so expect your version number to be ahead of any guide, including this one.
- **`claude doctor` warned that it could not auto-update.** Its message was "Can't auto-update: npm global folder isn't writable." npm installs only update themselves if the folder npm installed into is writable by you. Fix: use the native installer, or set a user-owned npm folder; do not reach for `sudo`, which Anthropic advises against.
- **A network check flagged our proxy.** Our test machine sits behind a corporate-style proxy. `claude doctor` reached the API in 145 ms but reported the sign-in host as failed with `ERR_PROXY_TUNNEL`, and pointed to Anthropic's [network configuration page](https://code.claude.com/docs/en/network-config). If sign-in hangs at work, run `claude doctor` first: it tells you which host is blocked.
- **Scripts fail fast before you sign in.** Piping into `claude -p` without signing in printed "Not logged in · Please run /login" and exited with code 1. If you use `claude -p` in a script or CI job, check the exit code so a missing login does not pass silently.

If `doctor` lists warnings, it prints a suggested fix under each one, such as running `claude install` to repair a broken launcher.

## How to update Claude Code

How you update depends on how you installed it. Native installs check for updates on startup and periodically while running, and the new version takes effect the next time you start Claude Code. To update right away, run:

```bash
# Native install: check for and install an update now
claude update

# Homebrew (use the cask you installed)
brew upgrade claude-code
brew upgrade claude-code@latest

# WinGet
winget upgrade Anthropic.ClaudeCode

# apt / dnf / apk
sudo apt update && sudo apt upgrade claude-code
sudo dnf upgrade claude-code
apk update && apk upgrade claude-code

# npm (Anthropic says to avoid npm update -g)
npm install -g @anthropic-ai/claude-code@latest
```

*Update commands per install method, from Anthropic's setup docs*

In the CLI's own help text, `update` is described as "Check for updates and install if available; package-manager installs update through the package manager." A few related controls are worth knowing:

- **Choose a release channel.** Set `autoUpdatesChannel` to `"stable"` in your settings file, or use **Auto-update channel** in `/config`, if you would rather run a version that is about a week old. The default is `"latest"`.
- **Turn off background updates.** Set the `DISABLE_AUTOUPDATER` environment variable to `"1"` under `env` in `settings.json`. Manual `claude update` still works. To block every update path, Anthropic says to set `DISABLE_UPDATES` instead.
- **Let Homebrew or WinGet upgrade automatically.** Set `CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE` to `1`. This works for those two package managers only.
- **Pin a version.** The native installer accepts a channel or version number, for example `curl -fsSL https://claude.ai/install.sh | bash -s stable`.

## How to get started with Claude Code: your first session

Open a terminal, move into a project folder and start Claude Code:

```bash
cd /path/to/your/project
claude
```

*Start an interactive session in your project*

On first run, Claude Code opens your browser so you can sign in with your Claude subscription or Console account. Credentials are stored, so you will not need to log in again. If you use a Console account, the quickstart notes that a "Claude Code" workspace is created automatically for cost tracking. To switch accounts later, type `/login` inside a session.

The prompt shows the version, the current model and the working directory. Type `/help` to list commands, or `/` to browse commands and skills.

> Claude Code reads your project files as needed. You don't have to manually add context.
>
> [Anthropic, Claude Code quickstart](https://code.claude.com/docs/en/quickstart)

## A first project walkthrough, from question to commit

Here is a practical first hour, using the same kinds of prompts Anthropic's quickstart recommends. Treat it as an example to adapt to your own project, not a script.

1. **Get oriented.** Ask `what does this project do?`, then `where is the main entry point?` and `explain the folder structure`. Claude searches and reads files to answer. Nothing changes on disk.
2. **Create a CLAUDE.md.** Run `/init`. Claude analyzes the codebase and writes a starting CLAUDE.md with build commands, test instructions and conventions. Read it and fix anything wrong (more on this file below).
3. **Plan before editing.** Press `Shift+Tab` until the status bar shows `⏸ plan mode on`, then describe a small change, such as `add input validation to the signup form`. In plan mode Claude researches and proposes changes without making them.
4. **Approve and let it work.** When the plan looks right, approve it. You can choose to approve edits manually or let it continue in auto mode. Watch the diffs as they appear.
5. **Make it prove the change works.** Ask `write unit tests for the validation and run them`. A change that comes with passing tests is far easier to trust.
6. **Review and commit.** Ask `what files have I changed?`, read the diff yourself, then `commit my changes with a descriptive message`. On a team, follow with `create a pr`.

> **The habit that matters most**
>
> Be specific. The quickstart's own example: instead of "fix the bug", write "fix the login bug where users see a blank screen after entering wrong credentials". Name the file, the behavior you see and the behavior you want, and break big jobs into numbered steps.

If you are new to writing instructions for Claude, our guide to [Claude prompt engineering](https://geeklyplug.com/blogs/claude-prompt-engineering/) covers the techniques that work best with Anthropic's models.

### Commands you will use every day

*Essential Claude Code commands*

| Command | Where | What it does |
| --- | --- | --- |
| `claude` | Terminal | Start an interactive session in the current folder |
| `claude "task"` | Terminal | Start a session with a first prompt |
| `claude -p "query"` | Terminal | Answer one query and exit, useful in scripts and pipes |
| `claude -c` | Terminal | Continue the most recent conversation in this folder |
| `claude -r` | Terminal | Pick a previous conversation to resume |
| `claude --permission-mode plan` | Terminal | Start in plan mode |
| `/init` | In a session | Generate a starting CLAUDE.md |
| `/compact` | In a session | Summarize the conversation to free up context |
| `/clear` | In a session | Clear conversation history and start fresh |
| `/rewind` or `Esc` twice | In a session | Restore code or conversation to an earlier checkpoint |
| `Shift+Tab` | In a session | Cycle permission modes |
| `/exit` or `Ctrl+D` twice | In a session | Quit |

Because `claude -p` reads standard input, it slots into ordinary shell pipelines. The [common workflows](https://code.claude.com/docs/en/common-workflows) page gives this example:

```bash
git log --oneline -20 | claude -p "summarize these recent commits"
```

*Piping git output into Claude Code*

## How to use Claude Code in VS Code

If you prefer a graphical panel to the terminal, install the official extension. According to [Anthropic's VS Code docs](https://code.claude.com/docs/en/vscode), you need VS Code 1.94.0 or higher and the same paid Claude or Console account. No API key is required.

1. Press `Cmd+Shift+X` on Mac or `Ctrl+Shift+X` on Windows and Linux to open Extensions, search for "Claude Code" by Anthropic and click **Install**. The same extension installs in Cursor and other VS Code forks, or from the Open VSX registry.
2. Open a file, then click the **Spark icon** in the editor toolbar at the top right. You can also open the Command Palette and choose **Claude Code: Open in New Tab**.
3. Click **Sign in** the first time. If you see "Not logged in · Please run /login", run **Developer: Reload Window** from the Command Palette.
4. Type a request. Use `@` to mention a file or folder, such as `@src/components/`, or select code first and it is sent along automatically. `Option+K` on Mac or `Alt+K` on Windows and Linux inserts a reference to the selected lines.
5. Review the side-by-side diffs Claude proposes and accept or reject each change.

`Cmd+Esc` on Mac or `Ctrl+Esc` on Windows and Linux toggles focus between your code and Claude. Each tab is its own conversation, and the extension shares conversation history with the CLI. The extension bundles its own copy of Claude Code, so if you also want to run `claude` in VS Code's integrated terminal, install the standalone CLI too. A few CLI features, such as the `!` shortcut for running bash commands and tab completion, are not available in the extension.

Comparing editors as well? Our [Claude Code vs Cursor](https://geeklyplug.com/blogs/claude-code-vs-cursor/) guide explains how Claude Code fits alongside an AI-first editor.

## Teach it your project with CLAUDE.md

A CLAUDE.md file holds standing instructions that Claude reads at the start of every session. The [memory docs](https://code.claude.com/docs/en/memory) list where these files can live:

*Where CLAUDE.md files go and who they apply to*

| File | Scope | Share it? |
| --- | --- | --- |
| `./CLAUDE.md` or `./.claude/CLAUDE.md` | This project, for everyone | Yes, commit it to the repo |
| `./CLAUDE.local.md` | This project, just you | No, add it to `.gitignore` |
| `~/.claude/CLAUDE.md` | All your projects | No, personal |
| Managed policy file | Everyone in an organization | Set by IT |

Anthropic's guidance is to target under 200 lines per file and to write instructions that are concrete enough to verify: "Use 2-space indentation" rather than "Format code properly". Put in the facts Claude needs every session, such as build commands, conventions and project layout. You can pull in other files with `@path` imports. A short example:

```markdown
# Project notes for Claude

See @README.md for the overview and @package.json for scripts.

## Commands
- Install: npm ci
- Test: npm test (run before every commit)
- Lint: npm run lint

## Conventions
- TypeScript strict mode, 2-space indentation
- New API routes go in src/routes/, one file per resource
- Never edit files in src/generated/
```

*An illustrative CLAUDE.md for a TypeScript project*

CLAUDE.md is guidance, not a lock. The docs say Claude treats it "as context, not enforced configuration", so anything that must never happen belongs in permission rules or hooks. Longer procedures you repeat, like a release checklist, fit better as [Claude skills](https://geeklyplug.com/blogs/what-are-claude-skills/), which load only when needed.

## Permission modes: how much Claude can do without asking

The permission mode decides which actions run without your approval. Press `Shift+Tab` to cycle through them during a session, or start with `--permission-mode`. The [permission modes page](https://code.claude.com/docs/en/permission-modes) lists six:

![Claude Code permission modes from least to most autonomy: plan, manual, accept edits, auto and bypass, plus don't ask mode for locked-down scripted runs.](https://geeklyplug.com/images/blog/claude-code-permission-modes.svg)

*Claude Code's permission modes, ordered by how much runs without asking.*

*Claude Code permission modes*

| Mode | What runs without asking | Use it when |
| --- | --- | --- |
| Manual (`default`) | Reads only | You want to approve every edit and command |
| Accept edits (`acceptEdits`) | Reads, file edits and common file commands such as `mkdir` and `mv` | You trust the plan and will review the diff afterwards |
| Plan (`plan`) | Reads; Claude proposes changes without making them | Starting any non-trivial task |
| Auto (`auto`) | Everything, with background safety checks | Routine work where constant prompts slow you down |
| Don't ask (`dontAsk`) | Only pre-approved tools; anything else is denied | Locked-down scripted runs |
| Bypass (`bypassPermissions`) | Everything | Isolated containers and VMs only |

The VS Code docs note that Auto is the built-in starting mode on Pro, Max and Team plans, so check the mode indicator before your first request. Anthropic is clear about its limits: "Auto mode reduces permission prompts but does not guarantee safety." Bypass mode, also triggered by `--dangerously-skip-permissions`, should only be used in isolated environments without internet access. Our guide to [agentic AI security](https://geeklyplug.com/blogs/agentic-ai-security/) explains why prompt injection makes broad permissions risky.

### Undo mistakes with checkpoints

Every prompt creates a checkpoint. Press `Esc` twice with an empty prompt, or run `/rewind`, to restore the code, the conversation or both to an earlier point. The [checkpointing docs](https://code.claude.com/docs/en/checkpointing) spell out the limits: only edits made by Claude's file editing tools are tracked, files changed only through bash commands are not, and actions on remote systems such as databases, APIs and deployments cannot be rewound. Checkpoints are for quick recovery inside a session. Git is still your real history.

## Troubleshooting common problems

*Common Claude Code problems and fixes*

| Problem | Likely cause | Fix |
| --- | --- | --- |
| `claude: command not found` after installing | The install folder is not on your PATH yet | Open a new terminal; if it persists, follow the "Fix your PATH" steps in Anthropic's docs |
| Login fails or Claude Code is unavailable | Free claude.ai plan | Use a Pro, Max, Team, Enterprise or Console account |
| Old version keeps running after an update | Package-manager install, or two installs on one machine | Update through your package manager and run `claude doctor` to see which binary is running |
| Bash tool unavailable on Windows | Git for Windows not installed | Install Git for Windows, or use WSL |
| VS Code says "Not logged in" | Extension session not refreshed | Run **Developer: Reload Window** |
| Claude forgets earlier instructions in a long session | The context window filled and was compacted | Put lasting rules in CLAUDE.md, use `/compact` with a focus, or `/clear` between tasks |

For anything else, start with `claude doctor` in your terminal or `/doctor` inside a session. The in-session version can also fix some issues for you.

## The bottom line

Learning how to use Claude Code comes down to a short routine: install it with the native installer, start `claude` in a git-tracked project, plan first, ask for tests, review the diff and commit. Add a CLAUDE.md once the basics feel natural, choose a permission mode you are comfortable with, and keep `claude update` and `claude doctor` in your back pocket. For more plain-English guides to AI tools, browse our [AI guides](https://geeklyplug.com/blogs/ai/).

## Frequently asked questions

### Is Claude Code free to use?

No. Anthropic's setup docs say Claude Code requires a Pro, Max, Team, Enterprise or Console account, and the free claude.ai plan does not include it.

### How do I update Claude Code?

Native installs update themselves in the background, and you can force a check with `claude update`. Homebrew, WinGet, apt, dnf and apk installs do not auto-update by default, so use your package manager, for example `brew upgrade claude-code` or `winget upgrade Anthropic.ClaudeCode`.

### Do I need Node.js to install Claude Code?

Not for the recommended native installer, which ships its own binary. Only the npm package needs Node.js, version 22 or later according to Anthropic's setup page.

### Can I use Claude Code in VS Code?

Yes. Install the Claude Code extension by Anthropic from the Extensions view (VS Code 1.94.0 or higher), then click the Spark icon or press `Cmd+Esc` on Mac or `Ctrl+Esc` on Windows and Linux. The extension shares conversation history with the CLI.

### How do I undo something Claude Code changed?

Press `Esc` twice with an empty prompt, or run `/rewind`, to restore code, conversation or both to an earlier checkpoint. Checkpoints only track edits made by Claude's file tools, so keep committing to git and never rely on rewind for databases, deployments or other remote actions.

### How does Claude Code work?

It runs an agentic loop: it gathers context by reading and searching your files, takes action by editing files and running commands, then verifies the result, for example by running tests. It repeats the loop until the task is done or you interrupt with `Esc`.

## Sources

- [Quickstart](https://code.claude.com/docs/en/quickstart), Anthropic, Claude Code Docs
- [Advanced setup](https://code.claude.com/docs/en/setup), Anthropic, Claude Code Docs
- [How Claude Code works](https://code.claude.com/docs/en/how-claude-code-works), Anthropic, Claude Code Docs
- [Common workflows](https://code.claude.com/docs/en/common-workflows), Anthropic, Claude Code Docs
- [Use Claude Code in VS Code](https://code.claude.com/docs/en/vscode), Anthropic, Claude Code Docs
- [How Claude remembers your project](https://code.claude.com/docs/en/memory), Anthropic, Claude Code Docs
- [Choose a permission mode](https://code.claude.com/docs/en/permission-modes), Anthropic, Claude Code Docs
- [Checkpointing](https://code.claude.com/docs/en/checkpointing), Anthropic, Claude Code Docs
- [Network configuration](https://code.claude.com/docs/en/network-config), Anthropic, Claude Code Docs

## Changelog

- 2026-11-28: Retested an npm install on Claude Code 2.1.332 and added what we ran into: the auto-update warning, a proxy sign-in failure and how claude -p behaves before you sign in.

---

Source: [How to use Claude Code: install, set up and build your first project, step by step](https://geeklyplug.com/blogs/how-to-use-claude-code/) on GeeklyPlug.
