M
MeshWorld.
claude-code ai developer-tools productivity 10 min read

Claude Code Cheatsheet: 16 Commands That Do the Heavy Lifting

Vishnu
By Vishnu
| Updated: Mar 27, 2026

Claude Code is Anthropic’s terminal-based AI coding assistant. It runs in your shell, reads your repo, and takes real actions — editing files, running tests, committing code. Most people use it like a smarter chatbot. Power users run it like a system. This Claude Code cheatsheet covers the 16 commands and features that get you to 80% of the value, skipping the stuff you’ll never actually touch. Whether you’re onboarding a new codebase or wiring up multi-agent pipelines, these are the ones worth knowing.

:::note[TL;DR]

  • Use /init, /plan, /context, and /compact to set up and manage every session
  • Switch models and modes instantly with /model and Shift + Tab
  • Delegate parallel work with /agents and automate repeated tasks with /loop
  • Control browsers with /chrome, ask side questions with /btw, undo with /rewind
  • Use ultra think when the problem is actually hard :::

How do I set up Claude Code for a new project?

/init — generate your repo memory

Run /init at the start of any new project. Claude Code reads your codebase and writes a CLAUDE.md — a plain-English file it will reference in every future session. Think of it as onboarding notes, written by the AI that just read everything.

The Scenario: You’ve inherited a half-documented Node monorepo from a developer who left the company. You don’t know what runs what. Run /init and Claude Code maps the entry points, the environment variables it needs, and the rough structure of what it found. You now have a starting point instead of a blank stare.


/plan — think first, code later

Gives Claude Code a planning pass before it touches anything. It writes out what it intends to do, you read it, and only then does it start making changes.

The Scenario: You ask it to “refactor the auth module.” Without /plan, it just starts deleting things. With /plan, it tells you it’s going to split the middleware into two files and update five import paths. You catch that one of those files has a legacy dependency you weren’t ready to touch. Crisis avoided.


/context — see what’s eating your tokens

Shows a breakdown of what’s currently loaded into the context window. Useful when responses start getting slow or you’re worried you’re about to run into limits mid-task.

The Scenario: You’ve been in a session for two hours. Claude starts giving shorter answers and misses things it caught earlier. You run /context and realise you’ve got three large files loaded that aren’t relevant anymore. Time to clean up.


/compact — free up context mid-session

Compresses the conversation history to save token space without losing the thread of what you’re working on. Use it before starting a new subtask in a long session.

The Scenario: You’ve debugged a gnarly race condition and now you want to write the tests for the fix. The whole debugging conversation is still loaded. Run /compact to summarise it and clear space for the next phase.


/clear — reset between tasks

Full wipe. Context gone, conversation gone, fresh start. Use this between unrelated tasks so Claude Code doesn’t bleed assumptions from one job into the next.

The Scenario: You finished a CSS refactor and now want to work on a database migration. They’re completely unrelated. If you don’t /clear, Claude Code carries forward irrelevant file context and gives worse suggestions. This takes two seconds and saves you confused outputs.


How do I control which model Claude Code uses?

/model — switch between Opus, Sonnet, and Haiku

Lets you change the model mid-session. Opus is slower and more thorough. Sonnet is the default — fast and capable. Haiku is the cheap option for simple, repetitive tasks.

The Scenario: You’ve been using Sonnet all day. Now you’ve got a really subtle bug that’s been alive for three weeks and you can’t figure it out. Switch to Opus with /model for this one problem, then switch back. Don’t burn Opus credits on boilerplate.


Shift + Tab — switch modes instantly

Cycles between auto mode (Claude acts immediately), plan mode (reviews before acting), and ask mode (only responds, never acts). Fast mode is also togglable. No need to type anything.

The Scenario: You’re in a flow state and Claude Code keeps asking for confirmation before every tiny file edit. Shift + Tab into auto mode and let it run. When you’re closer to production and want eyes-on before every change, Shift + Tab back to plan mode.


--dangerously-skip-permissions — full auto mode

A CLI flag you pass at startup. Claude Code stops asking for permission on any action — file writes, shell commands, git commits. No interruptions.

The Scenario: You’re running a batch refactor across 40 files and every permission prompt is breaking your concentration. You know what it’s doing, you’ve reviewed the plan, and you just want it to finish. Launch with this flag. Audit the diff when it’s done, not during.

:::warning Don’t use this on production systems or repos you don’t fully control. It really does skip everything. :::


How do I get Claude Code to review my code properly?

/simplify — three agents review your code together

Runs three sub-agents in parallel: one checking for reuse opportunities, one looking at quality, one checking efficiency. They each report back and Claude Code surfaces the issues that actually matter.

The Scenario: You wrote a data-fetching hook that works but feels off. You could ask Claude Code to “review this,” and you’d get a generic response. Run /simplify and you get three distinct perspectives in one shot — one of them points out you’re re-creating a utility that already exists in the codebase.


/permissions — pre-allow safe actions

Lets you define which actions Claude Code can take without prompting you every time — specific shell commands, file paths, or operations. Saves repetitive approvals in long sessions.

The Scenario: You’re doing a lot of npm run test and git add and git status throughout a session. Without pre-allowed permissions, every one is an interruption. Set them once with /permissions at the start and get out of your own way.


How do I ask a side question without losing my place?

/btw — ask without breaking flow

Lets you ask a clarifying question or make a side comment without it being treated as a new instruction. The session context stays intact.

The Scenario: You’re in the middle of a refactor and you suddenly wonder if a specific library is still maintained. You don’t want to derail the session. Use /btw "is zustand still actively maintained?" — you get an answer and the task keeps running.


/rewind — undo when things go off track

Rolls back to a previous checkpoint in the session. The changes Claude Code made get undone and you can try a different approach.

The Scenario: You asked Claude Code to restructure a folder and it did it in a way that breaks three unrelated imports. You could spend time manually fixing the cascade, or you just /rewind to before it started and rephrase the instruction with more constraints.


How do I run multiple things in parallel with Claude Code?

/agents — run sub-agents in parallel

Spins up multiple Claude Code instances to handle separate tasks at the same time. Each agent works independently, then reports back.

The Scenario: You have three unrelated bug tickets to close before EOD. Instead of doing them one by one, you describe all three and kick off /agents. While agent one is untangling a CSS bug, agent two is fixing a broken API call, and agent three is updating outdated docs. You review three finished diffs instead of context-switching three times.


/chrome — control a browser

Gives Claude Code a browser. It can click, fill forms, navigate pages, and scrape content. Useful for testing UI flows or automating web tasks.

The Scenario: You’ve deployed a form fix and want to verify it works without clicking through it manually. Tell Claude Code what to do and /chrome executes the whole interaction while you watch. It’s also useful when you need to grab structured data from a page that doesn’t have an API.


/loop — run prompts on repeat

Runs a command or prompt on a recurring interval. Useful for monitoring tasks, polling for a status change, or running a periodic check during a long deploy.

The Scenario: You’re waiting for a staging deploy to propagate and you want to know the moment it’s live. Set up a /loop that checks the endpoint every two minutes and notifies you when the response changes. You go make coffee without babysitting the terminal.


When should I use “ultra think”?

ultra think — max reasoning depth

Adding “ultra think” (or just “think harder” / “think step by step”) to your prompt tells Claude Code to use extended reasoning before responding. It doesn’t switch models — it uses more of the current model’s reasoning capacity.

The Scenario: You’ve got a memory leak that only happens under a specific race condition in production. Normal prompts get you generic advice. “Ultra think: why would this async handler leak memory only when two requests arrive within 50ms of each other?” — that’s when it earns its keep. It’s slower. It’s worth it for the right problem.


Summary

  • Session hygiene matters: /init once per project, /clear between unrelated tasks, /compact when sessions run long.
  • Match the model to the task: Sonnet for daily work, Opus for hard problems, Haiku for cheap repetition.
  • Parallelise: /agents is the biggest productivity shift for anyone with multiple tickets open at once.
  • /plan and /rewind are your safety net — use them when the task has real consequences.
  • ultra think isn’t magic, but it’s real — save it for problems that have already beaten you once.

FAQ

What’s the difference between /compact and /clear? /compact summarises and compresses the conversation to save token space while keeping the session alive. /clear wipes everything — full reset. Use /compact mid-task, /clear between unrelated tasks.

Does /agents cost more? Yes. Each sub-agent is a separate model call. For big parallel jobs it’s worth it. For a single task, it’s overkill.

Is --dangerously-skip-permissions safe to use? It depends entirely on your setup. Fine for local dev on your own machine when you know what Claude Code is doing. Never use it on a shared environment or when Claude Code has access to anything you can’t roll back.

Can I use ultra think with any model? Yes. It works with Sonnet and Opus. On Haiku, the effect is minimal — the model doesn’t have enough reasoning capacity for it to make a meaningful difference.

Does /chrome work without extra setup? You need the browser MCP configured. Once it is, /chrome works in any session. Check the Claude Code docs for the setup steps — it takes about five minutes.