I just finished Anthropic's "Claude Code in Action" course, and I want to break down everything I learned — from installation to advanced workflows — so you can skip the fumbling-around phase and start being productive immediately.
What Is Claude Code, Really?
Claude Code is an agentic coding tool that lives directly in your terminal. Not a VS Code extension. Not a browser tab. Your terminal — the place where you already live as a developer.
What makes it different from pasting code into ChatGPT is the word agentic. Claude Code doesn't just answer questions — it takes action. It reads your files, understands your project structure, runs commands, edits code, manages git workflows, and executes multi-step tasks — all through natural language.
Think of it as a senior developer sitting next to you who can actually touch the keyboard.
Installation and Setup
Getting started takes about two minutes.
# Install globally via npm
npm install -g @anthropic-ai/claude-code
# Navigate to your project
cd your-project
# Launch Claude Code
claude
You'll need an active Anthropic API key or a Claude Pro/Max subscription. On first launch, it'll walk you through authentication — just follow the prompts.
Once you're in, the first command you should run is:
/init
This tells Claude to analyze your project and generate a CLAUDE.md file — essentially a memory file that stores your project's conventions, build commands, tech stack, and patterns. More on this later, because it's one of the most powerful features.
The Command Reference You'll Actually Use
Here's where most guides lose people — they either show you three commands or dump fifty on you with no context. I'm going to walk through every command that matters, grouped by when you'll actually reach for them.
Everyday Essentials
/help — Your safety net. Forgot a command? Start here. It lists everything available with brief descriptions.
/clear — Resets your conversation. Use this more than you think you should. Every time you switch tasks, clear the chat. Old context eats tokens and can confuse Claude about what you're currently working on.
/compact — When your conversation gets long but you're not ready to start fresh, /compact compresses the history while preserving essential context. Think of it as "summarize and continue" — you keep the thread alive without burning through your context window.
/cost — Shows your token usage for the current session. Get in the habit of checking this periodically, especially during long sessions. It helps you understand which types of prompts are expensive and which are cheap.
/status — Quick health check. Shows your current authentication state, model, and session info.
Project Setup and Memory
/init — Generates a CLAUDE.md file by analyzing your project. Run this once when you start using Claude Code in a new repo. It creates a foundation of project knowledge that persists across every future session.
/memory — Opens your CLAUDE.md for direct editing within the session. This is your shortcut to durable customization — every instruction you add here improves every future session.
Here's the thing about CLAUDE.md that the course really emphasizes: it works in a hierarchy.
~/.claude/CLAUDE.md → Global (applies everywhere)
./CLAUDE.md → Project root (applies to this repo)
./CLAUDE.local.md → Local project (gitignored, personal prefs)
./src/tests/CLAUDE.md → Directory-specific (applies in /tests)
Your global file might say "always use TypeScript strict mode." Your project file might say "we use Vitest, not Jest." A subdirectory file might say "tests in this folder follow the AAA pattern." Claude reads them all and prioritizes the most specific one when relevant.
Pro tip: Put your team's coding standards, preferred patterns, and common commands in the project-level CLAUDE.md and commit it. Now every developer on your team gets the same Claude experience.
Code Review and Quality
/review — Triggers a code review of your current changes. This is incredibly useful before committing. Claude examines your diffs and flags potential bugs, security issues, and style inconsistencies.
You can customize the review focus too. Instead of getting a verbose review of everything, tell Claude what to focus on:
/review Focus on security vulnerabilities and potential null pointer exceptions only
Configuration and Troubleshooting
/config — Adjust Claude Code settings like your default model, theme, and behavior preferences.
/doctor — When something isn't working right, /doctor runs diagnostics on your setup. It checks your authentication, network connectivity, configuration, and common issues. Run this before spending twenty minutes debugging manually.
/login and /logout — Manage your authentication. If you switch between accounts or your session expires, these are straightforward.
/bug — Found something broken in Claude Code itself? This command helps you file a bug report directly to Anthropic with relevant context automatically included.
The Shortcuts That Save Hours
Beyond slash commands, there are keyboard shortcuts and syntax tricks that dramatically speed up your workflow.
@ to reference files — Instead of describing which file you mean, just reference it directly:
Look at @src/components/Auth.tsx and fix the login validation
Claude will read that specific file and work with it. You can reference multiple files in a single prompt.
Tab for autocomplete — When typing file paths after @, hit Tab to autocomplete. It works just like your shell's tab completion.
Escape — Cancels Claude's current response mid-stream. Changed your mind about a prompt? Hit Escape and the generation stops immediately.
Ctrl+C — Interrupts the current operation. Useful when Claude is running a command that's taking too long or you realize you asked for the wrong thing.
# to add memory notes — Prefix a message with # and it won't be sent as a regular prompt. Instead, Claude will offer to save that information directly to your CLAUDE.md memory file. It's a quick way to build up your project memory while you work:
# We use Vitest for testing, never Jest
# All API responses follow the { data, error } pattern
Think of it as a self-documenting shortcut — jot down conventions and patterns the moment you encounter them, without breaking your flow.
! to run shell commands — Prefix any command with ! to run it directly in your terminal without leaving the Claude session:
!npm run test
Extended Thinking: When You Need Claude to Really Think
One of the most powerful features covered in the course is extended thinking. By default, Claude responds quickly with standard reasoning. But for complex problems — architectural decisions, tricky debugging, multi-file refactors — you want Claude to think deeper.
You can trigger this by simply asking Claude to "think harder" or "think step by step" about a problem. The course also mentions explicit thinking keywords:
- "think" — Standard extended reasoning
- "think hard" — More thorough analysis
- "ultrathink" — Maximum reasoning depth
The difference is noticeable. For simple tasks, standard mode is fine and faster. For "why is this race condition happening across three services" — you want ultrathink.
The Permissions Model: Your Safety Net
Claude Code uses a layered permissions system, and the course spends real time on this because it matters.
When Claude wants to do something potentially impactful — editing a file, running a shell command, making a network request — it asks for permission first. You'll see prompts like:
Claude wants to run: npm install lodash
Allow? (y/n/always)
The three permission categories are:
- Read — Which files Claude can see
- Edit — Which files Claude can modify
- Bash Commands — Which terminal commands Claude can execute
You can pre-approve commands to avoid repetitive prompts:
# Allow all npm test commands
/permissions allow "npm run test:*"
The course emphasizes a principle that stuck with me: treat Claude like a powerful but untrusted intern. Give it only the permissions it needs. Don't blanket-allow everything. If you're working on a personal project and want to move fast, you can be more permissive. In a production environment, lock it down.
MCP: Connecting Claude to Your Tools
MCP — Model Context Protocol — is what takes Claude Code from "smart terminal assistant" to "integrated development platform." It's an abstraction layer that lets Claude interact with external tools and services.
Want Claude to query your database directly? Set up a database MCP server. Want it to run Playwright tests and read the results? There's an MCP server for that. Want it to interact with your project management tool? Same idea.
Configuration lives in .claude/settings.json:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@anthropic-ai/mcp-playwright"]
}
}
}
Once configured, Claude can invoke these tools naturally during your conversation. You ask "run the E2E tests for the login flow," and Claude uses the Playwright MCP server to execute them and report back.
The key insight from the course: put MCP config in your repo's .claude/settings.json and commit it. Now every team member gets the same tool integrations automatically.
Custom Slash Commands: Your Personalized Shortcuts
This is one of those features most people miss, and it's genuinely powerful.
Create a .claude/commands folder in your project, add markdown files named after your commands, and write the instructions in natural language:
<!-- .claude/commands/deploy-check.md -->
Run the following checks before deployment:
1. Run the full test suite
2. Check for any TypeScript errors
3. Verify no console.log statements in production code
4. Review the git diff for any sensitive data
Report results as a checklist with pass/fail for each item.
Now you can run /deploy-check anytime. You can also use $ARGUMENTS for dynamic input:
<!-- .claude/commands/explain.md -->
Explain the function or module at $ARGUMENTS in simple terms.
Include: what it does, why it exists, and how it connects to the rest of the codebase.
Usage: /explain src/utils/auth.ts
A word of caution from the course: don't go overboard. Keep custom commands simple and personal. If your slash command is fifty lines long, that logic probably belongs in your CLAUDE.md instead.
Headless Mode and CI/CD Integration
This is where Claude Code gets seriously interesting for teams.
Headless mode (--print or -p) runs Claude without the interactive interface — perfect for scripts, automation, and CI/CD pipelines:
# Use in a script
claude -p "Review the changes in this PR and list any security concerns"
# Pipe output
claude -p "Generate a changelog from the last 10 commits" > CHANGELOG.md
In CI/CD, you can use Claude Code for automated code reviews, PR descriptions, test generation, and more:
# Example GitHub Action step
- name: AI Code Review
run: |
claude -p "Review the diff in this PR. Focus on bugs and security issues. Output as markdown." > review.md
For security in CI/CD, use the --allowedTools flag to restrict exactly which tools Claude can access:
claude -p --allowedTools "Read,Grep,Glob" "Analyze this codebase for dead code"
This prevents an injected prompt from triggering destructive actions in your pipeline.
Hooks: Deterministic Control Over Claude's Behavior
Hooks are shell commands that execute automatically at specific points during Claude's workflow. They're the "must-do" rules that complement the "should-do" suggestions in your CLAUDE.md.
You can configure hooks through the interactive /hooks command or by editing your settings JSON directly. Common hook events include things like running before Claude processes your prompt, after it edits a file, or before it commits code.
Example use case: automatically run your linter every time Claude edits a file, ensuring every change meets your code standards before you even review it.
Prompt Engineering Tips for Claude Code
The course covered practical prompting strategies that are specific to a terminal-based agentic tool — different from how you'd prompt a chat interface:
Be specific about scope. Instead of "fix the bugs," say "fix the null pointer exception in @src/auth/login.ts on line 42."
Use multi-step instructions for complex tasks. Claude handles sequential instructions well:
1. Read the test file at @tests/auth.test.ts
2. Identify which tests are failing
3. Fix the implementation in @src/auth.ts to make them pass
4. Run the tests to verify
Start fresh often. Use /clear between unrelated tasks. Context pollution is real and it degrades response quality.
Front-load context. If Claude needs to know something about your project that isn't in CLAUDE.md, say it at the beginning of your prompt, not the end.
Let Claude explore. Instead of telling Claude exactly which file to look at, sometimes it's better to say "find where we handle user authentication" and let it search. It's surprisingly good at codebase navigation.
Cost Management: Keeping Your Bill Reasonable
A few practical tips from the course:
-
Use
/compactproactively — Don't wait until you hit context limits. Compact every 15-20 exchanges in a heavy session. -
Use
/clearbetween tasks — Fresh context is cheaper than bloated context. -
Check
/costregularly — Awareness alone changes behavior. - Match thinking depth to task complexity — Don't use "ultrathink" for renaming a variable.
-
Write good
CLAUDE.mdfiles — The better your memory files, the less back-and-forth Claude needs, which directly reduces token usage. - Use headless mode for repetitive tasks — Scripted one-shot prompts are typically cheaper than interactive sessions for simple operations.
Common Workflows That Just Work
Here are the patterns I use most after finishing the course:
The Morning Standup:
/clear
What changed in this repo in the last 24 hours? Summarize the recent commits and any open PRs.
The Bug Fix Flow:
There's a bug where users can submit the form without filling in required fields.
Find where form validation happens, fix it, write a test, and run the test suite.
The PR Prep:
/review
Fix whatever it flags, then:
Write a clear commit message and create a PR description summarizing these changes.
The "I Just Joined This Project" Flow:
/init
Explain the architecture of this project. What are the main modules,
how do they connect, and where should I look first?
What I Wish I Knew Before Starting
A few things that would have saved me time:
CLAUDE.mdis everything. Invest thirty minutes writing a good one. It pays dividends in every single session.You don't need to be precise with prompts. Claude Code is remarkably good at figuring out what you mean. "Make the login page look nicer" actually works.
Let it run commands. The instinct is to do everything yourself and just ask Claude for code snippets. Resist that. Let it run your tests, read your logs, check your git status. That's where the agentic magic happens.
Clear your context aggressively. The number one mistake beginners make is letting a session run too long with too much accumulated context.
MCP servers are worth the setup time. Even one or two well-configured MCP integrations dramatically expand what Claude can do for you.
Getting Started Today
Here's your five-minute quickstart:
npm install -g @anthropic-ai/claude-code
cd your-project
claude
/init
Then just start talking to it. Ask it to explain your codebase. Ask it to fix something. Ask it to write a test. The barrier to entry is genuinely low — the hard part isn't learning the tool, it's unlearning the habit of doing everything yourself.
Claude Code isn't going to replace you. But a developer who knows how to use Claude Code well is going to be significantly more productive than one who doesn't. The course made that clear, and a week of daily use has made it obvious.
The terminal just got a whole lot more interesting.
Top comments (0)