Claude Code is a terminal-native AI coding assistant. It lives in your terminal, reads your codebase, edits files, and runs commands. No IDE plugin needed. No browser tab. Just your terminal.
This is Article 3 in the Claude AI — From Zero to Power User series. If you are new to Claude, start with Article 1: What is Claude?.
By the end of this article, you will have Claude Code installed, configured, and ready to use on your projects.
What is Claude Code?
Claude Code is a command-line tool made by Anthropic. It launched in February 2025 and became generally available in May 2025. It is now the most popular AI coding CLI.
Here is what makes Claude Code different from other AI coding tools:
- Terminal-native. It runs in your terminal. No browser, no IDE extension required.
- Reads your entire codebase. Claude Code indexes your project files and understands your code structure.
- Edits files directly. It can create, modify, and delete files in your project.
- Runs commands. It can execute terminal commands like build, test, and deploy scripts.
- Respects .gitignore. It only reads files that are part of your project.
- Works with any language. Python, TypeScript, Rust, Go, Java, Kotlin — any language, any framework.
Think of it as having a skilled developer in your terminal who knows your entire codebase.
Installation
There are three ways to install Claude Code. The native installer is recommended.
Option 1: Native Installer (Recommended)
The native installer requires no dependencies, works on macOS, Linux, and Windows, and auto-updates in the background.
macOS / Linux:
curl -fsSL https://claude.ai/install.sh | bash
macOS (Homebrew):
brew install claude-code
Note: Homebrew installations do not auto-update. Run brew upgrade claude-code manually to get new versions.
Windows (PowerShell):
irm https://claude.ai/install.ps1 | iex
Requires Windows 10 build 1809 or later.
Option 2: npm (Legacy)
If you need to pin a specific version or work in an environment where npm is the standard package manager:
npm install -g @anthropic-ai/claude-code
The npm installation does not auto-update. Run npm update -g @anthropic-ai/claude-code manually. For most users, the native installer above is the better choice.
Verify Installation
claude --version
You should see something like:
claude-code 1.x.x
If something is not working, run the built-in diagnostic tool:
claude doctor
This checks your installation, authentication, permissions, and network connectivity. It is the fastest way to debug any setup issue.
System Requirements
- macOS: 13.0 (Ventura) or later. Apple Silicon and Intel both supported.
- Linux: Any modern distribution with glibc 2.31+.
- Windows: Windows 10 build 1809 or later, including Windows 11.
- Account: Claude Pro, Max, Teams, Enterprise, or Console (API) account. The free claude.ai plan does not include Claude Code access.
Authentication
Claude Code needs to know who you are. There are two authentication methods:
Option 1: Claude Pro/Max Subscription
If you have a Claude Pro ($20/month) or Max ($100-200/month) subscription:
claude
Claude Code will open a browser window for you to log in. After authentication, you are ready to go. Your subscription usage limits apply.
Option 2: API Key
If you have an API key from console.anthropic.com:
export ANTHROPIC_API_KEY="sk-ant-api03-your-key-here"
claude
With an API key, you pay per token. This is the same pricing as the API (covered in Article 2).
First Run
Open your terminal, navigate to a project directory, and launch Claude Code:
cd ~/projects/my-app
claude
Claude Code starts an interactive session. You see a prompt where you can type natural language commands:
~/projects/my-app
>
Try a simple question:
> What does this project do?
Claude Code reads your project files (README, package.json, source code) and gives you a summary. It does this automatically — you do not need to tell it which files to read.
Core Commands
In a Claude Code session, you type natural language. But here are common patterns:
Ask Questions About Your Code
> How does the authentication flow work?
> What database does this project use?
> Explain the UserService class
Edit Files
> Add input validation to the login endpoint
> Refactor the database module to use connection pooling
> Fix the bug in the payment calculation function
Claude Code shows you the proposed changes and asks for permission before editing. You can approve, reject, or modify the changes.
Run Commands
> Run the tests
> Build the project
> Check for linting errors
Claude Code asks for permission before running terminal commands. This is a safety feature.
Create Files
> Create a new API endpoint for user profiles
> Add a Dockerfile for this project
> Create unit tests for the OrderService
Slash Commands
Claude Code has built-in slash commands for common tasks:
| Command | What It Does |
|---|---|
/init | Generate a CLAUDE.md file for your project |
/review | Review recent code changes |
/compact | Compress conversation context to free up tokens |
/cost | Show token usage and estimated cost for this session |
/model | Switch between models (Opus, Sonnet, Haiku) |
/help | Show all available commands |
/clear | Clear the conversation history |
/init — The Most Important Command
Run /init as the first thing in any new project:
> /init
Claude Code analyzes your project structure — package.json, requirements.txt, Dockerfiles, directory layout, configs — and generates a CLAUDE.md file tailored to your project. This file gives Claude persistent context about your codebase.
We cover CLAUDE.md in detail in a later article.
/review — Code Review
After making changes, ask Claude to review them:
> /review
Claude Code looks at your recent git changes and provides a code review with suggestions, potential bugs, and improvements.
/compact — Manage Context
Long conversations use a lot of tokens. When you notice Claude losing track of earlier context, compress it:
> /compact
This summarizes the conversation history, preserving key decisions while freeing up token space.
/cost — Track Usage
Check how much your session has cost:
> /cost
This shows input tokens, output tokens, and estimated cost for the current session.
Permissions Model
Claude Code asks permission before doing anything potentially destructive:
- Reading files: Allowed by default (respects .gitignore)
- Editing files: Asks permission, shows a diff
- Running commands: Asks permission, shows the command
- Deleting files: Asks permission
You can configure auto-approval for specific operations in your settings. But the default “ask first” behavior is a good safety net.
Claude Code in IDEs
Claude Code also works inside VS Code and JetBrains IDEs:
VS Code
Install the Claude Code extension from the VS Code marketplace. It opens a Claude Code panel inside your editor. You get the same terminal experience with the added benefit of seeing your code side by side.
JetBrains (IntelliJ, WebStorm, PyCharm, etc.)
Install the Claude Code plugin from the JetBrains marketplace. Same functionality as the VS Code extension.
Both IDE integrations use the same Claude Code engine. Your CLAUDE.md files, settings, and permissions work the same way.
Settings and Configuration
Claude Code stores settings in ~/.claude/settings.json. You can configure:
{
"model": "claude-sonnet-4-6",
"permissions": {
"allow_file_edit": true,
"allow_command_run": "ask"
},
"theme": "dark"
}
Key settings:
| Setting | Description | Default |
|---|---|---|
model | Default model to use | claude-sonnet-4-6 |
permissions | Auto-approve file edits and commands | Ask for everything |
theme | Terminal theme | System default |
You can also configure project-specific settings in .claude/settings.json inside your project directory.
Tips for Effective Usage
Here are practical tips to get the most out of Claude Code:
1. Be Specific
Instead of “fix the bug”, say “fix the null pointer exception in UserService.getProfile when the user has no address”. More context leads to better results.
2. Start with /init
Always run /init on a new project. The generated CLAUDE.md file dramatically improves Claude’s understanding of your codebase.
3. Use /compact Proactively
Do not wait until Claude starts losing context. Run /compact when your conversation gets long. Think of it as garbage collection for your conversation.
4. Review Changes Before Approving
Claude Code shows diffs before applying changes. Take a moment to review them. Claude is good, but not perfect.
5. Use It for Code Reviews
Claude Code is excellent at reviewing code. After writing code yourself, ask Claude to review it. It catches bugs, suggests improvements, and identifies edge cases.
6. Check Costs Regularly
Run /cost periodically, especially with Opus. Opus is powerful but expensive. Use Sonnet for routine tasks and switch to Opus for complex problems.
Cost Tracking
Claude Code tracks usage per session. Here is what a typical session costs:
| Activity | Model | Approximate Cost |
|---|---|---|
| Quick question | Sonnet | $0.01-0.05 |
| Code review | Sonnet | $0.05-0.20 |
| Complex refactoring | Sonnet | $0.20-1.00 |
| Large feature | Opus | $1.00-5.00 |
With a Pro subscription ($20/month), you get a set number of messages. With a Max subscription ($100-200/month), you get significantly more. With an API key, you pay per token with no message limits.
Summary
In this article, you:
- Installed Claude Code using the native installer
- Authenticated with your account or API key
- Ran your first Claude Code session
- Learned core commands and slash commands
- Understood the permissions model
- Configured settings and IDE integration
- Got practical tips for effective usage
Claude Code is the fastest way to work with Claude on real codebases. It combines the power of Claude’s AI with direct access to your files and terminal.
What’s Next?
In the next article, we will compare Claude’s models in depth. You will learn when to use Opus, Sonnet, and Haiku, with real benchmark data and cost examples.
Next: Understanding Models — Opus vs Sonnet vs Haiku