O
Octo
O
Octo
CoursesPricingDashboardPrivacyTerms

© 2026 Octo

Claude Foundations
1Meet Claude2Getting Started with Claude3Claude Code: Your AI Coding Partner4Prompt Engineering for Claude5Claude at Work6Extended Thinking & Deep Reasoning7Building with the Claude API8Claude Best Practices & Safety
Module 3

Claude Code: Your AI Coding Partner

Master Claude Code — the command-line tool that lets you write, debug, and refactor code with Claude directly in your terminal. From installation to advanced workflows.

The developer who never leaves the terminal

You're debugging a production issue at 11pm. The stack trace points to a race condition buried three files deep. You could switch to a browser, paste code into Claude, copy the answer back, lose your place in the terminal — or you could type one command and have Claude analyze the entire codebase, find the bug, and fix it. Right there in your terminal.

That's Claude Code. It's not a chatbot with a code theme — it's an AI-powered development tool that lives where developers already work.

🔑Why Claude Code matters
The best developer tools don't change your workflow — they accelerate it. Claude Code understands your project structure, reads your files, runs your tests, and makes changes directly. No copy-pasting. No context switching. No "let me explain my codebase" — it already knows.

What Claude Code is

Claude Code is Anthropic's official command-line interface (CLI) for Claude. It's an agentic coding tool — meaning it doesn't just answer questions about code, it actively works with your codebase:

Reads your files — It can navigate your project, understand file relationships, and read any file you point it to

Writes and edits code — Makes changes directly to your files, with clear diffs you can review

Runs commands — Executes tests, build scripts, linters, and other terminal commands

Understands context — Knows about your project structure, dependencies, and conventions

Manages git — Creates commits, branches, and even pull requests

✗ Without AI

  • ✗Copy code → paste in browser → copy answer → paste back
  • ✗Explain your project structure every time
  • ✗Can't see your other files
  • ✗Can't run tests to verify changes
  • ✗Manual git operations

✓ With AI

  • ✓Type a prompt in your terminal → code is edited directly
  • ✓Automatically explores your codebase
  • ✓Reads any file in your project
  • ✓Runs tests and iterates on failures
  • ✓Commits, pushes, and creates PRs

Installing Claude Code

Getting Claude Code running takes about two minutes:

Step 1: Install via npm — Open your terminal and run: npm install -g @anthropic-ai/claude-code

Step 2: Authenticate — Run claude in any directory. You'll be prompted to log in with your Anthropic account.

Step 3: Navigate to your project — cd into any project directory

Step 4: Start Claude Code — Type claude and start talking to it about your code

# Install globally
npm install -g @anthropic-ai/claude-code

# Navigate to your project
cd my-project

# Start Claude Code
claude

There Are No Dumb Questions

Do I need a paid Anthropic account?

Claude Code requires an Anthropic API account with credits, or a Claude Max subscription. It's separate from a Claude Pro subscription at claude.ai, though Anthropic sometimes bundles access.

Does it work on Windows?

Claude Code works on macOS, Linux, and Windows (via WSL). Native Windows support may vary — WSL is the recommended approach.

Does it send my code to Anthropic's servers?

Yes, the code you're working with is sent to Anthropic's API for processing. Claude Code doesn't store your code or use it for training. Check your organization's policy on third-party AI tools before using it on proprietary codebases.

Your first Claude Code session

Once installed, here's what a typical session looks like:

$ cd my-react-app
$ claude

> What does this project do? Give me a quick overview.

Claude reads your package.json, key source files, and directory structure,
then gives you a summary of the project architecture.

> The login form isn't validating email addresses. Find and fix the bug.

Claude searches for login-related files, identifies the validation logic,
finds the issue, and proposes a fix — or makes it directly.

> Run the tests to make sure the fix works.

Claude executes your test suite and reports results.
💡Start with exploration
When you first open Claude Code in a new project, start with "Give me an overview of this project" or "What's the architecture here?" This helps Claude build context and helps you verify it understands your codebase correctly.

Key Claude Code features

Slash commands

Claude Code has built-in commands you can use:

CommandWhat it does
/helpShow available commands and shortcuts
/clearClear conversation context and start fresh
/compactSummarize conversation to save context window
/initCreate a CLAUDE.md file for your project
/costShow token usage and cost for the session
/modelSwitch between Claude models

The CLAUDE.md file

This is Claude Code's secret weapon. A CLAUDE.md file in your project root gives Claude persistent instructions about your codebase:

# Project: My React App

## Stack
- React 18 + TypeScript
- Tailwind CSS for styling
- Vitest for testing
- pnpm as package manager

## Conventions
- Use functional components with hooks
- All API calls go through src/lib/api.ts
- Tests live next to source files (*.test.ts)
- Run tests with: pnpm test

When Claude Code starts, it reads CLAUDE.md automatically. It's like giving a new team member a perfect onboarding doc — except this team member reads it every single time and never forgets.

⚡

Create a CLAUDE.md for your project

50 XP
Pick a project you're working on. Create a CLAUDE.md file that includes: 1. What the project does (1-2 sentences) 2. The tech stack 3. Key conventions (naming, file structure, testing approach) 4. How to run tests and build You can use `/init` in Claude Code to generate a starting point, then customize it.

Permission system

Claude Code asks before taking actions, with different permission levels:

Read operations — Reading files is generally auto-approved. Claude freely explores your codebase.

Write operations — Editing files requires your approval. You'll see a diff before Claude makes changes.

Command execution — Running terminal commands (tests, builds, git) requires explicit approval.

Yolo mode — For experienced users: auto-approve everything. Use with caution on trusted projects only.

There Are No Dumb Questions

Can Claude Code delete my files?

Only if you approve it. Every destructive action requires confirmation. You can also use git to undo any changes Claude Code makes — it's just editing files on disk.

What if Claude Code makes a bad change?

Use git diff to review changes, git checkout -- . to undo everything, or approve changes incrementally. Claude Code works with your existing git workflow, not against it.

Common workflows

Bug fixing

> There's a bug where users can submit the form without filling in required
  fields. Find and fix it.

Claude Code will:

  1. Search for form-related components
  2. Identify the validation logic (or lack thereof)
  3. Implement proper validation
  4. Run tests to verify the fix

Code refactoring

> Refactor the UserService class to use dependency injection instead of
  hardcoded database calls. Keep the existing tests passing.

Claude Code will:

  1. Read the current implementation and tests
  2. Refactor the class
  3. Update related files
  4. Run the test suite to verify nothing broke

Writing tests

> Write comprehensive tests for the PaymentProcessor module. Cover happy
  path, edge cases, and error handling.

Git operations

> Commit these changes with a descriptive message, then create a PR
  with a summary of what changed and why.
⚠️Always review before pushing
Claude Code can create commits and push code. Always review the changes (`git diff`) before approving a push. Treat Claude Code's git operations like you'd treat any automated tool — trust but verify.

Advanced Claude Code techniques

Multi-file changes

Claude Code shines when changes span multiple files. Instead of editing files one by one, describe what you want at a high level:

> Add a dark mode toggle to the app. It should:
> - Add a toggle button in the header
> - Store preference in localStorage
> - Apply dark mode classes to all existing components
> - Default to system preference

Claude Code will identify all relevant files, make coordinated changes across them, and keep everything consistent.

Iterative development

Claude Code remembers everything in your conversation. Use this for iterative workflows:

> Build a REST API endpoint for user profiles.
[Claude creates the endpoint]

> Now add input validation with proper error messages.
[Claude updates the endpoint]

> Add rate limiting — 100 requests per minute per user.
[Claude adds rate limiting]

> Write tests for all three features.
[Claude writes comprehensive tests]

Using Claude Code with headless mode

For automation and CI/CD, Claude Code supports headless mode:

# Run a single prompt and exit
claude -p "Find all TODO comments in this project and create a summary"

# Pipe input
cat error.log | claude -p "Analyze this error log and suggest fixes"

⚡

Complete a real task with Claude Code

50 XP
Install Claude Code and use it on a real project. Complete one of these tasks: 1. Ask Claude Code to find and fix a bug 2. Have it write tests for an untested module 3. Use it to refactor a function you've been meaning to clean up What surprised you about the experience?

Claude Code vs. other AI coding tools

FeatureClaude CodeGitHub CopilotCursor
InterfaceTerminal (CLI)IDE pluginFull IDE
ApproachAgentic — reads, writes, runs commandsAutocomplete + chatAI-native editor
ContextEntire codebaseCurrent file + neighborsProject-wide
ActionsEdits files, runs tests, manages gitSuggests completionsEdits files, runs commands
Best forTerminal-native devs, complex multi-file tasksQuick inline suggestionsVisual editors who want AI integration

The tools aren't mutually exclusive — many developers use Copilot for inline completions and Claude Code for larger tasks.

?

Knowledge Check

1.What makes Claude Code 'agentic' compared to traditional AI coding assistants?

2.What is the purpose of a CLAUDE.md file?

3.How does Claude Code handle potentially destructive operations like file edits?

4.What is Claude Code's headless mode used for?

Previous

Getting Started with Claude

Next

Prompt Engineering for Claude