Claude Code Getting Started: Installation, First Run, and the 5 Commands You’ll Use Daily

Claude Code getting started guide — Tygart Media

About Will

I run a multi-site content operation on Claude and Notion with autonomous agents — and I write about what we do, including what breaks.

Connect on LinkedIn →

Claude Code is Anthropic’s official CLI for Claude — a terminal-based agent you can point at any codebase and have it read, write, test, and ship code. It’s different from the Claude.ai chat interface in one key way: Claude Code can act, not just answer. It reads your actual files, runs your actual commands, and makes changes that stick.

This guide walks you through installation, first run, and the commands that cover 90% of what you’ll do daily.

What Claude Code Is (and Isn’t)

Claude Code runs in your terminal. It gives Claude access to your local machine — file system, shell, and any MCP servers you configure — so it can do real engineering work: implement features, fix bugs, write tests, explain unfamiliar codebases, and run multi-step agentic workflows.

It is not a code autocomplete plugin (that’s what GitHub Copilot does). Claude Code is a conversational agent that works at the task level, not the token level. You describe what you want; it figures out the steps and executes them.

Installation

Claude Code requires Node.js 18 or later. Install via npm:

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

Verify the install:

claude --version

That’s the only dependency. Claude Code is a Node.js CLI — no Docker, no Python env, no platform-specific setup beyond Node.

First-Run Authentication

The first time you run claude, it walks you through authentication. You have two options:

Option 1: Claude subscription (Pro, Max, Team, Enterprise)
Run claude, select “Login with Claude.ai,” and it opens a browser window to authorize. Your subscription covers Claude Code usage — no separate API billing.

Option 2: Anthropic API key
Set your API key as an environment variable before running:

export ANTHROPIC_API_KEY="sk-ant-..."
claude

Or on Windows:

$env:ANTHROPIC_API_KEY = "sk-ant-..."
claude

API key usage is billed per token at standard API rates. For heavy daily use, a Max subscription ($100–$200/month) is usually more economical than API billing.

Your First Session

Navigate to a project directory and start Claude Code:

cd ~/projects/my-app
claude

Claude Code reads your directory automatically. At the > prompt, describe what you want:

> What does this codebase do? Give me a 3-paragraph overview.

Claude reads the files it needs and responds. No configuration required for basic usage — Claude Code infers context from the directory you’re in.

The 5 Commands You’ll Use Daily

1. claude — Start an interactive session

claude

Launches the REPL (read-eval-print loop). This is where you spend most of your time. Claude has access to your current directory’s files, can run bash commands, and can call any MCP servers you’ve configured.

Within a session, you can:

  • Ask questions about the codebase
  • Request implementations (“add a rate limiter to the auth middleware”)
  • Have Claude run tests and fix failures
  • Use /help to see available slash commands
  • Use /clear to reset context without leaving the session
  • Press Escape twice to interrupt a running task

2. claude -p "prompt" — One-shot non-interactive mode

claude -p "What are all the API endpoints in this codebase?"

Runs a single prompt and exits. No REPL. Good for scripting, CI pipelines, or quick one-off queries you don’t want to interrupt a workflow for. Output goes to stdout — pipe it wherever you need it.

claude -p "Summarize the changes in the last 10 commits" | pbcopy

3. claude mcp add — Connect an external tool

claude mcp add github -- npx -y @modelcontextprotocol/server-github

Adds an MCP server to your Claude Code configuration. After running this, Claude can call the server’s tools in any session. Common additions:

# File system access (scoped to a directory)
claude mcp add files -- npx -y @modelcontextprotocol/server-filesystem ~/Documents

# GitHub integration
claude mcp add github -- npx -y @modelcontextprotocol/server-github

# Web search
claude mcp add search -- npx -y @modelcontextprotocol/server-brave-search

The GitHub and Brave Search servers need API tokens — set them as environment variables before the server starts, or pass them via the --env flag in the mcp add command.

4. claude -c — Continue the last conversation

claude -c

Resumes your most recent Claude Code conversation, including all prior context. Essential for multi-session work on a feature. If you closed the terminal mid-task, claude -c picks up exactly where you left off.

For a specific prior conversation:

claude --resume SESSION_ID

5. claude --model — Select the model for a session

claude --model claude-opus-4-8

Claude Code defaults to the most capable available model for your plan. You can override this per session. Current options:

  • claude-fable-5 — Highest capability, complex tasks (2x cost vs Opus 4.8)
  • claude-opus-4-8 — Default for most work, strong balance of quality and speed
  • claude-sonnet-4-6 — Faster responses, good for routine tasks
  • claude-haiku-4-5-20251001 — Fastest, lowest cost, short tasks

Slash Commands Inside a Session

While in a Claude Code session (> prompt), these slash commands are available:

Command What It Does
/help Show all available commands
/clear Clear conversation context (keep the session open)
/compact Compress prior context to save tokens while preserving essential memory
/cost Show token usage and estimated cost for the current session
/model Switch the model mid-session
/review Request a multi-agent code review of the current branch
/init Generate a CLAUDE.md file with project context for this repo
/exit End the session

CLAUDE.md — Project-Level Context

Drop a CLAUDE.md file in your project root and Claude Code reads it automatically at session start. Use it to encode project-specific context Claude shouldn’t have to re-derive every session:

# My Project

## Architecture
- Backend: FastAPI + PostgreSQL
- Frontend: React + TypeScript
- Deployed to: AWS ECS

## Development
- Tests: `pytest tests/`
- Local server: `./scripts/start-dev.sh`
- Database migrations: `alembic upgrade head`

## Rules
- Never modify migration files directly
- All API routes go in `src/routes/`
- Use `httpx` not `requests` for HTTP calls

Generate a starter CLAUDE.md for an existing project with /init.

Permission Modes

Claude Code asks for confirmation before running bash commands, creating files, or making other changes — unless you grant it broader permissions. There are three ways to control this:

  • Default: Claude asks before each tool use that modifies files or runs commands
  • --dangerously-skip-permissions: Skip all confirmations. Use only in isolated environments (Docker containers, CI). Not for everyday use on your primary machine.
  • Session-level allowlist: During a session, you can approve individual tools for the rest of the session by selecting “Allow always” when prompted

For most work, the default confirmation behavior is the right trade-off — it keeps you in the loop on changes without requiring you to pre-define a permission policy.

IDE Integration

Claude Code integrates with VS Code and JetBrains IDEs. Install the extension from each marketplace, then launch Claude Code from inside the IDE. This keeps the terminal panel visible alongside your editor without alt-tabbing between windows.

The IDE extensions also add shortcuts for common actions like opening Claude Code in the current file’s directory and running one-shot queries against the selected code.

Frequently Asked Questions

What’s the difference between Claude Code and Claude.ai?
Claude.ai is the web chat interface — good for questions, document analysis, and writing. Claude Code is a terminal CLI that can access your local files, run commands, and act autonomously on multi-step tasks. Claude.ai can’t modify files on your machine; Claude Code can.

Does Claude Code cost extra on top of my Claude subscription?
No. Claude Pro, Max, Team, and Enterprise subscriptions include Claude Code access. You use the same account. Heavy agentic usage counts toward the plan’s usage limits, but there’s no separate Claude Code fee.

Can Claude Code access the internet?
Not by default. Claude Code’s built-in WebFetch tool can fetch content from a specific URL when you provide it. For live web search, add the Brave Search or similar MCP server. Claude can’t browse freely without explicit tool access.

What does Claude Code do with my code?
Claude Code sends the file contents and context it needs to the Anthropic API for inference. Standard Anthropic API data policies apply — if you’re using an API key, you can configure zero data retention. If you’re using a subscription, default Anthropic retention policies apply. Review Anthropic’s privacy policy for current details.

Is Claude Code open source?
Claude Code itself (the CLI client) is not open source — it’s an Anthropic product. The MCP server ecosystem it connects to includes many open-source servers, and the MCP specification itself is open.

What version of Node.js do I need?
Node.js 18 or later. Run node --version to check. The Long-Term Support (LTS) version is always a safe choice.

Last verified: June 12, 2026. Claude Code is updated frequently — run npm update -g @anthropic-ai/claude-code to stay current.

Track the AI tools you actually use
Live, vendor-neutral prices & limits for ChatGPT, Claude, Gemini, Perplexity and more — and we’ll email you the moment your tools change price or limits. Free, no hype.
See the live AI tracker →or set up your alerts

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *