← Back to Course|Developer Tools
🖥️
Terminal / CLI ToolRequires Claude API or Pro

Claude Code (CLI)

by Anthropic - terminal-native agentic coding assistant

Claude Code is Anthropic's terminal-native AI coding tool. Unlike editor plugins, it runs directly in your shell - giving it full access to your filesystem, git history, terminal output, and the ability to run commands. It is the most powerful option for agentic tasks: give it a goal and it autonomously reads files, writes code, runs tests, and iterates.

Made by
Anthropic
Interface
Terminal (CLI)
Requires
Claude Pro/Max/Team or API
Platform
Mac, Windows, Linux
Model
Claude Opus 5 / Sonnet 5
Install via
Native installer (no Node)

⚡ Install & Setup

1
Install Claude Code
Mac/Linux: curl -fsSL https://claude.ai/install.sh | bash. Windows PowerShell: irm https://claude.ai/install.ps1 | iex. No Node.js needed; the native installer auto-updates. Homebrew (brew install --cask claude-code) and WinGet also work.
2
Verify
Open a new terminal and run: claude --version. (The old npm install -g @anthropic-ai/claude-code still works but is deprecated.)
3
Authenticate
Run: claude - on first launch it opens your browser to sign in with your Anthropic account. Requires a Claude Pro ($20/month), Max, or Team subscription, or an API key (pay-per-use, very affordable for coding tasks).
4
Verify installation
Run: claude --version - you should see the version number. Then cd into any project and run: claude
# Install and launch
curl -fsSL https://claude.ai/install.sh | bash cd my-project claude

🚀 Sample Usage

Interactive Mode - Ask & Iterate
$ claude
> Explain the auth flow in this project
[Claude reads src/auth/, middleware, and routes, then explains]

> Add JWT refresh token rotation. Write tests too.
[Claude creates files, runs npm test, fixes failures, done]
One-Shot Commands (non-interactive)
# Ask a question and get output:
claude "What does the processPayment function do?"

# Pipe a diff for review:
git diff --staged | claude "Review this diff before I commit"

# Run a file through Claude:
claude "Add error handling to all async functions" src/api/users.ts
CLAUDE.md - Persistent Project Context

Create a CLAUDE.md file in your project root. Claude Code reads it automatically every session:

# CLAUDE.md
## Stack Node.js + Express + PostgreSQL
## Conventions
- Use AppError for all errors (src/lib/errors.ts)
- No console.log - use logger from src/lib/logger.ts
## Tests vitest, run with npm test

💡 Pro Tips

  • Always start agentic tasks in a clean git branch - Claude will modify multiple files
  • The CLAUDE.md file is your most powerful tool - detailed context = better output
  • Use Ctrl+C to interrupt Claude mid-task and redirect it
  • Press y to accept file changes, n to reject, or type a correction
  • API key mode (no Pro required): set ANTHROPIC_API_KEY in your environment and billing kicks in at ~$0.003/1K tokens

⚖️ Which Coding Tool Should I Pick?

The current tool is highlighted. There is no single winner - pick by how you like to work. Models and pricing as of September 7, 2026.

ToolTypePricingBest forModels / AI
GitHub CopilotIDE extensionFree tier; Pro $10/moAI in your existing editorGPT-5.6, Claude Sonnet 5, Gemini 3.8 Flash
CursorAI IDE (VS Code fork)Hobby free; Pro $20/moAll-round AI editor + agentGPT-5.6, Claude Opus 5 / Sonnet 5
Devin Desktop (ex-Windsurf)AI IDE (VS Code fork)Free tier; Pro $20/moLocal + cloud agents in one placeSWE-1.6 (own) + Claude / GPT / Gemini
Google AntigravityAgent-first IDEFree tier; Google AI Pro $19.99/moAutonomous build + browser testGemini 3.1 Pro / Gemini 3.8 Flash (agent-first)
Claude Code (CLI)(this page)Terminal agentClaude Pro/Max or APIAgentic coding in the terminalClaude Opus 5 / Sonnet 5 / Haiku 4.5
VS Code + AI extEditor + extensionsFree options existKeep VS Code, add AIDepends on extension

Pricing and model support change often. Verified June 2026 - confirm on each tool's official site.

🛠️ Troubleshooting & Common Pitfalls

⚠ command not found: claude
Re-run the global install and make sure your npm global bin directory is on your PATH. Restart the terminal afterward.
⚠ Authentication errors
Log in with your Claude subscription, or set ANTHROPIC_API_KEY in your environment for API-key mode.
⚠ Too many permission prompts
Configure allowed tools / commands in settings, or run with the right permission mode - but review what you allow.
⚠ Token costs climbing
Scope each task, use /clear to reset context between tasks, and prefer a cheaper model (Haiku) for simple jobs.

📚 Related Course Lessons

Go deeper on the skills this tool is for:

L46 - Agentic Coding →L47 - Custom AI Extensions →L56 - From Prompter to Loop Designer →L59 - Skills →

🔗 Official Resources

Product page ↗What it is + how to installDocumentation ↗Commands, CLAUDE.md, MCP, agentsInstall guide ↗Native installer for Mac, Windows, LinuxGitHub repo ↗Issues + sourcePricing ↗Subscription + API rates

Links open the official sites. Pricing and features change often - always confirm there. (Verified June 2026.)

→ Compare: GitHub Copilot→ Compare: Windsurf