How to Use Claude Code in 2026: Beginner Tutorial (Step-by-Step)

Claude Code is Anthropic's command-line AI coding agent. Unlike ChatGPT or the Claude web interface, Claude Code runs directly in your terminal and can…

guy using claude on his mac — Hit Claude's Usage Limit? 9 Smart Ways to Get More Out of Every Session
Reading Tools

Listen & Follow

Hear the article while spoken text is highlighted

00:00
00:00

Quick Answer

Claude Code is Anthropic's command-line AI coding agent. Unlike ChatGPT or the Claude web interface, Claude Code runs directly in your terminal and can read, write, and edit…

  • Writing automation scripts — file management, renaming, batch processing
  • Understanding unfamiliar codebases — "explain this project to me"
  • Fixing bugs you can't diagnose — paste the error, it finds the cause
*As an Amazon Associate I earn from qualifying purchases.

Claude Code is Anthropic’s command-line AI coding agent. Unlike ChatGPT or the Claude web interface, Claude Code runs directly in your terminal and can read, write, and edit files on your computer autonomously. That makes it genuinely useful for real projects — not just answering questions about code.

This beginner tutorial walks you through installation, your first project, and the key commands that make Claude Code actually useful day-to-day.

📋 What You’ll Learn:
• How to install Claude Code on Mac, Windows, or Linux
• The key commands to know (and the ones to skip)
• How to run your first project with Claude Code
• Tips for getting better results from Claude Code
• What Claude Code is — and isn’t — good at

What Is Claude Code and Who Is It For?

Claude Code is for anyone who works with code — even beginners. You don’t need to be an expert programmer. In fact, Claude Code is particularly useful for people who can describe what they want in plain English but struggle to write the code themselves.

It’s especially powerful for: building small automations, writing scripts, working with data files, building simple web pages, and understanding or editing existing code you didn’t write.

✅ Good to know: Claude Code requires a Claude API subscription (not the same as Claude.ai Pro). You’ll need to sign up at console.anthropic.com and get an API key. There’s a free trial with $5 in credits — enough to learn the basics.

How to Install Claude Code

1

Install Node.js first

Claude Code requires Node.js version 18 or higher. Download it from nodejs.org and install it. To verify: open your terminal and type node --version. You should see v18 or higher.

2

Install Claude Code via npm

In your terminal, run:

npm install -g @anthropic-ai/claude-code
3

Get your Anthropic API key

Go to console.anthropic.com → API Keys → Create Key. Copy the key — you’ll only see it once.

4

Set your API key

In your terminal, run:

export ANTHROPIC_API_KEY=”your-api-key-here”

To make this permanent (so you don’t have to set it every session), add that line to your ~/.bashrc or ~/.zshrc file.

5

Start Claude Code

Navigate to any project folder and run:

claude

That’s it. Claude Code starts and you can type instructions in plain English.

Your First Project: A Simple File Organiser

Let’s do something immediately useful. We’ll ask Claude Code to write a script that organises files in a folder by type.

1

Create a new folder for your project

In terminal: mkdir file-organiser && cd file-organiser

2

Start Claude Code

Type claude and press Enter.

3

Give it your first instruction

Type exactly what you want in plain English:

Write a Python script that organises all files in my Downloads folder into subfolders by file type — Images, Documents, Videos, and Other. Make it safe so it doesn’t delete anything, just moves files.

Claude Code will write the script, explain what it does, and ask if you want it to run it. Review the code, then type yes to let it execute.

⚠️ Review before approving: Always read what Claude Code plans to do before typing yes. It will show you a summary of every file action it intends to take. This is a habit worth building from day one.

Key Claude Code Commands to Know

Essential Commands
/help — shows all available commands

/clear — clears the conversation context (start fresh)

/compact — compresses long conversations to save context window

/plan — ask Claude Code to plan before executing (safer for big changes)

/exit — exit Claude Code

Power User Features
CLAUDE.md file — create this file in your project root to give Claude Code permanent instructions about your project (coding style, file structure, what to avoid)

–print flag — run Claude Code without interactive mode: claude --print "explain this file"
Pipe input — feed files directly: cat myfile.py | claude "explain what this does"

5 Things Claude Code Is Genuinely Great At

  • Writing automation scripts — file management, renaming, batch processing
  • Understanding unfamiliar codebases — “explain this project to me”
  • Fixing bugs you can’t diagnose — paste the error, it finds the cause
  • Writing tests for existing code — faster than writing them yourself
  • Converting files between formats — CSV to JSON, Markdown to HTML, etc.

3 Things Claude Code Struggles With

  • Very large codebases — it can get confused across 50+ files without a good CLAUDE.md
  • Real-time data — it doesn’t know today’s API changes or library updates
  • GUI applications — it can write the code but can’t see or interact with visual interfaces

 

Related
AI Productivity Tools for Beginners: The Complete Getting-Started Guide (2026)

 

Frequently Asked Questions

Is Claude Code free to use?

Claude Code requires an Anthropic API key, which is billed by usage (per token). New accounts get $5 in free credits to start. There’s no monthly subscription — you pay only for what you use. Light users typically spend $5–$15 per month.

Do I need to know how to code to use Claude Code?

No. Claude Code understands plain English instructions. You describe what you want and it writes the code. However, basic familiarity with your terminal (navigating folders, running commands) is helpful for getting started.

What’s the difference between Claude Code and the Claude.ai website?

Claude.ai is a chat interface — you have conversations and copy-paste results. Claude Code runs in your terminal and can directly read, create, edit, and run files on your computer. It’s much more powerful for actual software tasks.

Is Claude Code safe? Can it delete my files?

Claude Code asks for your approval before taking any destructive action. It shows you a plan before executing. As long as you read the plan before typing yes, you’re in control. That said, always work in a dedicated project folder and keep backups of important files.

More AI Tool Guides Like This

We break down complex AI tools into plain-English tutorials. No jargon, no fluff — just what works.

Subscribe now on Telegram
Next guide coming up
XfWA