The Complete Claude Code Guide — Every Command, Shortcut, and Workflow I Figured Out the Hard Way

The Complete Claude Code Guide — Every Command, Shortcut, and Workflow I Figured Out the Hard Way

I spent three weeks using Claude Code before I realized I'd been doing almost everything wrong. Not wrong as in broken — wrong as in "driving a Ferrari in first gear and wondering why it sounds weird." A cheat sheet hit the front page of Hacker News last weekend with almost 500 upvotes, and scrolling through it felt like someone had compiled every slap-my-forehead moment I had during those first three weeks into a single page. So I figured I'd do what that cheat sheet couldn't: give you the context behind the commands, the workflows that actually matter, and the mistakes I made so you can skip them entirely.

What Claude Code Actually Is (And What It Isn't)

Claude Code is Anthropic's CLI-based AI coding assistant. Not a chatbot in your browser. Not a VS Code extension. It's a command-line tool that reads your codebase, writes files, runs shell commands, and essentially acts as a senior developer sitting inside your terminal. Think of it as the anti-Copilot. If you have been following the rise of open-source AI coding agents like OpenCode, Claude Code takes a similar philosophy but goes further. Where Copilot autocompletes your lines, Claude Code operates at the project level — it understands directory structures, can refactor across multiple files simultaneously, and runs tests to verify its own work. I first installed it expecting something like ChatGPT with file access. What I got was closer to having a pair programmer who never sleeps, occasionally hallucinates, and types about 400x faster than me.

Installation Takes Thirty Seconds

If you have npm installed, it's one command:
npm install -g @anthropic-ai/claude-code
Then just run claude in any project directory. It will index your codebase and you're off to the races. You need an Anthropic API key or a Max subscription — there's no free tier, and honestly, after using it for a month, I'd pay double.

The Keyboard Shortcuts Nobody Tells You About

Here's where that cheat sheet really opened my eyes. I had been typing full commands like some kind of cave person when half of these have keyboard shortcuts.

The Essential Five

Ctrl+C cancels whatever Claude is currently generating. Sounds obvious, but I spent my first week letting bad generations finish before starting over. Don't be me. Ctrl+L clears the screen. Not the conversation — just the visual clutter. I use this compulsively now. Ctrl+R is reverse search through your prompt history. If you asked Claude to "refactor the authentication module" yesterday and want to ask something similar, this saves you from retyping it. Escape twice — this one blew my mind — lets you rewind or undo the last interaction. Like an undo button for AI conversations. I wish every AI tool had this. Shift+Tab cycles between permission modes: Normal, Auto-Accept, and Plan. Auto-Accept mode is the "I trust you, just do it" mode. Plan mode is the "show me what you'd do before doing it" mode. I run in Plan mode for anything touching production code and Auto-Accept for greenfield projects.

The Power User Shortcuts

Alt+P switches your model mid-conversation. Running Sonnet for quick tasks and switching to Opus for complex refactors without leaving the session? Chef's kiss. Alt+T toggles thinking mode. When Claude is stuck on something complex, flip this on and watch it reason through the problem step by step. It burns more tokens but the output quality jump is noticeable. Ctrl+V pastes an image directly into the conversation. I've used this to show Claude a screenshot of a bug and say "fix this." It worked. I felt like I was living in the future.

The Slash Commands That Actually Matter

Claude Code has something like 30 slash commands. You need maybe eight of them regularly.

Daily Drivers

/compact — This compresses your conversation context. When you've been going back and forth for a while and Claude starts losing track of what you discussed earlier, run this. You can even add a focus keyword like /compact authentication to make it prioritize keeping auth-related context. /diff — Interactive diff viewer. Before I discovered this, I was switching to a separate terminal to run git diff. This shows you exactly what Claude changed, inline, with syntax highlighting. /cost — Shows your token usage for the current session. I check this about once an hour. My record is $12 in a single session during a particularly intense refactoring day. My average is about $2-4 per working session. /resume — Picks up where you left off. Claude Code sessions persist, so if you close your terminal and come back tomorrow, this gets you right back into the conversation with full context.

The Underrated Ones

/plan — Puts Claude into planning mode where it outlines what it would do before touching any code. I use this for anything that touches more than three files. It's saved me from at least a dozen "wait, why did you change that?" moments. /branch — Branches the conversation. Say you're exploring two different approaches to a problem. Branch, try approach A, then go back and try approach B. It's like git branches but for your AI conversation. /btw — A side question that doesn't pollute your main context. "BTW, what's the default timeout for fetch in Node 20?" gets answered without Claude thinking it's related to what you're working on.

The CLAUDE.md File Is Your Secret Weapon

This is the single most important thing I learned, and I learned it embarrassingly late. Claude Code looks for a file called CLAUDE.md in your project root and treats it as persistent instructions. Think of it as a README that only Claude reads. My typical CLAUDE.md includes: - Project architecture overview - Coding conventions (we use tabs, not spaces — fight me) - Testing requirements ("always run tests after modifying a service") - Common pitfalls ("the auth module uses a custom JWT implementation, do not replace with jsonwebtoken") - File organization rules Here's the thing that makes this powerful: CLAUDE.md survives conversation compaction. When Claude runs /compact and throws away old messages, it keeps CLAUDE.md front and center. So your project rules are never forgotten. "I asked my friend Dave, who runs a 50-person engineering team, what made Claude Code actually stick for his developers. His answer was immediate: 'The moment we wrote a good CLAUDE.md, the tool went from a novelty to a necessity.'"

CLAUDE.md Location Hierarchy

There are actually three levels: 1. Project-level: ./CLAUDE.md — shared with your team via version control 2. Personal: ~/.claude/CLAUDE.md — your preferences across all projects 3. Organization: /etc/claude-code/ — managed org-wide policies Personal is where I keep things like "I prefer functional patterns over class-based" and "explain changes briefly, not verbose." Project-level gets the architecture docs.

MCP Servers: The Feature Most People Ignore

Model Context Protocol (MCP) servers let Claude Code connect to external tools. MCP adoption is accelerating — even WordPress recently added MCP support for AI agents. Database, API docs, monitoring dashboards — anything with an MCP server becomes part of Claude's context. The setup lives in .mcp.json at your project root. Three transport types: - HTTP (recommended) — remote server - stdio — local process - SSE — remote server-sent events I run an MCP server pointed at our staging database. "What's the schema for the users table?" no longer requires me to open DBeaver. Claude just... knows. The new Elicitation feature means MCP servers can even ask YOU for input mid-task. Say Claude hits an MCP endpoint that needs clarification — instead of failing silently, it pops up a prompt.

Workflows That Changed How I Code

The Bug Fix Pipeline

My friend at a startup described this to me over coffee and I've stolen it wholesale: 1. Paste the error message or screenshot (Ctrl+V) 2. Claude reads the relevant files automatically 3. It proposes a fix in Plan mode 4. I review, approve, it implements 5. It runs the tests 6. /diff to review changes 7. Done Average bug fix time went from 25 minutes to about 6 minutes. That's not hyperbole — I tracked it for two weeks.

The Refactoring Dance

For large refactors, I use worktrees. The --worktree flag isolates each feature branch into its own working directory, so Claude can make sweeping changes without risking your main branch. The new /batch command auto-creates worktrees for parallel changes. I used it to split a monolithic Express app into microservices — five worktrees running simultaneously, each handling a different service extraction. It felt like cheating.

The Voice Mode Nobody Expected

/voice enables push-to-talk. Hold Space, describe what you want, release. Claude hears you and codes accordingly. Voice mode supports 20 languages including many covered by top AI translation tools. I thought this was a gimmick until I tried it while eating lunch. Turns out, dictating "add pagination to the user list endpoint with a default page size of twenty" while eating a sandwich is peak productivity. Supports 20 languages. My colleague uses it in German and says it understands his accent better than Siri does.

Cost Management (Because This Isn't Free)

Claude Code can burn through tokens fast. The --max-budget-usd 5 flag caps your spend per session. I set mine to $10 for normal work and remove the cap for major refactors. The /effort command (low/medium/high) controls how hard Claude thinks. Low effort for simple questions, high for complex architecture decisions. I hover at medium most of the time and bump to high maybe three or four times a day. Here's a pricing reality check from my last month: - Simple questions/fixes: $0.05-0.15 per interaction - Medium refactors: $0.50-2.00 per session - Major architecture work: $5-15 per session - Total monthly: ~$180 (worth every penny)

Common Mistakes and How to Avoid Them

Mistake 1: Not using /compact enough. Claude's context window is huge (1M tokens on Opus) but that doesn't mean you should fill it with irrelevant conversation history. Compact early, compact often. Mistake 2: Auto-accepting everything. Auto-Accept mode is tempting. It's also how I once let Claude delete a configuration file it thought was "unused." It was not unused. Use Plan mode for anything you care about. Mistake 3: Ignoring the @ mention syntax. Typing @src/auth/jwt.ts explicitly brings that file into context. I used to say "look at the JWT file" and hope Claude found the right one. The @ syntax is deterministic — use it. Mistake 4: Not piping input. cat error.log | claude -p "what's wrong?" is faster than copying and pasting error logs. I do this probably ten times a day.

The Bottom Line

Claude Code isn't just another AI coding tool. It's a fundamentally different way to interact with your codebase. The learning curve is about a week — you'll be productive on day one, but you won't be efficient until you internalize the shortcuts and workflows. Start with CLAUDE.md. Learn the five essential shortcuts. Use Plan mode until you trust it. And for the love of everything, install it with npm install -g @anthropic-ai/claude-code instead of reading about it for another week. I spent three weeks being mediocre at it. You can skip that entirely.

Found this helpful?

Subscribe to our newsletter for more in-depth reviews and comparisons delivered to your inbox.