Back to Knowledge
Updated Sep 2026

Claude Code Setup

Stop copy-pasting code out of a chat window. Claude Code

Claude Code

Anthropic's agentic coding tool. It lives in your terminal (and in VS Code, JetBrains, and on the web), reads your codebase, edits files, runs commands, and ships code. Install with the native installer (`curl -fsSL https://claude.ai/install.sh | bash` on macOS/Linux, `irm https://claude.ai/install.ps1 | iex` on Windows); it needs a Pro, Max, Team, Enterprise, or Console account.

"Like having a senior developer living in your terminal, ready to help 24/7."

lives in your terminal

Terminal / CLI

A text-based interface used to give commands to your computer. It's how you talk to the machine directly.

"Like texting your computer instead of using apps. Type what you want, hit enter, get results. No buttons, just conversation."

(and your editor), reads your project, edits files, and runs commands with your permission. Here's how to install it properly and the handful of commands that matter on day one.

1What You Need

A paid Claude plan or a Console account

Claude Code works with Pro, Max, Team, Enterprise, or a Claude Console (API billing) account. The free claude.ai plan does not include Claude Code.

A terminal

macOS Terminal, any Linux shell, WSL, or Windows PowerShell. New to this? Read Terminal Basics first.

A project folder under Git

Not strictly required, but Git is your undo button when an AI edit goes sideways. Commit before big changes.

Node.js? Not for Claude Code itself.

The native installer doesn't need Node.js

Node.js

A runtime that lets you run JavaScript outside of a web browser. It's the engine that powers most modern dev tools, including Claude Code.

"Like installing a game console. You need the console (Node) before you can play any games (run tools)."

. You'll still want it for building Next.js apps: install a current LTS release (Node 24 as of Sep 2026). Node 18 and 20 are end-of-life.

2Install It (the Recommended Way)

Use the native installer. It's one line, it doesn't care what Node version you have, and it auto-updates in the background, so you're never stuck on an old build.

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

Prefer a package manager?

These work too, but they don't auto-update. You upgrade through the package manager yourself.

brew install --cask claude-code

winget install Anthropic.ClaudeCode

Advanced: npm

Still supported, but listed as an advanced option. Needs Node.js 22+. Never run it with sudo.

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

Then close and reopen your terminal and check it worked:

Terminal

claude --version   # prints the installed version
claude doctor      # read-only install diagnostics
claude update      # update now instead of waiting

3First Launch + CLAUDE.md

Always start Claude from inside your project folder. That folder is what it can see and work on.

Terminal

cd my-project
claude

First run: a browser tab opens so you can sign in with your Claude account (or your Console account). Approve it and you're back in the terminal.

Your first command: /init

/init scans the repo and writes a starter CLAUDE.md

CLAUDE.md

A Markdown file Claude Code reads at the start of every session: project context, commands, conventions, and rules. Put it at `./CLAUDE.md` (shared with the team), `~/.claude/CLAUDE.md` (personal, all projects), or `CLAUDE.local.md` (personal, gitignored). Run `/init` to generate a starter; AGENTS.md is read too.

"Like a welcome packet for a new team member. It tells Claude everything it needs to know about your project."

: the project briefing Claude reads at the start of every session. Think of it as the sticky note on the fridge: build commands, folder layout, "we use Drizzle, not Prisma", "never touch the payments folder without asking".

CLAUDE.md (keep it short and specific)

# My App

## Commands
- npm run dev      # start dev server
- npm run test     # run tests before saying "done"

## Stack
- Next.js 16 App Router, TypeScript, Tailwind v4
- Drizzle ORM + Neon Postgres

## Rules
- Auth checks live in proxy.ts, not in pages
- Never commit .env files

./CLAUDE.md

Project rules. Commit it so your team shares them.

./CLAUDE.local.md

Your personal notes for this repo. Gitignore it.

~/.claude/CLAUDE.md

Your preferences for every project.

Edit these any time with /memory. Claude Code also reads AGENTS.md, which new Next.js apps now generate. For how to keep this file lean and useful, see Context Engineering.

4Permission Modes: How Much Rope?

Permission modes

Permission Modes

Settings that control how much Claude Code can do without asking: `default` (shown as Manual, asks before edits and commands), `acceptEdits` (auto-approves file edits), `plan` (read-only planning), `auto` (Claude judges what's safe; the starting mode on Pro, Max, and Team plans), `dontAsk`, and `bypassPermissions` (no prompts at all; for sandboxes only). Shift+Tab cycles through the common ones.

"Like parental controls for AI. You choose how much freedom to give based on the task."

decide what Claude may do without asking. On Pro, Max, and Team plans, sessions start in auto mode. Press Shift+Tab to cycle modes; the current one shows in the status bar.

ModeWhat it means
defaultLabelled "Manual". Asks before edits and commands. Best while you're learning.
acceptEditsFile edits go through without prompts; other actions still ask.
planRead-only research and a written plan before any edits. See Plan Mode.
autoClaude proceeds on its own for most actions. The default on paid plans.
bypassPermissionsNo checks at all. Only inside a throwaway sandbox or container.

Beginner move: drop to Manual for your first few sessions and read what Claude asks to do. You'll learn more in a week of approving commands than a month of watching them fly by.

5The Commands That Matter

Type / in a session to see every slash command

Slash Commands

Commands you type in Claude Code starting with `/`: built-ins like /help, /clear, /compact, /context, /resume, /usage, and /init, plus your own. Custom commands have been merged into skills: `.claude/skills/deploy/SKILL.md` and the older `.claude/commands/deploy.md` both create `/deploy`.

"Like keyboard shortcuts, but for conversation. Type a quick command instead of explaining what you want."

. These are the ones you'll actually use:

/init

Scan the repo and write a starter CLAUDE.md (or suggest improvements to an existing one).

/memory

Open and edit your CLAUDE.md files, and view or toggle auto memory.

/compact

Summarize the conversation so far to free up context. Add focus text: /compact keep the test output

/context

Show how full your context window is, as a colored grid.

/clear

Start a fresh conversation. Do this between unrelated tasks.

/resume

Pick an earlier conversation to continue (or launch with claude --continue for the latest one).

/usage

Token usage and costs. /cost is an alias for the same thing.

/effort

Set how hard Claude thinks: low, medium, high, xhigh, max, or auto.

/mcp

See connected MCP servers, their status, and log in to ones that need OAuth.

/plugin

Browse, install, and manage plugins and marketplaces.

/ide

Connect the session to VS Code or a JetBrains IDE.

/doctor

Health check for your install and config when something feels off.

Keyboard shortcuts

Shift+TabCycle permission modes (watch the status bar)
EscStop Claude mid-action
Esc EscClear the input, or open rewind to jump back to an earlier point
Ctrl+OToggle the transcript viewer (full tool calls and details)
Ctrl+BSend a running task to the background
Option+P / Alt+PSwitch model

Context tip: every message, file read, and tool result fills the context window

Context Window

The amount of text an AI can 'see' at once, measured in tokens: your instructions, the conversation, files it read, and tool results. Current Claude models (Opus 5.5, Sonnet 5, Fable 5.1) offer 1M-token windows and Haiku 4.5 has 200K, but even huge windows work best when kept focused.

"Like short-term memory. The bigger the window, the more the AI can remember from your conversation."

. Use /clear between unrelated tasks and /compact (compaction

Compaction

Summarizing a long conversation so it takes up less of the context window while keeping the important parts. Claude Code compacts automatically as the window fills, or on demand with `/compact`, and you can steer it: `/compact keep the test output`. `/context` shows how full your window is.

"Like condensing a 40-page meeting transcript into a one-page brief so the next meeting can start with the essentials."

) when a long task gets heavy.

6Use It Inside Your Editor

The terminal version is the full-power one, but you can also see diffs and chat right inside your editor.

VS Code (and Cursor)

Install the anthropic.claude-code extension from the Extensions panel. It needs VS Code 1.94+, and it also installs in Cursor and other VS Code forks through Open VSX.

code --install-extension anthropic.claude-code

JetBrains IDEs

The JetBrains plugin runs the Claude Code CLI inside the IDE's terminal, so it works alongside IntelliJ, WebStorm, PyCharm and friends.

Running claude in a separate terminal? Type /ide to connect it to your open editor so it can see your current file and selection.

7Common Traps

"claude: command not found"

Close and reopen your terminal so it picks up the new PATH. Still missing? Run the installer again and read its output for PATH warnings, then run claude doctor.

Old npm install fighting the native one

If you used npm before, you can end up with two copies. Run claude doctor to spot install problems, and remove the copy you don't want (npm uninstall -g @anthropic-ai/claude-code for the npm one).

Permission errors with npm

Never fix them with sudo. Switch to the native installer instead.

"You don't have access"

The free claude.ai plan doesn't include Claude Code. You need Pro, Max, Team, Enterprise, or a Console account.

Launching from your home folder

Claude then sees your whole user directory. Always cd into the project first.

Installed? Now get good at it.

Learn the habits that separate "it kind of works" from "it ships", then plug Claude into your tools with MCP and plugins.