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." 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."
Official Docs
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)."
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 | bashWindows PowerShell
irm https://claude.ai/install.ps1 | iexWindows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdPrefer 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 waiting3First 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
claudeFirst 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
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."/init scans the repo and writes a starter CLAUDE.md
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."Shift+Tab to cycle modes; the current one shows in the status bar.
| Mode | What it means |
|---|---|
| default | Labelled "Manual". Asks before edits and commands. Best while you're learning. |
| acceptEdits | File edits go through without prompts; other actions still ask. |
| plan | Read-only research and a written plan before any edits. See Plan Mode. |
| auto | Claude proceeds on its own for most actions. The default on paid plans. |
| bypassPermissions | No 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 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."/ in a session to see every slash command
/initScan the repo and write a starter CLAUDE.md (or suggest improvements to an existing one).
/memoryOpen and edit your CLAUDE.md files, and view or toggle auto memory.
/compactSummarize the conversation so far to free up context. Add focus text: /compact keep the test output
/contextShow how full your context window is, as a colored grid.
/clearStart a fresh conversation. Do this between unrelated tasks.
/resumePick an earlier conversation to continue (or launch with claude --continue for the latest one).
/usageToken usage and costs. /cost is an alias for the same thing.
/effortSet how hard Claude thinks: low, medium, high, xhigh, max, or auto.
/mcpSee connected MCP servers, their status, and log in to ones that need OAuth.
/pluginBrowse, install, and manage plugins and marketplaces.
/ideConnect the session to VS Code or a JetBrains IDE.
/doctorHealth check for your install and config when something feels off.
Keyboard shortcuts
Shift+TabCycle permission modes (watch the status bar)EscStop Claude mid-actionEsc EscClear the input, or open rewind to jump back to an earlier pointCtrl+OToggle the transcript viewer (full tool calls and details)Ctrl+BSend a running task to the backgroundOption+P / Alt+PSwitch modelContext 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." 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."/clear between unrelated tasks and /compact (compaction
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.