The Complete Guide to Claude Code: Build Smarter, Ship Faster
Claude Code is not just another AI coding assistant — it's an agentic development environment that lives in your terminal, understands your entire codebase, and autonomously executes tasks ranging from bug fixes to full feature builds. Whether you're a solo developer or part of an enterprise team, Claude Code fundamentally changes how software gets written.
This guide covers everything: installation, IDE integration, CLAUDE.md, advanced features like MCPs, Agents, and Skills, plus two real-world use cases showing Claude Code in action.
What is Claude Code?
Claude Code is a CLI (Command Line Interface) tool built by Anthropic that turns your terminal into an intelligent coding partner. Unlike tools that just generate code snippets for you to paste in, Claude Code:
- Reads your actual codebase and understands context deeply
- Executes terminal commands, installs packages, and manages git
- Edits multiple files simultaneously across an entire project
- Delegates complex sub-tasks to specialized sub-agents
- Connects to external tools and services via MCP integrations
- Remembers your project's rules and conventions via CLAUDE.md
Think of it as having a senior engineer sitting next to you who can read every file in your project, autonomously work through a task list, and ask for permission before doing anything risky.
Part 1: Getting Started with Claude Code
System Requirements
Before installing, make sure you have:
- macOS 10.15+, Ubuntu 20.04+, or Windows 10+ (via WSL or Git Bash)
- At least 4 GB RAM
- An active internet connection
- A Claude account (Pro, Max, or API access via console.anthropic.com)
Installation
Open your terminal and run the following:
Important: If installing via npm, never use
sudo. It creates permission conflicts down the line.
Verifying Your Installation
Once installed, verify everything is working correctly:
This command checks your installation type, version, system configuration, and reports any issues.
Authentication
When you run claude for the first time, it will ask you to authenticate. You have three options:
- Claude Pro/Max Account – Connect your claude.ai subscription. Best for individual developers who want predictable monthly pricing.
- API (Console) – Connect via console.anthropic.com for usage-based billing. Ideal for teams or heavy users.
- Enterprise – AWS Bedrock, Google Vertex AI, or Microsoft Foundry for enterprise deployments.
Starting Claude Code in Your Project
Navigate to your project folder and launch Claude Code:
This opens an interactive REPL (Read-Eval-Print Loop) scoped to your project directory. Claude can now see and interact with every file in that folder.
Part 2: Using Claude Code via Command Line
The Three Chat Modes
Once inside Claude Code, you can cycle between three distinct modes using Shift+Tab:
1. Default Mode
Claude suggests changes, waits for your approval, and then executes. This is the safest mode for beginners. Every edit is confirmed before it happens.
2. Auto Mode (Agentic Mode)
Claude works autonomously — editing files, installing packages, and completing tasks without asking for permission at each step. Perfect for larger feature builds where you want to "set it and go."
To allow specific bash commands without prompting, use:
For full auto-pilot (use with caution in trusted environments):
You can always press Esc to stop Claude mid-task.
3. Plan Mode
Before touching any code, Claude activates extended thinking to create a comprehensive strategy. This is the mode to use for new features, complex refactors, or new projects. Claude will ask clarifying questions and produce a Plan.md file with the full strategy.
Essential CLI Commands
| Command | What it does |
|---|---|
claude | Open interactive REPL |
claude "your prompt" | Launch with an initial message |
claude -p "query" | Non-interactive print mode (single task, then exits) |
claude update | Update to the latest version |
claude doctor | Check installation health |
claude mcp add | Add an MCP server |
claude mcp list | List connected MCP servers |
Useful Slash Commands Inside REPL
| Slash Command | Purpose |
|---|---|
/init | Scan project and create CLAUDE.md |
/clear | Clear conversation context (fresh start) |
/compact | Compress context when it gets large |
/permissions | Configure bash command permissions |
/hooks | Manage automation hooks |
/output-style | Change how Claude explains its work |
/review | Trigger a multi-perspective code review |
/exit | Exit the REPL |
Piping Input to Claude Code
Claude Code works natively with Unix pipes, making it powerful in shell scripts and CI/CD pipelines:
Part 3: Using Claude Code with IDEs
Claude Code integrates seamlessly with popular IDEs, so you don't have to choose between your editor and your AI agent.
VS Code Integration
Install the official Claude Code extension from the VS Code marketplace. Once installed:
- A Claude Code panel appears in your sidebar
- You can open Claude Code terminal instances directly in VS Code
- Run multiple Claude Code instances in parallel in split panes (useful for working on different parts of your codebase simultaneously)
Cursor Integration
Cursor users can install the Claude Code extension the same way. Many developers use a hybrid workflow:
- Claude Code for full agentic tasks (building features, refactoring, debugging)
- Cursor's Command+K for quick inline completions and tab suggestions
This combination is extremely powerful — Claude Code handles the heavy lifting while Cursor handles fast, in-context edits.
Windsurf Integration
Windsurf also supports the Claude Code extension with similar functionality to VS Code.
Workflow Tip
When using Claude Code inside an IDE, you can have Claude work on one area of your codebase in one terminal pane, while you review its changes in the editor. This keeps you in control without slowing down Claude's autonomous work.
Part 4: CLAUDE.md — Your Project's Brain
What is CLAUDE.md?
CLAUDE.md is a Markdown file that acts as persistent memory for Claude Code. Every time a new Claude Code session starts in your project, this file is automatically loaded into Claude's context. It stores:
- Project architecture and structure
- Coding conventions and style rules
- Important commands (how to run tests, start the dev server, etc.)
- Team decisions and constraints Claude should always follow
- Database schemas, API structures, and key patterns
Without CLAUDE.md, Claude starts every session without knowing anything about your project. With a well-written CLAUDE.md, it feels like Claude was there from day one.
Creating CLAUDE.md
The easiest way is to let Claude generate it automatically from your existing project:
The /init command makes Claude scan your entire codebase and produce a detailed CLAUDE.md file.
CLAUDE.md Structure and Example
Here is an example of a well-structured CLAUDE.md:
Important Notes
- Never commit .env files
- Always run tests before committing
- Use Supabase RLS policies for all database access
Popular MCP Integrations
| MCP Server | What it enables |
|---|---|
| GitHub MCP | PR reviews, issue creation, code search |
| PostgreSQL MCP | Query production DB directly from Claude |
| Slack MCP | Send messages, search conversations |
| Jira MCP | Create/update tickets |
| Sentry MCP | Read error reports and stack traces |
| Filesystem MCP | Extended file system access |
| Browser MCP | Control a browser for web scraping/testing |
Adding MCP with Authentication
Real-World MCP Example
With GitHub and Sentry MCPs connected, you can say:
Claude will read the Sentry error, trace it to the relevant code, write the fix, run tests, and create a GitHub PR — all without you touching anything manually.
Agents and Sub-Agents
What are Sub-Agents?
Sub-agents are isolated Claude instances that Claude Code spawns to handle specific sub-tasks. They work in parallel (up to 10 at once), each with a clean context window, and report their results back to the main conversation.
This is powerful because:
- Each agent focuses on one thing without getting confused by unrelated context
- Haiku sub-agents (fast and cheap) handle exploration; Sonnet sub-agents handle implementation
- Parallel agents dramatically speed up large tasks
How Sub-Agents Work in Practice
When you give Claude a complex task, it automatically decomposes it:
Each agent operates independently and returns its work to the main context.
Background Agents
Background agents let Claude keep working even after you close your terminal:
Or use the & prefix to launch directly as a background task:
Skills (Custom Slash Commands)
What are Skills?
Skills are Markdown files you place in .claude/commands/ that define reusable workflows Claude can run on demand. They let you encode your team's best practices as commands that anyone can invoke with a slash.
Skills are sometimes called "custom slash commands" — they're the same thing.
Creating a Skill
Create the .claude/commands/ directory in your project:
Create a skill file, for example .claude/commands/review.md:
Now invoke it anytime:
Example Skill Library
| Skill File | Command | Purpose |
|---|---|---|
review.md | /review | Multi-perspective code review |
test.md | /test | Generate comprehensive tests |
docs.md | /docs | Generate API documentation |
ux.md | /ux | UX design review |
security.md | /security | Security vulnerability scan |
deploy.md | /deploy | Pre-deployment checklist |
Team Skills
Commit your .claude/commands/ folder to your git repository so every team member gets access to the same skills automatically.
Hooks — Deterministic Automation
Hooks are shell commands that execute automatically at specific points in Claude Code's lifecycle, regardless of what Claude decides to do. They guarantee consistency — even if Claude forgets a step, the hook enforces it.
Hook Lifecycle Points
| Hook | When it fires |
|---|---|
PreToolUse | Before Claude uses any tool |
PostToolUse | After Claude completes a tool use |
Notification | When Claude sends a notification |
Stop | When Claude finishes responding |
Configuring Hooks
Use the interactive interface:
Or edit ~/.claude/settings.json directly:
The matcher supports exact strings ("Edit") or regex patterns ("Edit|Write").
Real-World Hook Examples
Plugin System and Marketplace
Plugins are packaged extensions that bundle MCP servers, skills, and hooks into a single installable unit — like npm packages but for Claude Code capabilities.
The official Anthropic plugin marketplace launched in December 2025. Community marketplaces are also emerging. Plugins can be auto-updated so your tooling stays current.
Memory Management and Context
Context is Claude Code's most precious and limited resource. Managing it well is the difference between Claude that stays focused and one that starts making mistakes.
Context Warning Signs
| Context Level | Claude's Behavior |
|---|---|
| 0–50% | Works freely and accurately |
| 50–70% | Begin paying attention |
| 70–90% | Run /compact to compress context |
| 90%+ | Run /clear — context is critically full |
Context Management Commands
Pro tip: Use /clear aggressively. Every time you switch to a new task, clear the chat. Don't carry irrelevant history forward — it eats tokens and degrades quality.
Git Integration
Claude Code has first-class git support:
GitHub PR Reviews
Install the GitHub app via:
Claude will automatically review pull requests, flagging real bugs and security issues rather than style nitpicks. Customize the review behavior via claude-code-review.yml in your repo:
Part 6: Use Case 1 — Building a Beautiful Landing Page
Here is the exact workflow Claude Code follows when tasked with creating a production-ready landing page from scratch.
The Prompt
Step 1: Claude Enters Plan Mode
Claude switches to extended thinking and asks clarifying questions:
- What's the target audience? (Marketers, content creators, developers?)
- What's the pricing model? (Free tier + Pro?)
- Any brand colors or inspiration sites?
- Do you want animations? (Framer Motion?)
You answer, and Claude generates a Plan.md:
Step 2: Claude Builds the Project
Claude executes autonomously in Auto Mode:
Step 3: Claude Reviews Its Own Work
Claude runs a multi-perspective review:
- UX Review: Checks CTA visibility, above-the-fold clarity, mobile experience
- Performance Review: Checks image optimization, bundle size, Core Web Vitals
- Accessibility Review: Checks color contrast, ARIA labels, keyboard navigation
- Security Review: No exposed API keys, safe external links
Step 4: Final Delivery
Claude runs npm run dev, reads the terminal output, catches any issues, and fixes them automatically. The result is a production-ready, beautifully designed landing page — built without you writing a single line of code.
Total time: ~8 minutes for a full, responsive, animated landing page.
Part 7: Use Case 2 — Building an AI Agent
Here is how Claude Code approaches building a production AI agent — in this case, a customer support agent that reads your support tickets, researches answers, and drafts responses.
The Prompt
Step 1: Plan Mode
Claude thinks through the architecture:
Step 2: Claude Builds the Agent
Step 3: The Agent's Core Loop (Generated by Claude)
Step 4: Claude Connects MCP for Live Testing
Claude inserts a test record, runs the agent, monitors the output, verifies the email was sent, and checks the log entry — all autonomously.
Step 5: Production Hardening
Claude adds production-grade resilience patterns without you having to specify the implementation details.
Total time: ~20 minutes for a fully working, production-ready AI support agent.
Quick Reference: Claude Code Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Shift+Tab | Cycle between Default / Auto / Plan modes |
Esc | Stop Claude mid-task |
Ctrl+B | Send current task to background |
Ctrl+D | Exit the REPL |
↑ Arrow | Navigate previous conversations |
Ctrl+C | Cancel current input |
Best Practices to Get the Most Out of Claude Code
1. Always start with CLAUDE.md. Run /init on any new or existing project. The more Claude knows about your codebase upfront, the better every interaction will be.
2. Use Plan Mode for big tasks. Whenever you're starting something complex — a new feature, a refactor, a new service — switch to Plan Mode first. Let Claude think before it acts.
3. Clear context often. Use /clear when switching between tasks. Carrying irrelevant history bloats your context and degrades Claude's focus.
4. Invest in Skills. Build a library of .claude/commands/ files for your team's most common workflows — code review, test generation, documentation, security audits. These pay dividends every single day.
5. Set up MCP for your stack. Connect Claude to your database, GitHub, and monitoring tools. Once connected, Claude can debug real production issues rather than working in isolation.
6. Use Hooks for consistency. Auto-linting, auto-testing, auto-formatting — hooks guarantee these happen whether you remember to ask or not.
7. Review everything. Claude Code is remarkably capable, but always review generated code before shipping to production. Use /review to have Claude do a first pass, then do your own review.
Conclusion
Claude Code represents a genuine shift in how software gets built. It's not a smarter autocomplete — it's a full agentic development system that can plan, execute, debug, and ship features with a level of autonomy that simply didn't exist two years ago.
Start with the basics: install it, run /init on your project, and build your first CLAUDE.md. Then gradually layer in MCPs, Skills, and Hooks as you get comfortable. Before long, you'll find yourself orchestrating Claude to do the heavy lifting while you focus on what matters most — product decisions, architecture, and the things that actually require a human.
The best developers of the next decade won't just write great code. They'll be great at directing intelligent systems that write great code for them.
Welcome to that future. It's already here.