Updated March 2026

Claude Code Tutorial.From Install to Shipping Code.

Claude Code is a terminal-native AI coding agent from Anthropic, powered by Claude Sonnet and Opus models. With an 80.9% SWE-bench score — the highest among AI coding agents — it reads and writes files, runs terminal commands, and manages git autonomously. Whether you're new to coding with Claude or upgrading from the chat interface, this tutorial covers everything from installation to power-user workflows.

Learn AI-First DevelopmentIncluded in Build Fast With AI

Step 1: Installation

Claude Code installs as a global npm package. You need Node.js 18+ and an Anthropic account.

Install the CLI

Run npm install -g @anthropic-ai/claude-code in your terminal. This gives you the global claude command. On macOS, you may need to prefix with sudo depending on your Node setup.

Verify with: claude --version
Authenticate

Run claude for the first time and it will open a browser window for OAuth authentication. Claude Code is available on Pro ($20/mo), Max 5x ($100/mo), and Max 20x ($200/mo) plans — see our Claude Code pricing breakdown for a full comparison.

API key users: set ANTHROPIC_API_KEY in your environment

Step 2: Core Commands You Need to Know

Claude Code has a small surface area by design. Master these commands and you have 90% of what you need.

claude

Start an interactive session. Claude Code reads your current directory and is ready for conversation. This is where most developers spend their time.

claude "your prompt here"

Run a one-shot command. Give Claude a task, it executes it and exits. Perfect for scripting and quick tasks like "add error handling to the auth module".

claude -p "prompt" --output-format json

Pipe mode. Claude processes the input and returns structured output. Great for CI/CD pipelines, automated code review, and chaining with other tools.

/init

Run inside an interactive session to generate a CLAUDE.md file. This project memory file tells Claude about your architecture, conventions, and preferences.

/compact

Compress conversation context when you are getting close to the context limit. Preserves key information while freeing up token space for continued work.

/clear

Reset the conversation context entirely. Use this when switching to a completely unrelated task within the same session to avoid confusing Claude with irrelevant prior context.

/cost

Display your token usage and spending for the current session. Helpful for monitoring consumption on API-key plans and understanding which tasks are the most token-intensive.

/context

See how much of your context window is currently in use. Essential for knowing when to /compact or /clear — once you pass roughly 80% usage, response quality can start to degrade.

Step 3: Real Workflows That Work

Commands alone are not enough. Here is how experienced developers actually use Claude Code day-to-day.

Codebase Exploration

When you join a new project, start a Claude Code session in the repo root and ask "Explain the architecture of this project." Claude reads the entire codebase and gives you a structured overview — entry points, data flow, key abstractions.

Follow up with specific questions: "How does authentication work?" or "What happens when a user submits a payment?" Claude traces the call chain across files, something that would take you hours of manual exploration. For deeper patterns, see our Claude AI coding guide.

Test-Driven Bug Fixing

Paste the bug report or error message into Claude Code and say "Write a failing test for this bug, then fix the code to make it pass." This forces Claude to reproduce the issue first, which prevents hallucinated fixes.

Claude will write the test, run it, confirm it fails, then modify the source code, run the test again, and iterate until green. You get a regression test and a verified fix in one pass.

Multi-File Refactoring

Claude Code shines at refactors that touch many files. Say "Rename the User model to Account across the entire codebase, update all imports, references, and tests." Claude finds every occurrence, plans the migration order, and executes the changes.

For complex changes, Claude Code engages extended thinking mode to reason through the approach before editing, then spawns sub-agents to handle different parts in parallel. You can watch the progress or let it run autonomously and review the diff when done.

Git Integration

Claude Code understands Git natively. Ask it to "create a feature branch, implement the changes, commit with a descriptive message, and push." It handles the entire Git workflow without you touching git commands.

For code review, point Claude at a PR branch: "Review the diff between main and this branch. Identify bugs, style issues, and missing edge cases." You can also connect external tools via MCP servers to extend what Claude Code can access during reviews.

Power User Tips

These tips separate casual users from developers who get 10x output from Claude Code. Pair these with our Claude Artifacts guide for rapid UI prototyping alongside your terminal workflow.

Write a CLAUDE.md

The CLAUDE.md file in your repo root is project memory. Include your tech stack, coding conventions, test commands, and architectural decisions. Claude reads this at the start of every session — reducing repeated instructions and cutting token costs significantly over time.

Use Checkpoints

Claude Code creates Git checkpoints before major changes. If something goes wrong, you can roll back instantly. Never be afraid to let Claude try ambitious refactors — you always have a safety net.

Be Specific in Prompts

"Fix the bug" is bad. "The /api/users endpoint returns 500 when email contains a plus sign. Write a test, find the root cause, and fix it" is good. Specific prompts get specific results.

Chain with Unix Pipes

Use pipe mode to chain Claude with other tools: cat error.log | claude -p "Explain these errors and suggest fixes." This integrates Claude into your existing terminal workflow.

Set Permission Boundaries

Use --allowedTools to restrict what Claude can execute. In CI environments, you might only allow read and write operations. In development, you can allow shell commands for running tests.

Use /compact Early

Do not wait until you hit the context limit. Run /compact proactively when switching to a new sub-task. This keeps Claude focused and prevents degraded performance from context overload.

Knowing the commands is just the start.

The real skill is knowing how to scope tasks, control context, and review AI-generated code like a senior engineer. That is what Build Fast With AI teaches.

Get Lifetime Access — $79.99

Includes 12 Chapters, 6 Labs, and Lifetime Updates.

Claude Code Tutorial FAQ

Claude Code is available on the Anthropic Pro plan ($20/month), Max 5x ($100/month), and Max 20x ($200/month). The Pro plan works well for moderate usage, while the Max plans offer significantly higher rate limits for professional developers who use it daily for large refactors and codebase analysis.

Claude Code runs on macOS and Linux natively. Windows users can run it through WSL2 (Windows Subsystem for Linux). You need Node.js 18 or later installed. It works in any terminal emulator — iTerm2, Alacritty, the default Terminal app, or the integrated terminal in VS Code and JetBrains IDEs.

Claude Code can run any terminal command you authorize, which means it can use curl, wget, npm install, and other network tools. However, the AI model itself does not browse the web in real-time. It works with your local codebase and the tools available in your terminal environment.

Claude Code is an agentic coding tool that runs in your terminal with direct access to your filesystem. It can read your entire codebase (up to 1M tokens of context), create and edit files, run shell commands, execute tests, and iterate on solutions autonomously. The chat interface is a conversational tool without filesystem access.

Yes. Claude Code is language-agnostic because it operates at the filesystem and terminal level. It works well with Python, JavaScript, TypeScript, Rust, Go, Java, Ruby, PHP, and virtually any other language. It understands project structures, build tools, and testing frameworks across the ecosystem.