Claude Code
What you'll learn
~15 min- Install Claude Code globally via npm
- Authenticate using an API key or Anthropic account
- Run your first task and inspect the output
- Use key commands like /help, /clear, and /cost
By the end of this lesson, you’ll have Claude Code installed and working — and you’ll have built your first web page by describing it in plain English.
Claude Code Web at claude.ai/code offers Claude Code’s capabilities without local install. It connects to your GitHub repos for full project editing in the browser.
See the Cloud Sandbox Cheat Sheet
for current pricing, or set up your sandbox.
What is Claude Code?
Claude Code is Anthropic’s command-line AI agent. It runs in your terminal, can inspect files in your project directory, and uses a large context window to reason across many files — planning, writing, editing, and debugging code autonomously.
Key features:
- Understands your codebase through a large context window (up to 1M tokens on Max/Enterprise plans; 200K on Pro)
- Creates, edits, and deletes files
- Runs commands and tests
- Iterates on errors automatically
- Respects your project’s style and conventions
Installation
Step 1: Install Claude Code
npm install -g @anthropic-ai/claude-codeWSL (recommended):
npm install -g @anthropic-ai/claude-codeWindows native (PowerShell or Git Bash):
npm install -g @anthropic-ai/claude-codeClaude Code has full Windows-native support as of early 2026. The install command is the same — just make sure Node.js is installed on your Windows side (not just in WSL).
npm install -g @anthropic-ai/claude-codeVerify it installed:
claude --versionYou should see a version number.
Step 2: Authenticate
Run Claude Code for the first time:
claudeIt will walk you through authentication. You have two options:
Option A — Anthropic Console (API key):
- Go to console.anthropic.com
- Create an account if you don’t have one
- Go to API Keys and create a new key
- When Claude Code asks, paste your key
Option B — Claude Pro or Max subscription: If you have a Claude Pro ($20/mo) or Max ($100/mo or $200/mo) subscription at claude.ai, Claude Code can use that directly. Follow the prompts to log in with your Anthropic account.
Claude Code can be used with a Pro subscription ($20/month, 200K context), Max 5x ($100/month, 1M context, Opus 4.6), or Max 20x ($200/month, 20x Pro usage, 1M context) — subscriptions mean no per-token anxiety. Alternatively, you can use an API key and pay per token (Opus 4.6: $5/$25 per million input/output tokens; typically $5-50/month for learning). Start with a free trial to evaluate, then upgrade when you see the value. Use /cost during a session to monitor API key spending.
If you’re working on a remote server (SSH, VS Code Remote), browser login may fail. The most reliable method is Option A (API key) — set the key as an environment variable before starting Claude:
export ANTHROPIC_API_KEY="sk-ant-your-key-here"claudeThis bypasses browser auth entirely. You can also add the export to your ~/.bashrc (or ~/.zshrc) so it persists across sessions.
Your first interaction
Let’s do a “hello world” — the simplest possible task to make sure everything works.
Before using any AI coding tool on real work, build the habit of: (1) working in a new folder or test project, (2) initializing git with git init, (3) reviewing changed files before running generated code. For this first exercise, a fresh folder is enough.
Step 1: Create a project folder
mkdir hello-claude && cd hello-claudeStep 2: Start Claude Code
claudeYou’ll see a welcome screen with a prompt. Claude Code is now an interactive session — you type messages, Claude responds, and you go back and forth like a conversation.
Step 3: Describe what you want
Type this into the Claude Code session:
I need a simple HTML page that says "Hello from Claude Code!" with adark background and centered white text. Make it look clean and modern.Watch what happens:
- Claude plans what to create
- It creates an
index.htmlfile - It writes the HTML, CSS, and content
- It tells you what it did
Step 4: Refine it
Without leaving the session, type a follow-up:
Add a subtle gradient to the background and a footer with today's date.Claude updates the file. This back-and-forth conversation is how you’ll use Claude Code for real work — not one-shot commands, but an ongoing dialogue.
Step 5: Check the result
Press Ctrl+C to exit Claude Code, then inspect what it built:
ls # See the file(s) Claude createdcat index.html # Look at the contentsOpen the file in your browser:
open index.htmlIf you’re in WSL, open it with:
explorer.exe index.htmlOr if you’re in VS Code, right-click the file in the Explorer panel and select “Open with Live Server” or “Reveal in File Explorer.”
Open the file in your browser:
xdg-open index.htmlIf you’re on a remote server (SSH), use VS Code’s file explorer to preview, or copy the file to your local machine. If you used VS Code Remote, just click the HTML file and it opens locally.
You should see a clean webpage with your message. You just built a website by having a conversation in plain English.
The Real Workflow
Knowing the commands is one thing. Knowing how experienced practitioners actually use Claude Code is another. Here’s the session lifecycle that makes the difference.
Launch with intention
claude— for careful work on code you care about. Claude asks for confirmation before editing files or running commands.claude -d(short for--dangerously-skip-permissions) — for prototyping and learning. Removes confirmation prompts so you can move fast. Use this on throwaway projects, never near important code.
Describe, don’t command
Bad: “Create a file called form.html with a form element containing three input fields.”
Good: “I need a contact form for a small business website. It should collect name, email, and message, with validation. Dark theme.”
Give context and intent. Let Claude figure out the implementation details — that’s what it’s good at.
The mode dance
This is the skill that separates casual users from effective ones:
- Plan mode (
Shift+Tabor/plan) — Claude reads your project and proposes a strategy without editing anything. Use this when you need to think through a problem. - Execute mode (default) — Claude builds, edits, and runs commands. This is where the work happens.
- The rhythm: Plan → think → approve → build → checkpoint → repeat. The back-and-forth between planning and executing IS the skill.
Context is finite
After extended sessions, Claude starts losing earlier context. Two tools help:
/compact— condenses the conversation, preserving key decisions and dropping noise. Use when responses start getting less accurate./clear— fresh start for a new task. Always commit your work before clearing.
Checkpoint constantly
Between major steps, save your work with git (covered in Module 7):
git add -A && git commit -m "checkpoint: feature X working"Git is your safety net. If Claude makes a mess in the next step, you can always roll back. Don’t worry about this command yet — you’ll learn exactly what it does in Module 7.
Investing in Your Tools
Claude Code is a professional tool, and the most effective way to use it involves a subscription. Here’s how to think about the cost:
Max 5x ($100/month) or Max 20x ($200/month): Fixed cost, generous Claude Code usage with 1M token context and access to Opus 4.6. No per-token anxiety. You can experiment freely, iterate without watching a meter, and build the habits that make you productive. This is what most serious users should consider once they see the value.
The ROI framing: If Claude Code saves you 5 hours per month on tasks you’d do manually, the subscription has paid for itself many times over. Developers billing $50-150/hr recoup the cost in their first afternoon. Researchers who can prototype analyses in hours instead of weeks. Students investing in a skill that compounds across their career.
API key ($5-50/month typical): Pay per token. Good for light or occasional use. Use /cost to monitor spending during a session.
Free trial: Start here to evaluate. Every new Anthropic account gets trial credits. Upgrade when you see the value — not before.
Useful Claude Code commands
Once inside a Claude Code session, these are helpful:
| Command | What it does |
|---|---|
/help | Show available commands |
/clear | Clear the conversation |
/cost | Show token usage and estimated session cost |
/plan | Enter planning mode (read-only analysis) |
/compact | Condense conversation to free context window |
/effort | Set thinking depth (low / medium / high / max) |
/init | Generate a CLAUDE.md project memory file |
/voice | Push-to-talk voice input (hold spacebar to speak) |
/simplify | Three-agent code review of recent changes |
/batch | Parallel changes across codebase |
/btw | Quick question without adding to context |
/context | View context usage and optimization tips |
/agents | Manage custom subagents |
Shift+Tab | Toggle planning mode (may vary by terminal) |
Ctrl+C | Exit Claude Code |
Tips for effective use
-
Start in your project directory. Always
cdinto your project folder before runningclaude. This gives it access to your files. -
Be specific. “Make it look nice” → vague. “Use a dark theme with #09090b background, rounded corners, and subtle border” → specific and predictable.
-
Iterate. Don’t try to get everything right in one prompt. Start with the basic structure, then refine: “Now add a navigation bar” → “Make the nav sticky” → “Add a mobile hamburger menu.”
-
Let it run. Claude Code will often plan multiple steps and ask for confirmation. When it asks “Should I proceed?”, say yes unless something looks wrong.
Power features
Once you are comfortable with the basics, these features make Claude Code significantly more capable.
Plan mode
Type /plan to enter planning mode. In this mode, Claude reads your project and proposes a strategy without editing any files. This is useful when you want to think through an approach before committing to changes. Type /plan again to exit and let it execute. (Shift+Tab also toggles planning mode in supported terminals.) Especially valuable for beginners: use plan mode first to understand what Claude would change and why before letting it touch your files.
Extended thinking
Use /effort to control how deeply Claude thinks before responding:
| Level | Best for |
|---|---|
low | Quick edits, renaming, simple questions |
medium | General tasks (default) |
high | Multi-file changes, debugging complex issues |
max | Architecture decisions, large refactors |
Context management
Long conversations can cause the AI to forget earlier decisions. Use /compact to condense a conversation (keeping key context), /clear to start fresh, or /init to generate a CLAUDE.md project memory file. These are all listed in the command table above.
The .claude directory
Claude Code stores configuration and project memory in a .claude directory in your project root and in ~/.claude for global settings. The /init command generates a CLAUDE.md file that captures your project’s conventions — Claude reads this at the start of every session.
Autonomous mode
Running claude --dangerously-skip-permissions lets Claude execute without asking for confirmation on file edits or commands. The name is intentional — it is dangerous. Use it only for throwaway prototypes in a fresh directory, never near important code or data.
In autonomous mode, Claude can create, edit, and delete files and run commands without asking. Always commit your work to git before using it, so you can roll back if needed.
Newer features worth knowing about
These capabilities have been added in recent releases. You don’t need them on day one, but they’re good to know about:
- Voice mode (
/voice) — Hold spacebar to speak commands instead of typing. Great for non-developers who think faster than they type, or for describing complex ideas conversationally. - Auto-Memory — Claude automatically saves project notes in a
MEMORY.mdfile inside your.claudedirectory, so it remembers key decisions and patterns across sessions without you having to repeat yourself. - Skills — Reusable workflows defined as markdown files in
.claude/skills/. Think of them as saved recipes Claude can follow — useful once you find yourself repeating the same kinds of tasks. - Remote control — Monitor and interact with your local Claude Code sessions from claude.ai or the mobile apps. Useful for kicking off long tasks and checking on progress from your phone.
- Claude Code on the Web — A cloud-hosted version at
claude.ai/codethat connects to your GitHub repos for full project editing in the browser, no local install needed.
🧬In Your Field: Biotechclick to expand
Claude Code’s long context window (up to 1M tokens on Max plans) makes it especially useful for bioinformatics work. You can point it at a directory full of Python analysis scripts and ask questions like “Which of these scripts handles FASTQ quality trimming?” or “Add error handling to the alignment pipeline script.” It reads your entire project, so it understands how your scripts connect to each other — ideal for the kind of multi-step pipelines common in genomics and proteomics workflows.
📊In Your Field: MIS / Businessclick to expand
For MIS and business analytics projects, Claude Code shines at tasks like “Read the CSV export from our ERP system and create a Python script that generates a monthly summary report.” Because it can see your full project, it understands your data schemas, existing scripts, and naming conventions. It’s particularly effective when you need to transform data between formats (Excel to database, JSON API to CSV) or scaffold dashboard components.
Verify it works
If you already ran claude --version during installation and saw a version number, you’re set. Now confirm Claude Code can actually reach the API:
claudeType a simple question like “What is 2 + 2?” and you should get a response. If you do, congratulations — Claude Code is fully working. Press Ctrl+C to exit. You’ll use it for real projects starting in the next module.
When Things Go Wrong
Use the Symptom → Evidence → Request pattern: describe what you see, paste the error, then ask for a fix.
What's the best practice when starting Claude Code for a project?
Setting up a CLI tool might feel like just another install step. It’s not. Every hour you spend learning to direct AI agents compounds — next month you’ll be faster, next quarter you’ll be building things that used to be impossible for you. The specific tool will evolve. Your ability to orchestrate it won’t. If the subscription saves you 5 hours this month, it’s already paid for itself in time alone. The career optionality is the real return.
Key Takeaways
- Install with
npm install -g @anthropic-ai/claude-codeand verify withclaude --version - Authenticate via API key (best for remote/SSH) or Anthropic account (easiest for local use)
- Always start from your project directory — Claude Code reads the files around it to understand context
- Use it as a conversation — describe what you want, refine with follow-ups, don’t try to one-shot everything
- The real workflow: plan mode → think → execute → checkpoint → repeat
- Invest in your tools — Max subscriptions remove per-token anxiety and let you experiment freely