How to Install Claude Code and Run Your First AI Task
Install Claude Code on any platform and run your first autonomous coding task in under 10 minutes. This guide covers installation, setup, and your first real prompts.
Claude Code is Anthropic's agentic coding tool. It runs in your terminal, reads your entire project, edits files, runs commands, and iterates on results. This guide gets you from zero to your first productive session in under 10 minutes.
How do you install Claude Code?
Claude Code installs via a single command on macOS, Linux, or WSL. On Windows, use PowerShell.
macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bashWindows PowerShell
irm https://claude.ai/install.ps1 | iexAlternative methods
| Method | Command |
|---|---|
| Homebrew (macOS) | brew install claude-code |
| npm (any platform) | npm install -g @anthropic-ai/claude-code |
| VS Code Extension | Search "Claude Code" in VS Code marketplace |
| JetBrains Plugin | Search "Claude Code" in JetBrains marketplace |
Verify the installation:
claude --version
# Claude Code 2.x.xHow do you start your first session?
Navigate to any project directory and type `claude`. Claude Code reads your project structure and builds context automatically. You don't need to configure anything to start.
cd your-project
claudeYou'll see a prompt where you can type natural language instructions. Claude Code understands your project because it reads your files, not because you explain them.
What are good first prompts?
Start with tasks that help you understand what Claude Code can do. These prompts work well for a first session:
# Understand the project
> "What does this project do? Give me a high-level overview."
# Find issues
> "Are there any obvious bugs or code smells in this codebase?"
# Take action
> "Write tests for the auth module, run them, and fix any failures"
# Multi-step task
> "Add input validation to the user registration form,
write unit tests, and commit with a descriptive message"The last example shows Claude Code's real power: it writes code, runs tests, reads output, fixes failures, and commits. All in one prompt. That's the difference between a chat tool and an agent.
What makes Claude Code different from other AI tools?
| Capability | Claude Code | Chat-based tools |
|---|---|---|
| File access | Reads any file in your project | Only what you paste |
| Execution | Runs commands in your terminal | No execution |
| Iteration | Fixes its own mistakes | You copy-paste fixes |
| Git | Creates commits, branches, PRs | No git integration |
| Memory | CLAUDE.md persists across sessions | No memory |
How do you set up CLAUDE.md for better results?
Create a CLAUDE.md file at your project root. Claude Code reads it at the start of every session. It tells the agent about your project's conventions, tech stack, and rules.
# Create CLAUDE.md automatically
claude /init
# Or write one manually
cat > CLAUDE.md << 'EOF'
# Project Context
Next.js 14 app with TypeScript and Tailwind CSS.
## Commands
- npm run dev — start dev server
- npm run test — run tests
## Conventions
- Use server components by default
- Never use `any` in TypeScript
EOFCheck out our detailed guide on CLAUDE.md best practices for advanced configuration.