An interactive tutorial to get you productive with Anthropic's AI-powered CLI tool.
Your AI pair-programmer, right in the terminal
Claude Code is an agentic coding tool by Anthropic that lives in your terminal. It can read your codebase, edit files, run commands, and help you build software faster.
What it can do:
Quick check: Where does Claude Code run?
Get Claude Code up and running in seconds
Claude Code is installed globally via npm. You need Node.js 18+ on your machine.
After installing, navigate to any project directory and launch it:
Talking to Claude Code — prompts and slash commands
Once Claude Code is running, you simply type natural language requests. You can also use slash commands for specific actions:
| Command | What it does |
|---|---|
/help | Show available commands |
/clear | Clear conversation context |
/compact | Summarize conversation to save context |
/cost | Show token usage and cost |
/review | Review code changes |
/commit | Create a git commit for current changes |
Quick check: Which slash command would you use to see how many tokens you've used?
You stay in control of what Claude Code does
Claude Code asks for your approval before performing certain actions. These are categorized into permission levels:
a will save the permission so you won't be asked again for that specific action. You can manage saved permissions in the settings.
You can also pre-configure allowed tools by passing flags:
Quick check: When Claude Code wants to edit a file, what should you do?
Common patterns for everyday development
Here are some practical ways developers use Claude Code daily:
You can also use Claude Code in scripts and CI pipelines with the -p flag:
Ask Claude Code to do something useful with your project (at least 10 characters):
Level up your Claude Code workflow
Shift+Tab to toggle between single-line and multi-line input mode.CLAUDE.md file in your repo root with project-specific instructions — Claude Code reads it automatically.cat error.log | claude -p "explain these errors"/compact when conversations get long to avoid hitting context limits.| Action | How |
|---|---|
| Start Claude Code | claude |
| Resume last session | claude --continue |
| One-shot prompt | claude -p "..." |
| Clear context | /clear |
| Compact context | /compact |
| Check cost | /cost |
| Create commit | /commit |
| Exit | /exit or Ctrl+C |
CLAUDE.md file in your project root with build instructions, coding conventions, or anything you want Claude to know. It's like a README for your AI assistant.
Final quiz: How do you resume your last Claude Code conversation?