Install Claude Code, run your first session, and go from zero to productive in under 15 minutes. Everything you need to know as a first-time user.
Claude Code is Anthropic's official AI coding assistant that runs in your terminal. Unlike AI tools embedded in an editor (Cursor, GitHub Copilot, Windsurf), Claude Code is an autonomous agent — it can read your files, run commands, write multi-file edits, run tests, and reason about your entire project in one conversation.
The key insight for beginners: you don't paste code into a chat window. Claude Code reads your actual files directly. You just describe what you want, and Claude does the work.
CLAUDE.md), the better the output.
You need Node.js 18 or later and an Anthropic account.
# Check your Node version
node --version # must be v18.0.0 or higher
# If not installed: https://nodejs.org (LTS version)
npm install -g @anthropic-ai/claude-code
This adds the claude command to your terminal path globally.
# Run claude in any directory to trigger login
claude
Claude Code will open a browser window to authenticate. Use your Anthropic Console account. After authenticating, the session is saved and you won't need to log in again.
Alternative: Set ANTHROPIC_API_KEY as an environment variable if you prefer API key auth.
claude --version
# claude-code/1.x.x linux-x64 node-v22.x.x
sudo npm install -g @anthropic-ai/claude-code or configure npm's global prefix to a user-writable path.
Navigate to a real project directory (not an empty folder). Claude Code is most useful when it can read actual code.
cd ~/my-project
claude
You'll see an interactive prompt: >. Claude has already indexed your directory and is ready.
> What does this project do? Give me a brief summary of the main files.
Claude will read your files and summarize. This is a good "sanity check" to confirm it can access your code.
> /plan Add a function to utils.js that formats a phone number as (XXX) XXX-XXXX
The /plan command makes Claude describe its approach before writing any code. Review the plan, then say "go ahead" or refine it. This is the most important habit for beginners — always plan before a big change.
After Claude writes code, check the diff with:
git diff
Always review before committing. Claude is excellent but occasionally makes logic errors or misunderstands scope — a 30-second diff review prevents most surprises.
> Write a conventional commit message for these changes
# Then in your terminal:
git add utils.js
git commit -m "feat(utils): add formatPhoneNumber helper"
# Exit Claude Code
> /exit (or Ctrl+C)
git reset --hard HEAD to the last good state.
Claude Code has slash commands that control its behaviour. These are the ones you'll use every day:
/plan <task>
Ask Claude to describe its approach before writing any code. Use this before every substantial change. The plan is a proposal — you review and approve before execution begins.
/compact
Compress the conversation history when the context gets long. Preserves key decisions and constraints. Use when Claude's responses start getting slow or repetitive.
/clear
Start a fresh conversation without closing the session. Useful when switching to a completely different task mid-session.
/help
List all available slash commands and built-in skills. Run this in any session to see what's available.
/memory
View and edit Claude's persistent memory (CLAUDE.md files). Claude remembers project context, preferences, and constraints across sessions via this system.
Esc key
Interrupt a running action immediately. Use this if Claude is writing code in the wrong direction and you want to stop it mid-stream.
/review
Ask Claude to do a code review of the current diff. It checks for bugs, security issues, and style problems — same as asking a colleague to review your PR.
/pr
Generate a pull request description for the current branch. Creates a formatted markdown summary with what changed, why, and a test plan. Paste directly into GitHub.
/commit
Generate a conventional commit message for staged changes. Claude reads the diff and writes a clear, scoped commit message following the conventional commits spec.
CLAUDE.md is the single most impactful thing you can add to a project. It's a plain markdown file in your project root that Claude reads at the start of every session. It's your persistent "briefing document."
Without CLAUDE.md, you re-explain your project every session. With a good CLAUDE.md, Claude knows your stack, conventions, and constraints from the first message.
# My Project
## What this is
A Node.js REST API for managing user accounts. Connects to a PostgreSQL database.
## Tech stack
- Node.js 22, Express 5, PostgreSQL 16
- Tests: Jest + Supertest (run: npm test)
- Linter: ESLint (run: npm run lint)
## Conventions
- Use async/await, never callbacks
- All functions must have JSDoc comments
- API errors return { error: "message", code: "ERROR_CODE" }
## Do not modify
- database/migrations/ — ask me first before changing migrations
- .env file — never read or write secrets
## Common tasks
- "Add a route" → create in routes/, add handler in controllers/, add test in tests/
- "Fix a bug" → write a failing test first, then fix, then verify test passes
For a complete CLAUDE.md reference and advanced memory patterns, see the memory guide.
Each project is designed to teach a different aspect of Claude Code. Start with #1 and work through them in order.
Pick any of your existing projects that has no README. Ask Claude Code to read the codebase and write a comprehensive README.md with installation, usage, API reference, and contributing guide. You'll learn: file reading, context building, markdown generation.
Take a function or module with no tests. Ask Claude to write a full test suite covering happy path, edge cases, and error cases. You'll learn: /plan for analysis, test generation, running tests from within Claude Code.
Find a function over 80 lines in any project. Use Claude Code to characterize it, then plan and execute a refactor: better naming, smaller functions, no behavior change. You'll learn: phased planning, diff review, test-driven refactoring.
Build a command-line tool that solves a small problem you have (rename files, convert formats, query an API). Ask Claude to scaffold it, add argument parsing, and write tests. You'll learn: multi-file creation, full project scaffolding, CLAUDE.md setup.
Give Claude Code a real bug report or error from your project. Walk through the full workflow: reproduce → write failing test → fix root cause → verify → commit. You'll learn: the full Claude Code bug-fix workflow from first error message to merged fix.
Mistake: "Refactor the entire auth module" → Claude rewrites 8 files in a direction you didn't want.
Fix: Always use /plan first. The plan is a proposal you control, not a commitment.
Mistake: Running a 2-hour session with no commits. Claude makes a mistake at the end, and you lose everything.
Fix: Every time your test suite goes green, commit. Takes 30 seconds and gives you unlimited rollback.
Mistake: "Here's my 300-line auth.js: [paste]..." → Context bloat, worse responses.
Fix: Say "Read src/auth.js and..." — Claude reads files directly. No pasting needed.
Mistake: "Add user authentication, email verification, password reset, and social login."
Fix: Break it into steps. Start with the smallest complete unit: "Add email/password login only." Build from there.
Mistake: "The tests are failing but let's move on."
Fix: Never move on with a red test suite. Ask Claude to fix the failure before continuing. Every ignored failure compounds.
Mistake: Re-explaining your stack and conventions at the start of every session.
Fix: 20 minutes setting up a CLAUDE.md saves hours across future sessions.
--dangerously-skip-permissions in your primary working directories. This flag disables all safety checks. Only use it in fully sandboxed, throwaway environments.
Once you're comfortable with the first-session workflow, these guides cover the next level:
Claude Code is Anthropic's AI coding assistant that runs in your terminal as an autonomous agent. It reads your actual files, runs commands, and makes multi-file edits — not a chat interface. It's for any developer who wants an autonomous pair programmer: beginners learning by doing, experienced engineers handling complex tasks, solo developers who need speed.
Run npm install -g @anthropic-ai/claude-code. You need Node.js 18+ and an Anthropic account. Then run claude in any project directory — the first launch will walk you through browser-based login. Total setup time: under 5 minutes.
There's no free tier — you pay per token via the Anthropic API. A typical light session (30–60 minutes) costs $0.50–$3. Claude Max subscribers ($100/month) get a usage quota that covers daily heavy use. See the pricing guide for a full cost breakdown by use pattern.
Five essentials: /plan (review intent before any write), /compact (compress long contexts), /clear (fresh conversation, same session), /help (list all commands), and Esc (interrupt a running action). Master these and you control any session.
Cursor and GitHub Copilot embed inline in a GUI editor. Claude Code lives in the terminal and acts autonomously — it reads dozens of files, runs tests, makes multi-file edits, and reasons about the whole codebase. Cursor is easier to start with. Claude Code rewards terminal-comfortable developers who want more autonomous, multi-step task handling. See Claude Code vs Cursor for a full comparison.
Create a CLAUDE.md file in your project root. Include: tech stack, project purpose, naming conventions, directories to avoid, and recurring task patterns. Claude reads this at the start of every session. A 20-minute CLAUDE.md setup saves hours of re-explaining context over time.
Five common mistakes: (1) skipping /plan before large changes, (2) not committing often — commit every time tests go green, (3) pasting code instead of referencing file paths, (4) asking for too many things in one message, (5) using --dangerously-skip-permissions in your main directories. Each of these is easy to avoid once you know about it.