Everything you need to install, configure, and get productive with Claude Code CLI. From zero to a fully-configured development environment.
Claude Code is Anthropic's official CLI tool that brings Claude directly into your development workflow. It runs in your terminal, has full access to your filesystem and shell, and can read, write, and execute code in your projects.
Unlike chat-based AI tools, Claude Code operates as an agentic coding assistant — it can explore your codebase, make multi-file changes, run tests, commit code, and execute complex multi-step tasks autonomously.
Chat tools require you to copy-paste code in and out. Claude Code reads your files directly, understands your project structure, and makes changes in place.
Copilot completes the current line. Claude Code handles entire features — create files, write tests, refactor across modules, run your build, and fix errors.
You need Node.js 18+ installed. Check with node --version. If you don't have it, install from nodejs.org or via your package manager.
Install globally via npm:
npm install -g @anthropic-ai/claude-code
Navigate to any project directory and run claude. Follow the authentication prompts to connect your Anthropic account.
cd your-project
claude
Once authenticated, you should see the Claude Code prompt. Try a simple command to verify everything works:
claude "What files are in this project? Give me a brief overview."
A CLAUDE.md file in your project root is the single most impactful thing you can do to improve Claude Code's output. It tells Claude about your architecture, conventions, and hard constraints.
# ProjectName — CLAUDE.md
## Project Identity
Brief description of what this project is and its tech stack.
## Architecture Rules
- Key patterns to follow (service layer, component structure, etc.)
- Directory structure conventions
- Import ordering rules
## Hard Constraints
```
NEVER: Describe things Claude must never do
WHY: Explain the consequence
INSTEAD: Provide the correct approach
```
## Testing
- Test framework and how to run tests
- Minimum test requirements for new code
## Git
- Branch naming conventions
- Commit message format
# Start an interactive session
claude
# Start with a specific task
claude "Refactor the auth module to use JWT tokens"
# Resume the last conversation
claude --continue
# Run a single command and exit (great for scripts)
claude -p "Generate a migration to add email_verified column to users table"
# Pipe input
cat error.log | claude -p "What's causing these errors?"
# Use a specific model
claude --model claude-sonnet-4-20250514
# Set output format (for scripting)
claude -p "List all TODO comments" --output-format json
# Limit tool access
claude --allowedTools "Read,Grep,Glob"
/help — Show available commands
/clear — Clear conversation history
/compact — Summarize conversation to save context
/cost — Show token usage and cost
/doctor — Diagnose configuration issues
/memory — View and edit CLAUDE.md files
MCP (Model Context Protocol) servers extend Claude Code's capabilities by connecting it to external tools and services — databases, browsers, APIs, and more.
# Add a server (project-level)
claude mcp add server-name -- command arg1 arg2
# Example: Add a PostgreSQL MCP server
claude mcp add postgres -- npx @anthropic-ai/mcp-postgres "postgresql://..."
# Example: Add Playwright for browser automation
claude mcp add playwright -- npx @anthropic-ai/mcp-playwright
# List configured servers
claude mcp list
PostgreSQL, SQLite, Neon — lets Claude query and modify your database directly.
Playwright, Puppeteer — Claude can navigate websites, fill forms, take screenshots.
Stripe, GitHub, Notion — connect Claude to services you use daily.
Brave Search, Perplexity — give Claude access to current web information.
"Fix the bug in the login page"
"The login form in src/pages/Login.tsx submits even when the email field is empty. Add client-side validation that prevents submission when email is empty or invalid format."
Long conversations consume context window. Use /compact to summarize the conversation and free up space for more code analysis.
After making changes, tell Claude to run your test suite. It can read the output, identify failures, and fix them in the same session.
If Claude keeps making the same mistake (wrong import path, wrong pattern, etc.), add it as a NEVER constraint in CLAUDE.md. This eliminates the issue permanently.
Ask Claude to commit after each logical change. This gives you clean rollback points if something goes wrong.
Click each item as you complete it.
The premium generator creates 300+ line governance files with session modes, hard constraints, failure patterns, and self-evolution hooks — tailored to your exact tech stack.