Claude Code · September 2026

How to run Claude Code

Install it, sign in, give it a first job, and learn the loop — every command checked against the current docs, and an honest note on where it stops.

What you need before you start.

Claude Code runs on macOS 13 or later, Windows 10 (1809) or Windows Server 2019 or later, and Ubuntu 20.04, Debian 10, or Alpine 3.19 and up, on x64 or ARM64 with 4 GB of RAM or more. It needs an internet connection, a shell (Bash, Zsh, PowerShell, or CMD), and an account in a supported country. The requirements in full are in the setup docs.

You also need an account it can bill to. Claude Pro, Max, Team, and Enterprise all include Claude Code; the free claude.ai plan does not. The alternatives are a Claude Console account, which is pay-per-token API access, or a cloud provider — Amazon Bedrock, Google Cloud, or Microsoft Foundry — if your organization runs one. Node.js is not required for the recommended installer.

The setup, in order.

  1. 01Install it

    The native installer is the recommended route on macOS, Linux, and WSL, and it keeps itself updated in the background. Homebrew and WinGet work too but do not auto-update; brew upgrade claude-code and winget upgrade Anthropic.ClaudeCode do that by hand. The npm package (npm install -g @anthropic-ai/claude-code, Node 22 or later) installs the same native binary. On Windows PowerShell the command is irm https://claude.ai/install.ps1 | iex.

    curl -fsSL https://claude.ai/install.sh | bash # or, on macOS with Homebrew brew install --cask claude-code
    macOS, Linux, WSL
  2. 02Check it landed

    claude --version prints a version followed by (Claude Code). If the shell says command not found, the installer put its launcher in ~/.local/bin and that directory is not on your PATH yet; open a new terminal or add it. claude doctor runs a read-only diagnostic of the install and your settings files without starting a session.

    claude --version claude doctor
  3. 03Sign in

    Run claude in any directory. On first launch it opens a browser to sign in; pick your Claude.ai account for Pro, Max, Team, or Enterprise, or the Console for API billing. If the browser cannot reach the terminal’s local callback — common over SSH, in WSL2, and in containers — it shows a code to paste back. If ANTHROPIC_API_KEY is set in your environment, Claude Code skips the browser and asks you to approve the key instead. /login inside a session switches accounts; /logout signs out.

    claude
  4. 04Start in a project

    Sessions are tied to the directory you start them in. Change into the repository and run claude. The prompt shows the version, the model, and the working directory. Type /help to list commands.

    cd /path/to/your/project claude
  5. 05Ask before you act

    The first useful prompt is a question. Claude Code reads files as it needs them; you do not paste anything in. From there, ask for a change — it finds the file, shows the edit, and asks for a yes if the current mode requires one.

    what does this project do? where is the main entry point? add a hello world function to the main file
    First prompts, from the quickstart
  6. 06Learn the permission loop

    Every action falls under a permission mode. Manual asks before edits, commands, and network access; accept-edits approves file edits and common filesystem commands; plan reads the codebase and proposes without changing anything; auto lets a second model review actions instead of you. On Pro, Max, and Team plans a terminal session starts in auto mode; elsewhere it starts in Manual. Shift+Tab cycles modes mid-session, /plan starts one prompt in plan mode, and the flag below starts a whole session there. The full set, including dontAsk and bypassPermissions, is under permission modes.

    claude --permission-mode plan
  7. 07Give it standing instructions

    /init reads the repository and writes a starting CLAUDE.md — build commands, test commands, conventions it can see; if one exists it suggests improvements instead. Claude Code loads that file at the start of every session, along with ~/.claude/CLAUDE.md for personal preferences and a gitignored CLAUDE.local.md for private notes. Keep it under about 200 lines and concrete: “run npm test before committing” works, “test your changes” does not. /memory opens the files; /context shows what actually loaded.

    /init
  8. 08Pick up where you left off

    Sessions are saved continuously to ~/.claude/projects/ on the machine. claude --continue reopens the most recent one in the current directory; claude --resume opens a picker; claude --resume <name> goes straight to a session you named with /rename or started with claude -n <name>. Inside a session, /resume switches conversations and /clear starts a fresh one without losing the old. For one-off questions from a script, claude -p prints an answer and exits.

    claude --continue claude --resume auth-refactor cat error.log | claude -p "explain this failure"

The commands that matter on day one.

CommandWhat it does
/helpList available commands and skills
/clearStart a new conversation with empty context; the old one stays resumable
/compactSummarize the conversation so far to free up context
/modelSwitch model and save it as your default
/permissionsManage allow, ask, and deny rules
/configOpen settings: theme, model, editor mode, and more
/statusShow session status, login method, and which settings files loaded
/usageShow token usage and cost for the session; /cost is an alias
/exitLeave; Ctrl+D twice does the same
EscInterrupt Claude mid-turn without losing what it has done

The complete list, with flags and shortcuts, is at /claude-code-commands.

It runs where you started it.

Here is the part the quickstart does not dwell on. An interactive Claude Code session is a process in the terminal that launched it. Close the terminal, let the laptop sleep on the train, drop the SSH connection, and the process is gone. The transcript survives — claude --continue will bring the conversation back — but whatever was running stops, and nothing happens while you are away.

Anthropic’s answers to this are real and worth knowing. Remote Control (/remote-control) lets you follow a local session from your phone or another browser while the terminal stays up. Background agents (claude --bg, /background) hand a session to a per-user supervisor process that outlives your shell. Claude Code on the web runs the whole thing in Anthropic’s cloud against a repository you connect. And the oldest answer, tmux, still works: start claude inside a tmux session and reattach later.

Every one of those still needs a machine that stays on and a way to reach it — and the tmux route needs you to remember it before the run that matters. That is where spawnd sits: one daemon on each host you own, dialing out so nothing listens; every session’s terminal owned by a worker process on the host, so it survives the closed tab, the dropped connection, and the laptop lid with scrollback intact; any browser or phone as the console. Claude Code authenticates on the host exactly as it does today — spawnd holds no provider credentials and uses your Pro or Max plan as the CLI uses it. The longer version is at /claude-code-remote; what “background agent” means across these products, and whose machine each one runs on, is at /background-agents.

Start

Start it once, on a machine that stays on.

$curl -fsSL https://spawnd.dev/install.sh | sh
Sign up free
Install the daemon

Questions

Do I need Node.js to run Claude Code?
Not with the native installer, Homebrew, WinGet, or the Linux package repositories. Only the npm route asks for Node.js 22 or later, and even then the package installs a native binary that does not use Node at runtime.
Can I use Claude Code on the free plan?
No. The free claude.ai plan does not include Claude Code. Pro, Max, Team, and Enterprise do; a Console account with API credits or a cloud provider account works too.
What happens to a session when I close the terminal?
The interactive process ends and any running command stops. The transcript is saved on that machine, so claude --continue resumes the conversation. To keep a session alive while you are away it needs a host that stays on: tmux, Anthropic’s background agents, or spawnd, which owns each session in a worker process on the host.