Getting Started with Claude Code
Claude Code is Anthropic’s official command-line tool for AI-assisted software development. It reads your codebase, understands your project structure, writes code, runs tests, and commits changes – all from your terminal.
This page takes you from zero to productive in under 30 minutes. Follow the steps in order.
Prerequisites
Before installing Claude Code, make sure you have:
- Node.js 18+ – Claude Code runs on Node.js. Check with
node --version. - npm or pnpm – The package manager ships with Node.js. Check with
npm --version. - An Anthropic API key – Sign up at console.anthropic.com and generate an API key.
- A terminal – Terminal.app (Mac), Windows Terminal (Windows), or any Linux terminal.
Step 1: Install Claude Code
Install Claude Code globally with a single command:
npm install -g @anthropic-ai/claude-code
Verify the installation:
claude --version
If you get “command not found,” your PATH does not include the npm global bin directory. See Fix ‘command not found’ After Install for the fix.
Platform-specific guides:
- Claude Code Setup on Mac – macOS-specific steps including Homebrew alternatives
- How to Use Claude Code with WSL2 – Windows setup via WSL2
- Claude Code Bun Install Setup Guide – alternative installation using Bun
- Claude Code Tab Completion Setup – enable shell autocompletion
Step 2: Your First Session
Navigate to any project directory and start Claude Code:
cd your-project
claude
Claude Code scans your project structure, reads your CLAUDE.md (if present), and opens an interactive session. Try these starter prompts:
- “Explain the architecture of this project” – Claude reads your files and describes the structure
- “Find all TODO comments in the codebase” – searches across files
- “Write a unit test for the User model” – generates code based on your existing patterns
- “Fix the failing test in auth.test.ts” – reads test output and applies fixes
Claude Code operates in your terminal and modifies files directly. It will ask for permission before making changes (in default mode).
Detailed walkthrough: Claude Code First Project Tutorial covers a complete first-session example with a real project.
Step 3: Set Up Your CLAUDE.md
A CLAUDE.md file is the single most impactful configuration you can create. It tells Claude Code how your project works, what standards to follow, and what patterns to use.
Create a CLAUDE.md in your project root:
touch CLAUDE.md
Add these essential sections:
# Project Overview
Brief description of what this project does and its tech stack.
# Build and Test Commands
- Build: `npm run build`
- Test: `npm test`
- Lint: `npm run lint`
# Coding Standards
- Use TypeScript strict mode
- Functions must be under 50 lines
- All public APIs need JSDoc comments
# Directory Structure
- src/ — application source code
- tests/ — test files mirroring src/ structure
- docs/ — documentation
Generate one automatically: The CLAUDE.md Generator creates a production-ready CLAUDE.md by asking you a few questions about your project.
Learn more:
- CLAUDE.md Best Practices: Definitive Guide – comprehensive authoring guide
- How to Write Effective CLAUDE.md – step-by-step writing tutorial
- Claude Md File: What It Does – understanding CLAUDE.md internals
- Why Does Claude Code Perform Better with CLAUDE.md? – measurable impact data
Step 4: Essential Commands
Claude Code supports both interactive chat and CLI commands. Here are the commands you will use most:
| Command | What It Does |
|---|---|
claude |
Start an interactive session |
claude "your prompt" |
Run a single prompt and exit |
claude --continue |
Resume your last session |
claude --model |
Specify which Claude model to use |
/help |
Show available slash commands (in session) |
/clear |
Clear the current conversation context |
/cost |
Show token usage and estimated cost |
Deep dive: Best Claude Code Commands You’re Not Using covers power-user commands that most developers overlook.
Step 5: Understand Permission Modes
Claude Code has three permission modes that control how much autonomy it has:
- Ask mode (default) – Claude asks permission before every file modification and command execution. Best for learning and sensitive codebases.
- Auto-accept mode – Claude executes without asking. Enable with
claude --dangerously-skip-permissions. Use only in sandboxed environments. - Custom rules – Define granular permissions in settings.json for specific tools and directories.
Learn more: Claude Code Permission Modes Explained covers all modes with security implications.
Top 10 Articles for Beginners
These articles answer the questions that new Claude Code users ask most frequently:
- What Is Claude Code And Why Developers Love It – overview and value proposition
- Claude Code for Beginners – complete beginner walkthrough
- How to Use Claude Code: Beginner Guide – practical usage patterns
- Claude Code Tips For Absolute Beginners – quick tips for day one
- Claude Code Common Beginner Mistakes – avoid these pitfalls
- Claude Code Pair Programming – using Claude as a coding partner
- Is Claude Code Worth It? Honest Beginner Review – unbiased assessment
- How Claude Code Changed My Development Workflow – real workflow transformation
- Best Claude Code Learning Resources – curated learning path
- Best Claude Code Courses and Tutorials – structured learning options
Next Steps
Once you are comfortable with the basics:
- Add MCP servers for extended capabilities: MCP Integration Guide for Beginners
- Install your first skill for reusable workflows: Best Claude Code Skills to Install First
- Optimize costs before they add up: Track Claude Token Spend Per Project
- Learn advanced patterns: Advanced Claude Code Usage for multi-agent orchestration, hooks, and subagents
- Explore configuration options: Claude Code Configuration for settings, environment variables, and MCP setup
Frequently Asked Questions
How much does Claude Code cost?
Claude Code uses the Anthropic API with pay-per-use pricing. Costs depend on the model you use and how many tokens your sessions consume. A typical development session costs $0.50-$5.00. Use /cost during sessions to monitor spending. See the Cost Calculator for project estimates.
Does Claude Code work with any programming language?
Yes. Claude Code works with any language that has text-based source files. It performs best with popular languages (Python, JavaScript, TypeScript, Go, Rust, Java) because those have the most training data, but it handles less common languages effectively as well.
Is my code sent to Anthropic’s servers?
Yes, file contents that Claude Code reads are sent to the Anthropic API for processing. Anthropic’s data retention policy states that API inputs and outputs are not used for model training. For sensitive codebases, review the Security Best Practices and consider using AWS Bedrock for data residency control.
Can I use Claude Code without an internet connection?
No. Claude Code requires an active internet connection to communicate with the Anthropic API. For air-gapped environments, see Use Claude Skills in Air-Gapped Environments.
What is the difference between Claude Code and Claude Desktop?
Claude Code is a command-line tool for developers that operates in your terminal and modifies files directly. Claude Desktop is a graphical chat application for general-purpose conversations. Claude Code uses the same Claude models but adds developer-specific features like file editing, test running, and git integration.
How do I update Claude Code?
Run npm install -g @anthropic-ai/claude-code@latest to update to the latest version. Check the Changelog for what changed.
Explore More Guides
- Production-ready guidelines
- Complete settings reference
- Error reference when things go wrong
- Fix common beginner issues
- Ready for the next level?
Ready to Go Deeper?
This page gets you started. For 200 production-tested practices covering advanced workflows, cost optimization, multi-agent patterns, and team scaling, get the Claude Code Mastery Playbook ($99).