What you'll build
You'll install Claude Code CLI, Anthropic's tool that puts Claude directly in your terminal. You'll have an AI assistant that can read your files, execute commands, and understand your entire project context. It's like having a senior developer by your side, helping you from the command line. By the end, you'll be able to ask Claude to explain code, fix bugs, create tests, and run commands for you.
Step 1: Install Claude Code
npm install -g @anthropic-ai/claude-code
Verify installation:
claude --version
Step 2: Configure your API Key
| System | Command |
|---|---|
| macOS/Linux | export ANTHROPIC_API_KEY="your-key-here" |
| Windows PowerShell | $env:ANTHROPIC_API_KEY="your-key-here" |
๐ก To make it permanent, add it to your
.bashrcor.zshrc
Step 3: Start Claude Code
Navigate to your project and run:
cd my-project
claude
Claude can now see your files and help you.
What can it do?
| Ask this | Claude does |
|---|---|
| "Explain this file" | Reads and explains the code |
| "Fix the bug in app.js" | Edits the file |
| "Create a test for this function" | Creates new file |
| "Run the tests" | Runs npm test |
| "Install express" | Runs npm install express |
Practical example
$ claude
> What does index.js do?
Claude reads the file and explains...
> Add a GET /health endpoint that returns { status: 'ok' }
Claude edits index.js and adds the endpoint...
> Test it
Claude runs curl localhost:3000/health...
Useful commands inside Claude
| Command | Action |
|---|---|
/help | Show help |
/clear | Clear conversation |
/compact | Compact mode |
Ctrl+C | Exit |
If something failed
| Error | Cause | Solution |
|---|---|---|
command not found: claude | Not installed | npm install -g @anthropic-ai/claude-code |
authentication_error | Invalid API key | Check your ANTHROPIC_API_KEY |
No such file or directory | Empty directory | Navigate to a project with files |
| Slow responses | Large model | Normal, Claude is thinking... |
When to use Claude Code vs Web Chat?
| Claude Code (CLI) | Claude.ai (Web) |
|---|---|
| Edit code in your project | General questions |
| Execute commands | Long conversations |
| Local file context | Upload files manually |
Learn more
โ Editors & AI Assistants โ Full comparison: Claude Code vs Copilot vs Cursor vs Aider
Next step
โ Hello World in Terminal โ Basic commands โ My First Repository โ Git basics