Most developers use Claude Code like a chatbot that happens to live in the terminal.
They type a question, get an answer, maybe copy-paste some code.
There are 20 commands in this tool that most people never touch, ranked by how much time they save and some of them will make you wonder how you shipped anything without them.
Before we dive in, I share daily notes on AI & vibe coding in my Telegram channel: https://t.me/zodchixquant🧠
Getting started
The basics that most people skip or use wrong.
1. claude
What it does: Opens Claude Code in your terminal.
Just type claude in your terminal and you're in.
But here's what most people miss: Claude Code isn't a chatbot.
It reads your files, runs commands, edits code, and manages git workflows on its own. You describe what you want in plain English and it figures out which files to read, what commands to run, and what changes to make.
Stop thinking "I'll ask Claude a question" and start thinking "I'll give Claude a task."
2. claude "refactor the auth module"
What it does: Starts a session with a task already loaded.
You can start a session with an initial prompt instead of typing it after launch. Sounds minor but it changes how you work because you start treating Claude Code like a command you run rather than a chat you open.
Each of these runs as a single task with clean context. No leftover history from previous conversations polluting the output.
3. claude -c and claude -r "name"
What it does: Picks up where you left off.
-c continues your most recent session.
-r resumes a specific one by name.
And if you want to name a session for later, use -n:
Instead of one giant conversation where context gets noisy, you keep separate named sessions for separate work streams and jump between them cleanly.
4. /clear
What it does: Resets context between tasks.
This is genuinely the most important habit to build in Claude Code.
Every message you send, every file Claude reads, every command output it processes accumulates in a shared 200K token context window. And performance degrades as that fills up.
A Claude session at 90% context usage isn't just slower, it's measurably dumber. Important instructions get buried and the model starts making mistakes it wouldn't make with a clean window.
The rule is simple: /clear between distinct tasks.
Finished implementing a feature and ready to fix a bug? Clear.
Think of it as closing 30 browser tabs before starting new work.
5. /compact
What it does: Frees up memory without nuking everything.
Sometimes you don't want to nuke everything but your context is getting heavy. /compact compresses the conversation history without losing it entirely.
Claude summarizes what happened so far and keeps working with a lighter context.
Use /context to check how full your window is before deciding between /clear and /compact. If you're above 70%, compact or clear. Don't let it hit 90% +
Speed tricks
The commands that make you noticeably faster once they become muscle memory.
6. Esc to stop, Esc Esc to rewind
What it does: Stops Claude or undoes its work instantly.
Esc stops Claude mid-action without losing context. You can redirect immediately. This is not Ctrl+C which exits the entire session.
Esc Esc opens a scrollable menu of every checkpoint Claude has created. You can restore the code, the conversation, or both.
Four options: code and conversation, conversation only, code only, or summarize from a checkpoint forward.
This means you can try an approach you're only 40% sure about. If it works, great. If not, rewind in seconds with zero damage done.
7. !command
What it does: Runs shell commands without leaving Claude.
Type !git status or !npm test and the command runs immediately. The output lands in context so Claude can see the result and act on it.
It's faster than asking Claude to run a command because there's no permission prompt and no "let me run that for you" overhead.
8. git diff main | claude -p "review for security issues"
What it does: Instant code review from your terminal.
You can pipe anything into Claude Code. This one command replaces 90% of what you'd use a dedicated code review tool for:
The -p flag runs Claude non-interactively, meaning it processes the prompt and exits. Perfect for scripts, CI/CD pipelines, and Unix pipes.
9. -p for scripting and automation
What it does: Turns Claude into a CLI tool for scripts and pipelines.
The -p flag is where Claude Code stops being a chat tool and becomes infrastructure. Non-interactive mode means you can embed it in scripts, cron jobs, and pipelines:
Once you realize Claude Code has a non-interactive mode with JSON output and schema validation, you start seeing automation opportunities everywhere.
10. /clear between tasks (yes, again)
What it does: Keeps every task running on clean context.
Listed twice because it's that important. The single biggest mistake developers make with Claude Code is running everything in one long session.
Context fills up, quality drops, and they blame the model instead of their workflow.
Clean context, clean output. Every time!!
Power user
The commands that separate people who use Claude Code from people who use Claude Code well.
11. claude -w feature-branch
What it does: Works in an isolated branch without touching main
This is one of the most underused features. Claude creates an isolated git worktree, does all its work there, commits changes, and optionally creates a PR.
Your main branch stays completely untouched.
Claude will create a temporary worktree from your current branch, implement the feature in isolation, commit the changes, and clean up when done. If something goes wrong, your main codebase was never touched.
12. claude --permission-mode auto
What it does: Stops asking permission for every action.
By default, Claude Code asks permission for everything.
"Can I edit this file?" "Can I run npm test?"
It's safe but it's incredibly slow if you're doing anything beyond trivial tasks.
Auto mode uses an AI safety classifier that reviews each action before it runs, checking for risky behavior and prompt injection while letting routine work proceed without prompts.
Think of it as a middle ground between clicking "yes" every 30 seconds and --dangerously-skip-permissions.
13. --allowedTools for scoped permissions
What it does: Controls exactly what Claude can and can't do.
Instead of all-or-nothing permissions, you can scope exactly what Claude is allowed to do for a specific task:
Or lock it down in your project settings at .claude/settings.json:
This is how you give Claude enough freedom to be useful without giving it the keys to production.
14. --max-budget-usd 5.00
What it does: Caps your spending per session.
Set a hard spending limit per session. Claude stops when it hits the cap instead of burning through tokens on a task that's going in circles.
--max-turns is the complementary flag that limits how many back-and-forth iterations Claude can do.
Both are essential for CI/CD pipelines where you want predictable costs.
15. --add-dir for multi-repo context
What it does: Gives Claude visibility across multiple directories.
If your project spans multiple directories or repos, you can tell Claude about all of them:
Claude only scans the directories you specify, reducing noise and keeping context focused on what matters for the current task.
Advanced workflows
16. CLAUDE.md
What it does: Teaches Claude your project once, forever.
A markdown file at the root of your project that loads automatically every time Claude Code starts a session.
Think of it as project-level instructions that Claude follows without you having to repeat them.
That last line is important. Telling Claude to run tests and fix failures before finishing gives you a 2-3x quality improvement according to Boris Cherny, the creator of Claude Code.
You're essentially giving Claude a feedback loop so it catches its own mistakes.
17. Hooks for automatic formatting
What it does: Auto-formats code every time Claude edits a file.
Every time Claude edits a file, your formatter should run automatically. Instead of reminding Claude to format its code or fixing it manually, add a PostToolUse hook:
The difference between CLAUDE.md and hooks: CLAUDE.md is advisory, Claude follows it about 80% of the time.
Hooks are deterministic, they run 100% of the time. If something must happen every single edit without exception, make it a hook.
18. /install-github-app
What it does: Auto-reviews every PR you push.
Run this once and Claude will automatically review your PRs on GitHub. As you use more AI tools, your PR volume increases, and having an automated reviewer that actually understands your codebase keeps quality from slipping.
Works especially well in a Writer/Reviewer pattern: use Claude Code to write the code, then let the GitHub app review it with fresh context.
19. TDD workflow
What it does: Write tests first, then build. 2-3x better code.
This isn't a single command but a pattern that produces dramatically better code. Instead of asking Claude to implement something and hoping it works, tell it to write tests first:
Then in a separate prompt:
The tests serve as a contract. Claude knows exactly what "done" looks like before it starts writing. Two-step prompting like this produces remarkably clean code because the specification is explicit rather than implied.
20. Parallel sessions with agent teams
The most advanced workflow: decompose a large change into independent units and spawn one Claude agent per unit, each in its own worktree. Every agent works in isolation and opens its own PR.
Three features shipping simultaneously while you review PRs as they come in. This is where Claude Code stops being a tool and becomes a team you manage.
The cheat sheet
Bookmark this. You'll come back to it.
I share daily notes on AI, finance, and vibe coding in my Telegram channel: https://t.me/zodchixquant
Previous articles: 10 Claude Workflows That Save Me 10+ Hours a Week | Subscriptions You Can Replace with Claude
Thanks for reading🙏🏼




