# Setting Up Claude Code: Install to Multi-Session Setup

Published 2026-12-01. https://kanbanmcp.com/blog/setting-up-claude-code

# Setting Up Claude Code: Install to Multi-Session Setup

## Key takeaways

- Claude Code installs with one command (brew or npm) and authenticates via browser OAuth or an ANTHROPIC_API_KEY on headless machines.
- Keep CLAUDE.md short: build commands, test commands, and conventions only, since agents read it at session start.
- Commit CLAUDE.md and .claude/settings.json so teammates inherit permissions and MCP config on clone; gitignore local settings and secrets.
- Run one git worktree per parallel session and use a kanban board as the system of record so agents claim cards without colliding.
- Before your first commit, allowlist safe commands like tests and commits in permissions.allow and deny pushes and file deletion for unattended sessions.

Setting up Claude Code takes under an hour: install the CLI, authenticate, write a CLAUDE.md that works across parallel sessions, wire up MCP servers, and set permission allowlists before your first commit. This guide walks through each step, then covers the first-run failures that trip up developers running three or more agent sessions at once.

## What are the prerequisites for installing Claude Code?

You need four things: a supported OS (macOS 10.15+, Ubuntu 20.04+/Debian 10+, or Windows 10/11 with WSL), Node.js 18+ if you use the npm installer, an Anthropic account with a paid plan or API credits, and a terminal that handles ANSI colors and Git. The [Claude Code installation docs](https://docs.anthropic.com/en/docs/claude-code) list the exact commands per platform. Check `node --version` and `git --version` before you start. Once installed, wire up your workflow in our [Claude Code guide](https://kanbanmcp.com/agents/claude-code).

## How do you install and authenticate Claude Code on macOS, Linux, and Windows?

Install is a single command, then one login. The commands per OS:

| OS | Command |
|---|---|
| macOS | `brew install --cask claude-code` or `npm install -g @anthropic-ai/claude-code` |
| Linux | `npm install -g @anthropic-ai/claude-code` |
| Windows | Run the Linux command inside WSL2 |

### Installing on macOS and Linux

Homebrew is the cleanest path on macOS; npm works on both. Verify with `claude --version` in a fresh terminal. If npm installs globally but the binary isn't found, add npm's global bin directory to your PATH.

### Installing on Windows via WSL

There is no native Windows binary worth using. Install WSL2 (`wsl --install`), then follow the Linux steps inside Ubuntu. Run your repos from the WSL filesystem (`~/projects`), not `/mnt/c`, or file watching grinds. Git, worktrees and node all live inside WSL.

### Authenticating your account

Run `claude` in any project directory and it opens a browser login. Approve the OAuth request, pick your plan, and the token persists in `~/.claude`. Headless boxes can use an API key via `ANTHROPIC_API_KEY` instead. Once you're in, wire up parallel sessions on a shared board at [KanbanMCP](https://kanbanmcp.com/agents).

## How do you configure CLAUDE.md and project-level settings?

Claude Code reads configuration from two places: a `CLAUDE.md` file for instructions, and JSON settings files for permissions and environment. `CLAUDE.md` lives at the repo root (or in subdirectories), while settings sit in `.claude/settings.json` for the project and `~/.claude/settings.json` for your user account. Project settings take precedence over user settings.

### What goes in CLAUDE.md (and what doesn't)

Keep `CLAUDE.md` short: build commands, test commands, branch conventions, and anything an agent will get wrong without being told. Skip background, history, and aspirational notes. If a rule would not change what the agent does on its next task, it does not belong there. One developer running agents against a board of tasks put it well: anything beyond a spec plus a kanban board is documentation nobody revisits.

The same discipline applies to what stays out. Chat sessions are disposable working memory; the repo is the system of record. If your project only exists across agent chats, recovering context a week later means re-reading transcripts, reconstructing decisions from scattered prompts, and hoping nothing load-bearing lived only in a window you closed on Friday afternoon. Put the durable state in `CLAUDE.md`, the task state in a file or board agents can read, and let conversations die. A useful test: if a new session starting cold would need a fact to do its job, that fact belongs in a file the agent reads automatically, not in a chat you would have to summarize by hand. If you want a board agents claim cards from and leave handoff notes on, [KanbanMCP](https://kanbanmcp.com/agents/claude-desktop) wires into that same setup.

### Project settings vs user settings

Put anything you would want a teammate to inherit in `.claude/settings.json` and commit it: allowed commands, deny rules, env vars. Keep personal preferences, like model choice, in `~/.claude/settings.json`. Never commit secrets to the project file.

### Conventions for running multiple sessions in one repo

Give each session its own worktree and its own lane on your board, and require agents to claim a card before touching code. Add a line to `CLAUDE.md` telling agents to leave a handoff note on the card when done, so the next session picks up context without reading git diff in the morning.

## How do you connect MCP servers to Claude Code?

### Adding a server with claude mcp add

Use `claude mcp add <name> -- <command> [args]` to register a server, or `claude mcp add --transport sse <name> <url>` for remote ones. Claude Code reads the resulting config from `.mcp.json` in the repo or from your user-level config, depending on scope. Run `/mcp` inside a session to confirm the server loaded and its tools are listed.

### Project vs user scope

Add `--scope project` when every session in that repo needs the server, which is right for anything tied to the codebase. Use `--scope user` for personal tools you want across all projects. Project scope writes to `.mcp.json`, so it commits cleanly and teammates pick it up on pull.

### Example: connecting a kanban board for agent handoffs

For parallel sessions, wire a board so each agent can claim a card, do the work, and leave a handoff note for the next one. [KanbanMCP](https://kanbanmcp.com/agents/muse-code) exposes claim, update, and note tools over MCP, and you steer from the same board. Add it at project scope, then in each session prompt the agent to pull its next card before writing code. If a server fails to load, check the command runs standalone first, then re-run `/mcp` to see the error.

## Which permission and sandbox settings should you set before your first commit?

### Permission modes explained

Claude Code starts in its default mode, which asks before every command. That is right for a first session and wrong for your fourth parallel session. Before your first commit, decide which mode each session runs in: interactive prompting while you are watching, or an allowlist-driven setup for sessions you leave alone.

### Allowlisting commands in settings.json

Put your safe commands in `.claude/settings.json` under `permissions.allow`: things like `Bash(npm test:*)`, `Bash(git commit:*)`, and `Bash(git diff:*)`. Add anything destructive to `permissions.deny`, including `Bash(git push:*)` and force flags. Keep this file committed so every worktree and every teammate inherits the same rules.

### Defaults for unattended or parallel sessions

For sessions you will not watch, deny pushes and file deletion, allow tests and commits, and rely on human review of the git diff in the morning. If an agent picks up a card on a shared board, the handoff note should state which commands it was allowed to run. The same principle applies to other CLIs in your setup, as with [Qwen Code](https://kanbanmcp.com/agents/qwen-code).

## How do you onboard a team onto Claude Code with shared configuration?

Treat Claude Code config like any other code: commit what every teammate needs, gitignore what only you do. Commit `CLAUDE.md` (project conventions, test commands, lane rules), `.claude/settings.json` (approved permissions, hooks) and any shared MCP config. Gitignore `.claude/settings.local.json` and your personal notes, so individual overrides never leak into the repo.

Teammates inherit everything on clone: the CLAUDE.md is picked up automatically, and shared MCP servers are added once with `claude mcp add` using the project scope, per the [Anthropic MCP configuration docs](https://docs.anthropic.com/en/docs/claude-code/mcp). Personal extras go in a local settings file or a `claude mcp add --scope user` entry, which stays on that machine.

### What to commit and what to gitignore

If a teammate needs it to pass tests or claim a card, it belongs in the repo. API keys, absolute paths and personal tool preferences do not; use environment variables or the local settings file for those.

### A 30-minute onboarding checklist

1. Clone the repo, run `claude` and confirm the CLAUDE.md loads.
2. Run the shared `claude mcp add` commands from the README.
3. Copy the committed permission allowlist, then add personal overrides locally.
4. Run the test suite through the agent once to verify the setup end to end.

## How do you run several Claude Code sessions in parallel without chaos?

Three rules keep parallel sessions sane: one git worktree per session, one board as the system of record, and chats that stay disposable. Tasks live on the board, documents live in the repo, chat sessions hold nothing you would miss.

### Git worktrees per session

Give every agent session its own worktree off the main branch. Sessions never block each other on the same checkout, and a git diff in the morning shows exactly what each one did. Name worktrees after the task, not the agent.

### A board as the system of record

A board beats a backlog.md file once you pass two or three sessions: agents claim a card, work it, and move it on, so two sessions never pick up the same task. Home-made boards work; tools like [Vibe Kanban](https://github.com/BloopAI/vibe-kanban) or KanbanMCP give agents the same board through MCP, so the claim-and-move step happens in the session itself.

### Handoff notes between agents and tools

Each agent leaves a short handoff note on the card: what changed, what is untested, what the next session should check. Notes matter more than the tool, because sessions cross tools freely, and a project that only lives in chats is nearly impossible to recover a week later.

## What are the most common Claude Code setup errors and their fixes?

### Auth and login failures

If login loops or the CLI reports you're unauthenticated after signing in, run `claude /logout` then `claude /login` again, and check that `ANTHROPIC_API_KEY` isn't set in your shell, since a stale key overrides OAuth. On WSL, auth can fail because the browser opens on Windows while the token lands in the Linux filesystem; copy the callback URL manually into the WSL session.

### MCP server not loading

Run `claude mcp list` to see which servers registered. A server that shows as failed usually has a wrong command path or missing environment variables in its scope config. Check whether you added it at project, user, or local scope: a server added with `--scope local` won't appear in other checkouts of the same repo.

### Permissions prompting on every command

Add allow rules to `.claude/settings.json` so trusted commands run without prompts. The [Claude Code installation docs](https://docs.anthropic.com/en/docs/claude-code) cover allow/deny rule syntax and permission modes.

### CLAUDE.md changes not taking effect

Claude Code reads CLAUDE.md at session start, so edits mid-session don't apply. Start a new session, and confirm the file is in the project root or the directory you launched from, not a parent folder outside the repo.

## Which setup gives the best result for a solo dev with 3+ sessions?

The baseline: a CLAUDE.md with test and commit conventions, one worktree per session, and a kanban board as the system of record so chat sessions stay disposable. That board can be backlog.md, Vibe Kanban, or a home-made file setup — all three work.

Run your choice through the same criteria as any alternative: can an agent claim a card without stepping on another session, does it leave a handoff note the next agent reads, and can you review the git diff in the morning without digging through chats?

That third test is where a hosted board like KanbanMCP earns its keep: agents claim cards and leave notes on the board itself, so you watch and steer from one place. If your current setup already passes all three tests, keep it.

## FAQ

### Is Claude Code free to use?

No. The CLI itself is free, but you need an Anthropic account with a paid plan or API credits to run it. Authentication happens through a browser login that stores a token in ~/.claude, or via an ANTHROPIC_API_KEY on headless machines. Budget for the plan or usage-based billing before your first parallel session.

### Can I use Claude Code with my existing backlog.md or task files?

Yes. A file-based backlog works fine for one or two sessions. Past two or three parallel sessions, a board beats a static file because agents can claim a card and move it on, preventing two sessions from grabbing the same task. Tools like Vibe Kanban or KanbanMCP expose that claim-and-move flow over MCP.

### How do I reset Claude Code if it gets stuck after login?

Run claude /logout then claude /login again. Check that ANTHROPIC_API_KEY isn't set in your shell, because a stale key overrides OAuth and keeps you unauthenticated. On WSL, login can fail when the browser opens on Windows while the token lands in the Linux filesystem; copy the callback URL manually into the WSL session.

### Does Claude Code work on Windows without WSL?

Not usefully. Windows 10/11 is supported through WSL, and there is no native Windows binary worth using. Install WSL2 with wsl --install, then follow the Linux install steps inside Ubuntu. Keep your repos on the WSL filesystem, such as ~/projects, rather than /mnt/c, or file watching slows to a grind.

### How much context does Claude Code use per session and how do I keep costs down?

Context use scales with what you feed it, so keep CLAUDE.md short: build commands, test commands, and conventions only, no background or history. Give each session its own worktree so it reads a narrow diff. Leave handoff notes on cards instead of re-reading git history, and let chat sessions die once the work lands.
