How to Set Up Claude Code (Install, Permissions, Config)
From zero to a production-ready Claude Code 2.1.231 setup: verified install, auth, permission modes, CLAUDE.md, MCP, and the security settings that keep an agent from running wild.
Note
Before you start
- macOS, Linux, or Windows (WSL2) with Node 18+
- A Claude account - the free tier is enough to set up and test permission modes
- A terminal and a project folder you are willing to let the agent touch
Jump to section
- 1
Verify the install
Run the one-line installer, then `claude --version`. It should print 2.1.231 or newer. Keep Node 18+ current - the CLI relies on it.
- 2
Authenticate
`claude` in your project folder, type /login, and finish in the browser. Enterprise SSO users should run /login with the organization-first URL from their admin.
- 3
Turn on plan mode for the first hour
Hold Shift+Tab to cycle modes: plan, default, auto-accept edits, bypass permissions. Start in plan mode and read what it proposes before letting it write anything.
- 4
Write a CLAUDE.md
`claude /init` generates one from your repo. Add the non-obvious rules: build command, test command, files never to touch, destructive-action protocol.
- 5
Add your tools
`claude mcp add <name> <command>` wires MCP servers (filesystem, search, databases). Add only the connectivity the work actually needs.
- 6
Check the health
`claude doctor` verifies auth, version, and model flags. Re-run it after any upgrade or machine change.
Claude Code in August 2026 is a one-line install, but a production setup is a deliberate config: permission modes, a CLAUDE.md contract, MCP tools, and a billing surface you understand before the agent autopilots through your repo. This guide covers all four, verified against the official quickstart and changelog (current version: 2.1.231).
It is the top agent harness for a reason
Our coding-agents comparison places Claude Code atop developer-preference leaderboards through 2026 - and shows exactly where Copilot Agent and Cursor make noise. Setup discipline is where the lead is squandered, so do this part right.
Step 1: Verify the install
curl -fsSL https://claude.ai/install.sh | bash
claude --version # expect 2.1.231 or newer
The official installer is the supported path (native installers exist for each OS; npm is the fallback for existing Node setups). Keep Node 18+ current - troubleshooting documents pin most install failures to stale Node or PATH, both caught by claude doctor in step 6.
Step 2: Authenticate
Run claude from your project folder and type /login. A browser completes OAuth, with MFA where your account enforces it. Enterprise users log in via SSO through their organization’s URL - the Compliance API we covered earlier now captures these sessions for audit, so treat the account as the security boundary it is.
Step 3: Pick permission modes consciously
Shift+Tab cycles the four modes:
| Mode | What it can do | Use it for |
|---|---|---|
| Plan | Proposes, writes nothing | First hour with any repo; design work |
| Default | Asks before every file edit and command | Day-to-day, most projects |
| Accept edits | Auto-accepts file edits, still asks for commands | Repos you trust and lint heavily |
| Bypass | Asks nothing - full autonomy | Vetted, sandboxed runs only |
Bypass mode is the YOLO button
It exists with a deliberate name because unsupervised agents on a bare host is the exact failure mode Sandboxes were built to contain. If you use it, use it inside an isolated environment - never on a machine holding keys.
Step 4: Write the CLAUDE.md contract
Run /init - it scans the repo and generates a base file. Then add the non-obvious rules yourself: the build command, the test command, files never to touch (.env, keys/, deploy dirs), and the destructiveness protocol (never delete, never git push --force, confirm before any network effect). This file is the agent’s constitution; rewrite it when it starts causing harm, not when it causes friction.
Step 5: Wire the tools you actually need
claude mcp add <name> <command> # e.g. filesystem, search, db
MCP servers extend the agent’s reach; each one is a new input surface for prompt injection. Add connectivity per-project, not globally - the principle from our agent guide applies to harness tools as much as custom ones.
Step 6: Verify and put it under budget
claude doctor checks auth, version, and model flags - run it after installs and upgrades. Then confirm the billing surface: Pro at $20/mo for light work, Max at $100/mo for all-day agentic sessions, enterprise seats for teams that need the compliance rails. An agent you never let near bypass mode costs what the plan says; one that autopilots eats your limit before lunch.
When you’re done
You have a verified CLI, disciplined permission modes, a CLAUDE.md contract, and a defined budget. For the sandboxed-autonomy tier, Docker’s Sandboxes support Claude Code day zero - and for the enterprise audit trail, the Compliance API now covers these sessions end to end.
Questions, answered first
Is the install really one line?
Yes: `curl -fsSL https://claude.ai/install.sh | bash` on macOS/Linux (the official installer; there's also an npm path and a native installer for each OS). What the one-liner does not tell you: verify with `claude doctor`, and keep Node 18+ current, since the CLI depends on it.
What do the permission modes actually mean?
Four levels, cycled with Shift+Tab: plan mode (proposes, writes nothing), default (asks before each file edit), accept edits (auto-accepts file edits, still asks for commands), and bypass permissions (asks nothing - the YOLO mode). Only the last one skips human gates entirely, and it exists for vetted, sandboxed runs.
How do I stop Claude Code from touching my secrets?
Two layers: CLAUDE.md rules (files never to touch, e.g. .env, keys/) and .claude/settings.json with explicit deny rules at the workspace level. Treat the model's own output as untrusted: never paste credentials into a session, and keep the session outside directories the agent can freely write.
Which subscription do I need?
Everything beyond setup runs on usage: Pro ($20/mo) covers casual and light work in 2026 pricing; Max ($100/mo) adds higher limits for all-day agentic sessions; enterprises negotiate seat pricing plus the visibility and compliance rails we covered in the Compliance API article.
Is there a safe place to let Claude Code run unsupervised?
Yes - Docker Sandboxes (disposable microVMs built for coding agents) support Claude Code day zero, with filesystem and network controls worth reading before you trust any harness with bypass permissions enabled.
You did it
- `claude --version` prints 2.1.231 or newer
- `claude doctor` reports no errors
- You ran one session in plan mode and saw the proposed diff before approval
- You have a CLAUDE.md with the build command, test command, and no-touch files
- You know which permission mode each of your projects runs in, and why
- You confirmed the billing surface: Pro ($20/mo) vs Max ($100/mo) vs enterprise seats