💻 Setup Guide

Install Claude Code on a New Machine

Under 15 minutes from zero to working terminal, plus a reference for every slash command — ranked by how often you'll actually use it.

15
Minutes to install
29+
Slash commands
4
Platforms
6
Built-in skills
Why Bother

What You Get

Claude Code runs inside your terminal with direct access to your files, your shell, and your tools. No copy-paste between a browser tab and your editor.

Direct File Access

Read, edit, and create files without copy-paste. Run shell commands, git, tests, deploys — all in the same session.

📦

Persistent Memory

Per-project memory files capture your conventions, infrastructure, and preferences. Claude remembers them across sessions.

🔧

Custom Skills & Hooks

Build trigger-phrase skills for repeated workflows. Wire hooks into file edits, session events, or tool calls.

Before & After

What Changes

The shift from browser chat to a terminal-native agent that can actually do the work.

Browser-only Chat

Copy code out, paste code in. Re-explain your project every session. Cannot run commands, cannot read your files, cannot commit.

Limited

Claude Code in Terminal

Reads your repo, runs your tests, edits files in place, remembers your setup across sessions, and can publish a site end-to-end.

Native
Fresh Install

Zero to Working Terminal

Follow these seven steps on Mac, Windows 11, or Linux. Windows examples use PowerShell and Git Bash.

Install Node.js (LTS)

Claude Code ships as an npm package, so Node is a prerequisite. Use the long-term-support (LTS) version; avoid the "current" channel.

Windows (winget) winget install -e --id OpenJS.NodeJS.LTS
macOS (Homebrew) brew install node@20

Verify: node -v should print v20.x or newer.

Install Claude Code

One command, global npm install. It registers the claude binary on your PATH.

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

Then run claude from any directory. First launch walks you through login and picks a default model.

Log In

Two auth options. Subscription (claude.ai Pro/Max) uses your login. API keys are for pay-as-you-go or team accounts.

Inside Claude Code /login # subscription: OAuth browser flow /logout # sign out; then /login to switch accounts

Credentials land at ~/.claude/.credentials.json. Don't check that file into git.

Transfer Config From Your Other Machine

If you already have a Claude Code setup on another computer, bring the whole ~/.claude/ folder over. Settings, skills, commands, memory — it all lives there.

On old machine # Windows PowerShell Compress-Archive -Path $env:USERPROFILE\.claude -DestinationPath ` "$env:USERPROFILE\Downloads\claude-config-$(Get-Date -Format 'yyyyMMdd-HHmm').zip"

Upload the zip to Google Drive (or any cloud). On the new machine, download it and extract into your home directory. Skip .credentials.json and .claude.json if you already logged in on the new box — those are machine-specific.

On new machine # What to KEEP from the zip: CLAUDE.md # global instructions settings.json # hooks, permissions, env settings.local.json # project-specific permissions skills/ # custom trigger-phrase skills projects/*/memory/ # your memory files # What to SKIP: .credentials.json # auth tokens (machine-specific) .claude.json # runtime state (machine-specific) sessions/ # old session recordings cache/ # regenerates automatically

Install Supporting Tools

Claude is most useful when it can drive your actual toolchain. Install the ones you already use elsewhere.

Windows (winget) winget install -e --id Git.Git winget install -e --id GitHub.cli winget install -e --id Rclone.Rclone winget install -e --id Python.Python.3.12

Then authenticate them: gh auth login -h github.com -p https -w (browser flow, needs a real terminal window) and rclone config for any remotes you want to sync.

Configure Permissions & Hooks

Claude Code asks for permission before running shell commands by default. You can pre-approve safe ones so it doesn't pause every time.

~/.claude/settings.json (example) { "permissions": { "allow": [ "Bash(git status)", "Bash(git diff:*)", "Bash(ls:*)", "Read(**)" ] }, "hooks": { "PostToolUse": [{ "matcher": "Edit|Write", "hooks": [{ "type": "command", "command": "python -m py_compile ${file_path}" }] }] } }

Or use the interactive commands: /permissions to edit the allowlist and /hooks to manage hooks. The slash-command approach is safer if you're new — less chance of syntax mistakes.

Bootstrap Your First Project

Navigate to a project directory and run /init. Claude reads your code, writes a CLAUDE.md documenting the architecture, and that document is auto-loaded every future session.

Terminal cd ~/projects/my-repo claude # launch Claude Code /init # generates CLAUDE.md from your codebase

After /init, add project-specific conventions to the generated file — naming rules, deploy commands, gotchas, etc. Future sessions will know all of it.

Command Reference

Every Slash Command, Tiered

Grouped by how often you'll reach for them in a real week of work. Start by mastering Tier 1, pick up Tier 2 as situations come up, and touch Tier 3 only when configuring a new machine.

Tier 1 — Every Session, Often Multiple Times

These six pay off daily. Keep them at your fingertips.

Session end

/session-close

A custom skill (you build it once). Trigger phrases like "save" or "commit" kick off a checklist: inventory work, push to your server, verify live, update memory. Stops sessions from ending with un-pushed files.

Every task

/clear

Wipes the conversation context so the next topic starts clean. Use it between unrelated tasks to keep Claude focused and responses fast.

Long sessions

/compact

Summarizes the conversation and trims old context. Use when a session is still productive but the window is getting full. Prefer /clear between tasks, /compact when you want to keep going.

Overnight

/loop

Run a prompt or slash command on a recurring interval (e.g. /loop 5m /check-deploys). Leave Claude running to poll status or repeat a task while you're away.

Speed mode

/fast

Switches to Opus 4.6 with faster token output. Same model family, better latency for iterative work. Toggle off when you want Opus 4.7's deeper reasoning on a hard problem.

Memory edits

/memory

Opens your MEMORY.md index and memory files for inspection or edit. Add a new rule, update a stale fact, remove noise. Claude reads memory every session, so what's here shapes behavior.

Tier 2 — Weekly or Situational

Twelve commands you'll want within reach but not every session. Know what they do so you pull the right one under pressure.

Recurring

/schedule

Creates remote agents on a cron schedule. "Every weekday at 7 AM, summarize overnight commits and email me" — that's a schedule routine. Survives reboots; runs in the cloud.

Pre-publish

/security-review

Audits pending changes on your current branch for secrets, injection vectors, and common OWASP issues. Run before pushing anything public-facing.

Post-edit

/simplify

Reviews recent changes for duplication, premature abstraction, and dead paths. Good quality gate right before you commit.

Tune once

/fewer-permission-prompts

Scans recent transcripts for read-only commands you keep approving, then proposes an allowlist for .claude/settings.json. Massive friction cut.

Billing check

/cost

Current usage and costs for your account. Worth a glance after long autonomous sessions or heavy tool use.

Automation

/hooks

Manages hooks (shell commands triggered by events: file edits, session start, stop). This is how you make "every time Claude edits a .py file, run py_compile" happen without asking each time.

Delegation

/agents

Lists and edits subagents — Explore, Plan, general-purpose — and any custom agents you've defined. Subagents let Claude parallelize work without blowing the main context.

Integrations

/mcp

Manage MCP servers: Gmail, Calendar, Drive, Slack, GitHub, Linear, and custom ones. Adds tools for non-filesystem work right into your session.

Recovery

/resume

Picks up a previous session by ID. Useful when you closed a session intending to come back later, or after a crash.

New designs

/frontend-design

A built-in plugin for site/theme design work. Generates layouts, refines color systems, explores component structures. Good starting point for a fresh landing page.

SDK work

/claude-api

Helps when you're writing code that calls the Claude API directly (not the CLI). Handles prompt caching, tool use, batch, files, citations, memory — all the SDK features.

PR flow

/review

Reviews a pull request — yours or someone else's. Looks for correctness, regressions, style issues. Pair with /security-review for public-facing PRs.

Tier 3 — Set Up Once, Tune Rarely

Machine setup, personalization, diagnostics. Touch these when you first install or when something breaks.

Bootstrap

/init

Reads your project and writes a CLAUDE.md documenting architecture, conventions, key files. Run once per new repo.

Settings

/update-config

Interactive editor for settings.json. Safer than hand-editing — it validates.

Trust

/permissions

Allowlist editor. Add/remove the exact bash patterns and tool matchers Claude can run without asking.

Personalize

/statusline

Customize the status line at the bottom of the terminal. Show git branch, token count, cost, whatever.

Shortcuts

/keybindings-help

Documents current key bindings and helps rebind them. Edit ~/.claude/keybindings.json for chord-style shortcuts.

Theme

/config

Theme + default model quick-edit. Dark/light, Opus vs Sonnet vs Haiku.

Model switch

/model

Switch models mid-session without restarting. Useful when a task needs Opus 4.7's reasoning depth then drops back to Sonnet for execution.

Diagnose

/doctor

Runs a health check: versions, config, connectivity, MCP status. First stop when something is misbehaving.

Terminal

/terminal-setup

One-time terminal tuning — ANSI support, font, notifications. Run once after install.

Feedback

/bug

Files a bug report against Claude Code with your current context. Use when something is genuinely broken, not for feature requests.

Editing

/vim

Toggles vim-mode input. If you live in vim, turn it on and never look back.

Custom Skills

Trigger-Phrase Workflows

Skills are reusable instructions Claude loads when you say a trigger phrase. Built-in skills handle common tasks; custom skills capture your workflows.

Where They Live

Each skill is a folder under ~/.claude/skills/ with a single SKILL.md. The frontmatter has a name, description, and — critically — the trigger phrases.

~/.claude/skills/session-close/SKILL.md --- name: session-close description: End-of-session checkpoint. Triggers when user says "save", "commit", "push everything", "back this up". Runs a 9-step checklist: inventory work, scan for secrets, push to server, verify live, update memory, surface action items. --- # Your session-close ## The checklist 1. Inventory uncommitted work 2. Update session-state memory files 3. Security scan (SSH keys, API tokens, credentials) 4. Push to server (scp) 5. Backup to cloud (rclone) 6. Mirror memory files 7. Verify live (curl) 8. Update MEMORY.md index 9. Report: done / waiting / next move

Once that file exists, say any trigger phrase in any session and Claude loads the skill automatically. You never type /session-close — you just say "save" and the checklist runs.

Built-In Skills (Ship With Claude Code)

simplify

Reviews changed code for reuse, quality, efficiency; then fixes what it finds.

security-review

Scans pending changes on the current branch for security issues.

init

Generates a CLAUDE.md for a new codebase.

update-config

Edits settings.json safely, handles hooks/permissions/env.

schedule

Creates and manages cron-scheduled remote agents.

fewer-permission-prompts

Learns from your transcript which commands to pre-allow.

The Extras

Memory & Hooks

Two systems that make Claude Code feel like it remembers you.

Memory

Per-project memory lives at ~/.claude/projects/<project-path>/memory/. The MEMORY.md file is an index; each entry points to a Markdown file with the full content. Claude reads MEMORY.md every session.

Four types: user (who you are), feedback (what to do/not do), project (what's going on), reference (where to look for things).

Hooks

Hooks are shell commands the harness runs at events — PreToolUse, PostToolUse, SessionStart, Stop, UserPromptSubmit, and more. They execute outside Claude's context, so they're deterministic automation.

Hook example: py_compile every edit { "hooks": { "PostToolUse": [{ "matcher": "Edit|Write", "hooks": [{ "type": "command", "shell": "bash", "command": "python -c \"import json,sys,subprocess; p=(json.load(sys.stdin).get('tool_input') or {}).get('file_path',''); sys.exit(0) if not p.endswith('.py') else sys.exit(subprocess.call([sys.executable,'-m','py_compile',p]))\"" }] }] } }

Hooks receive tool input as JSON on stdin. Exit non-zero to block the action; zero to let it proceed. This is how you enforce "from now on when X, do Y" — memory can't do that; only hooks can.

When Things Break

Gotchas

😀

PATH not updated after winget

New terminal windows pick up PATH changes; existing ones don't. If rclone or gh isn't found after install, open a fresh shell.

🚨

gh auth login hangs in Claude Code

The device-code flow needs a real terminal. Run gh auth login -h github.com -p https -w in PowerShell or cmd directly, not via the ! prefix.

🔧

UNC paths break git

If your repos live on an SMB share (\\server\share\...), git's safe.directory check blocks operations. Fix: git config --global --add safe.directory '*'.

Popup windows from Scheduled Tasks

PowerShell-based Scheduled Tasks flash a console window. Fix: launch via a VBS wrapper with window style 0 (same pattern as python.exepythonw.exe).

🔍

Memory changes not picked up

MEMORY.md is loaded at session start. Edit mid-session? Run /clear or /compact (or just start a new session) so the reload fires.

📁

Giant first-time rclone sync

First sync of a large remote (e.g. whole Google Drive) spends a long time listing before any bytes transfer. Tail the log; 100k+ items is normal and expected.

Install Claude Code

Fifteen minutes to the working terminal. The rest is muscle memory.

Official Docs Back to AI Wayback Guide