โŒจ๏ธ

Introduction to Claude Code

๐Ÿง‘โ€๐ŸŽ“ Apprenticeโฑ๏ธ 15 minutes

๐Ÿ“‹ Suggested prerequisites

  • โ€ขBasic terminal
  • โ€ขNode.js installed

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

SystemCommand
macOS/Linuxexport ANTHROPIC_API_KEY="your-key-here"
Windows PowerShell$env:ANTHROPIC_API_KEY="your-key-here"

๐Ÿ’ก To make it permanent, add it to your .bashrc or .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 thisClaude 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

CommandAction
/helpShow help
/clearClear conversation
/compactCompact mode
Ctrl+CExit

If something failed

ErrorCauseSolution
command not found: claudeNot installednpm install -g @anthropic-ai/claude-code
authentication_errorInvalid API keyCheck your ANTHROPIC_API_KEY
No such file or directoryEmpty directoryNavigate to a project with files
Slow responsesLarge modelNormal, Claude is thinking...

When to use Claude Code vs Web Chat?

Claude Code (CLI)Claude.ai (Web)
Edit code in your projectGeneral questions
Execute commandsLong conversations
Local file contextUpload 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