Claude Code: Your AI Coding Agent
This content was developed with AI assistance and is regularly reviewed for accuracy.
Claude Code is an AI-powered coding agent built by Anthropic. Unlike traditional chatbots that only answer questions, Claude Code reads your entire codebase, edits files, runs terminal commands, creates pull requests, and works through complex multi-step tasks. It is available in the terminal, VS Code, JetBrains IDEs, a desktop app, and the browser.
What You'll Learn
- What Claude Code is and how it differs from other AI tools
- How to install and set up Claude Code on your machine
- Essential workflows for beginners: exploring code, fixing bugs, writing tests
- Intermediate techniques: memory files, skills, subagents, and automation
- Best practices for getting high-quality results
Why Claude Code Stands Out
Most AI coding tools work inside a chat window. You paste code in, get a response, and copy it back. Claude Code takes a fundamentally different approach:
| Feature | Traditional AI Chat | Claude Code |
|---|---|---|
| Codebase access | You paste snippets | Reads your entire project automatically |
| File editing | You copy/paste suggestions | Edits files directly with your approval |
| Running commands | You run them yourself | Executes terminal commands for you |
| Multi-step tasks | One question at a time | Plans and executes entire workflows |
| Memory | Forgets between sessions | Remembers project context via CLAUDE.md |
| Tool use | None | Connects to GitHub, databases, APIs via MCP |
Getting Started
Requirements
Before you install, make sure you have:
- Operating system: macOS 13+, Windows 10+, or Ubuntu 20.04+
- Account: A Claude Pro, Max, Teams, Enterprise, or Console account (the free Claude.ai plan does not include Claude Code)
- Internet connection: Required for all sessions
- 4 GB+ RAM
Install Claude Code
The recommended installation uses the native installer, which auto-updates in the background.
macOS or Linux:
curl -fsSL https://claude.ai/install.sh | bash
Windows PowerShell:
irm https://claude.ai/install.ps1 | iex
Windows users also need Git for Windows installed first.
After installation, verify it worked:
claude --version
Start Your First Session
Navigate to any project folder and type claude:
cd your-project
claude
You will be prompted to log in on first use. After that, you can start asking questions or giving instructions in plain English.
Try These First Prompts
"give me an overview of this codebase"
"explain the main architecture patterns used here"
"find the files that handle user authentication"
These read-only prompts help you explore a project without making any changes. Claude reads your files, understands relationships, and explains what it finds.
Essential Workflows for Beginners
Explore an Unfamiliar Codebase
When you join a new project or open an unfamiliar repo, Claude Code is one of the fastest ways to get oriented:
"what are the key data models?"
"how is authentication handled?"
"trace the login process from front-end to database"
Start with broad questions and narrow down. Ask about coding conventions, project-specific terms, and how components interact.
Fix a Bug
Share the error with Claude and let it investigate:
"I'm seeing this error when I run npm test: [paste error]"
"suggest a few ways to fix the TypeError in user.ts"
"update user.ts to add the null check you suggested"
Claude can read error messages, trace the source, suggest fixes, apply changes, and run tests to verify everything works.
Write Tests
Tell Claude what you want tested and let it match your project's existing patterns:
"find functions in auth.js that are not covered by tests"
"add tests for the notification service, including edge cases"
"run the new tests and fix any failures"
Claude examines your existing test files to match the framework, assertion style, and conventions already in use.
Create a Pull Request
Once your changes are ready:
"summarize the changes I've made to the authentication module"
"create a pr"
Claude generates a descriptive PR with context about what changed and why. Review it before submitting.
Working with Files and Context
Reference Files with @
Use @ to include specific files or directories in your prompt without waiting for Claude to search:
"explain the logic in @src/utils/auth.js"
"what's the structure of @src/components?"
This is faster than asking Claude to find files and gives it exactly the context you want.
Work with Images
You can drag and drop screenshots, paste images with Ctrl+V, or reference image paths:
"here's a screenshot of the error. What's causing it?"
"generate CSS to match this design mockup"
Intermediate Techniques
Use Plan Mode for Safe Exploration
Plan Mode lets Claude analyze your codebase with read-only operations. It will not make any changes, which makes it ideal for research and planning complex features before you start coding.
Start a session in Plan Mode:
claude --permission-mode plan
Or switch into Plan Mode during a session by pressing Shift+Tab (cycle through modes). Ask Claude to create a detailed plan, refine it with follow-up questions, then switch to normal mode to execute.
"I need to refactor our authentication system to use OAuth2. Create a detailed migration plan."
Press Ctrl+G to open your current input in an external text editor if you want to draft or revise a longer prompt before sending it.
Set Up CLAUDE.md for Project Memory
CLAUDE.md is a special file Claude reads at the start of every session. It gives Claude persistent context about your project: build commands, coding standards, architectural decisions, and workflow rules.
Generate a starter file automatically:
/init
Claude analyzes your codebase and creates a CLAUDE.md with build commands, test instructions, and conventions it discovers. Then refine it manually with things Claude cannot infer from code alone:
# Code style
- Use ES modules (import/export), not CommonJS (require)
- Destructure imports when possible
# Workflow
- Run `npm test` before committing
- Prefer running single tests, not the whole suite, for performance
Where to place CLAUDE.md files:
| Location | Scope | Use case |
|---|---|---|
~/.claude/CLAUDE.md | All your projects | Personal preferences |
./CLAUDE.md | This project | Team-shared conventions (check into git) |
./subdirectory/CLAUDE.md | Specific subdirectory | Module-specific rules |
Keep CLAUDE.md files concise. For each line, ask: "Would removing this cause Claude to make mistakes?" If not, cut it.
Create Skills for Repeatable Workflows
Skills extend Claude's knowledge with project-specific instructions. Unlike CLAUDE.md (which loads every session), skills load on demand, keeping your context lean.
Create a skill by adding a SKILL.md file inside .claude/skills/:
---
name: fix-issue
description: Fix a GitHub issue
---
Analyze and fix the GitHub issue: $ARGUMENTS.
1. Use `gh issue view` to get the issue details
2. Search the codebase for relevant files
3. Implement the fix
4. Write and run tests
5. Create a descriptive commit message
6. Push and create a PR
Invoke it with /fix-issue 1234.
Use Subagents for Parallel Work
Subagents run in their own context window, keeping your main conversation clean. This is powerful for research-heavy tasks:
"use subagents to investigate how our authentication system handles token refresh"
The subagent reads files, analyzes code, and reports back a summary without cluttering your main session. You can also create custom subagents in .claude/agents/:
---
name: security-reviewer
description: Reviews code for security vulnerabilities
tools: Read, Grep, Glob, Bash
---
You are a senior security engineer. Review code for:
- Injection vulnerabilities
- Authentication flaws
- Secrets in code
- Insecure data handling
Connect External Tools with MCP
The Model Context Protocol (MCP) lets Claude Code connect to external services like Notion, Figma, databases, and custom APIs. Add an MCP server:
claude mcp add
Once connected, Claude can pull data from issue trackers, query databases, fetch designs, and automate workflows, all from natural language prompts.
Automate with Non-Interactive Mode
Use claude -p to run Claude in scripts, CI pipelines, and pre-commit hooks:
claude -p "explain what this project does"
claude -p "list all API endpoints" --output-format json
cat build-error.txt | claude -p "explain the root cause of this build error"
Add Claude to your build scripts for automated code review:
{
"scripts": {
"lint:claude": "claude -p 'look at the changes vs. main and report any typos. report filename and line number.'"
}
}
Run Parallel Sessions with Git Worktrees
For working on multiple tasks simultaneously, use worktrees so each Claude session has its own copy of the codebase:
claude --worktree feature-auth
This creates an isolated working directory with its own branch. Start another session in a separate worktree:
claude --worktree bugfix-123
Changes in one session never interfere with another.
Best Practices
Give Claude a Way to Verify Its Work
The single most effective thing you can do is provide clear success criteria:
- Instead of: "implement a function that validates email addresses"
- Say: "write a validateEmail function. Test cases: user@example.com is true, invalid is false, user@.com is false. Run the tests after implementing."
Explore First, Then Plan, Then Code
For complex features, separate research from implementation:
- Explore (Plan Mode): Read files and understand the current state
- Plan: Ask Claude to create a detailed implementation plan
- Implement (Normal Mode): Execute the plan with verification
- Commit: Ask Claude to commit with a descriptive message
Manage Context Aggressively
Claude's context window fills up as you work. Keep it lean:
- Use
/clearbetween unrelated tasks - Use
/compactto summarize long conversations - Delegate research to subagents so exploration doesn't consume your main context
- Use
/btwfor quick questions that don't need to stay in context
Course-Correct Early
The best results come from tight feedback loops:
- Press Esc to stop Claude mid-action and redirect
- Press Esc twice or use
/rewindto restore previous state - Say "undo that" to revert changes
- After two failed corrections, start fresh with
/clearand a better prompt
Pricing and Access
Claude Code requires one of the following:
- Claude Pro ($20/month): Includes Claude Code access
- Claude Max ($100-200/month): Higher usage limits for heavy development
- Claude Teams/Enterprise: Team and organization features
- Anthropic Console: Pay-per-use API billing
You can also use Claude Code with third-party providers like Amazon Bedrock, Google Vertex AI, or Microsoft Foundry (formerly Azure AI Foundry).
Where Claude Code Runs
| Environment | Best for |
|---|---|
| Terminal CLI | Full-featured command-line experience |
| VS Code extension | IDE integration with editor context |
| JetBrains plugin | IntelliJ, PyCharm, WebStorm integration |
| Desktop app | Graphical interface without terminal |
| Browser (claude.ai) | Cloud-based sessions from any device |
Your CLAUDE.md files, settings, and MCP servers work across all environments.
Key Takeaways
- Claude Code is an autonomous coding agent, not just a chatbot. It reads your codebase, edits files, runs commands, and completes multi-step tasks.
- Start with read-only exploration prompts to build trust and understanding before making changes.
- Use CLAUDE.md to give Claude persistent project context that survives across sessions.
- Plan Mode, subagents, and skills let you scale from simple questions to complex, multi-step development workflows.
- Always give Claude a way to verify its work: tests, expected outputs, or screenshots.
Next Steps
- Try it now: Install Claude Code and explore a project you are working on
- Go deeper: Learn about the Model Context Protocol to connect Claude Code to external tools
- Build agents: See Your First AI Agent for step-by-step agent building tutorials
- Explore the ecosystem: Check out the AI Agents Overview for the full landscape of available agents