Claude Code is Anthropic's command-line AI assistant — a version of Claude that runs in your terminal, directly alongside your code. It's not a chatbot you paste code into. It's a tool that reads your files, runs your commands, edits your codebase, and works through multi-step problems autonomously, without you having to copy anything anywhere.
If you've used Claude.ai in the browser and thought "this would be amazing if it could just open the file," Claude Code is the answer to that thought.
How it's different from Claude.ai
The browser version of Claude is a general-purpose assistant. It's text in, text out. You copy your code in, Claude suggests something, you copy it back. Every piece of context requires manual effort to supply.
Claude Code is different in four fundamental ways:
Direct filesystem access. Claude Code can read any file in your project without you pasting it. It can write changes back to disk. When you say "refactor this function," it opens the file, makes the edit, and saves it — no clipboard involved.
Shell command execution. Claude Code can run Bash commands. It can run your tests, build your project, check git status, install packages, and read command output. When debugging, it can actually reproduce the problem rather than just theorize about it.
Persistent codebase awareness. Claude Code can search across your entire codebase using tools like Grep and Glob. It understands your project structure, not just whatever snippet you've shown it.
Autonomous multi-step operation. Claude Code works through a loop: read files → think → act → observe results → repeat. It can chain dozens of operations together, fixing the import error that's blocking the build, updating the test that now fails, and checking that the change works — all without you guiding each step.
The agentic loop
Understanding the loop is important because it explains what Claude Code is actually doing when it "just handles it."
When you give Claude Code a task, it doesn't produce a single response. It runs through a cycle:
- Observe — Claude reads the current state: files, command output, error messages
- Think — Claude reasons about what needs to happen next
- Act — Claude calls a tool: reads a file, edits it, runs a command, searches the codebase
- Observe the result — Claude reads what the tool returned
- Repeat — until the task is done or Claude needs to ask you something
This is why Claude Code can handle tasks that have no clear predetermined path. You don't have to know every step — Claude figures them out as it goes, adapting based on what it finds.
The loop terminates when Claude either completes the task or hits something it needs your input on (a decision it can't make autonomously, a command that requires your explicit approval, a question about requirements).
Built-in tools
Claude Code has a set of tools it uses to take actions. Understanding these helps you understand what's possible:
| Tool | What it does |
|---|---|
| Read | Read a file's contents |
| Write | Create or overwrite a file |
| Edit | Make a targeted string replacement in a file |
| MultiEdit | Make multiple edits to a file in one operation |
| Bash | Run a shell command and capture output |
| Glob | Find files matching a pattern (e.g., **/*.ts) |
| Grep | Search file contents with regex |
| LS | List files in a directory |
| Task | Spawn a subagent to handle a subtask (covered in the multi-agent lesson) |
| WebFetch | Fetch and parse a URL |
| WebSearch | Search the web |
| TodoWrite | Maintain a task list during complex operations |
The Bash tool is the most powerful and most important to understand. It's what lets Claude run your tests, use git, call the gh CLI, and do anything else a shell can do. It's also what requires the most care — running arbitrary shell commands has real consequences.
Installation and first login
Install Claude Code globally via npm:
npm install -g @anthropic-ai/claude-code
You'll need Node.js 18 or higher. After installation, run:
claude
On first launch, Claude Code will prompt you to authenticate with your Anthropic account. You need an account with API access — either a personal API key or access through Claude.ai Pro.
Once authenticated, you're in an interactive session. Try:
claude "What files are in this directory and what do they do?"
Claude will use the LS and Read tools to explore your current directory and give you a summary.
When to use Claude Code vs Claude.ai
Use Claude Code when:
- You're working on a codebase and want Claude to read, modify, and test files directly
- You want to automate workflows: PR reviews, code generation, refactoring
- You need Claude to run commands and respond to their output
- You're building a context-heavy task that requires understanding your entire project
- You want to set up hooks, slash commands, or MCP integrations (covered in later lessons)
Use Claude.ai when:
- You have a one-off question about code, algorithms, or concepts
- You want to explore ideas conversationally without needing file access
- You're writing, brainstorming, or working on something that doesn't involve a codebase
- You need a multimodal task (image analysis, document processing) that doesn't require file edits
The practical line: if your task involves your codebase and you'd otherwise be copying and pasting, use Claude Code. If it's a question you'd ask a colleague at a whiteboard, Claude.ai is fine.
What you can build with it
The range is wider than most people realize when they first install it:
Development workflows
- Write a feature from a spec, including tests, with one prompt
- Debug a production error by reading logs, tracing the code path, and patching the bug
- Refactor a module to a new pattern across a large codebase
- Review a PR diff and post inline comments to GitHub
Code generation and documentation
- Generate tests for an existing module based on the actual code, not a description of it
- Write documentation that reflects what the code actually does
- Create boilerplate that matches your project's existing conventions
Codebase analysis
- "Find all places where we're making database calls inside a loop"
- "What's the dependency tree for this function?"
- "Which files haven't been modified in 6 months?"
CI/CD and automation
- Run Claude Code in headless mode inside GitHub Actions
- Trigger code review on PR comments
- Automate changelog generation from commit messages
The rest of this course covers the features that make these workflows efficient: how to give Claude persistent memory about your project, how to create reusable commands and skills, how to automate actions around Claude's tool use, and how to connect Claude to external services like GitHub and your database.
Start with the next lesson on CLAUDE.md — it's the foundation everything else builds on.