Kalqore
All posts

Claude Code tutorial

18 Claude Code commands that save you time and money

14 min readBy @thebrokenapp (opens in a new tab)

At a glance

Eighteen commands, one line each

Bookmark this table. The sections below explain each one.

CommandWhat it doesReach for it when
/advisor opusWhat it does:A cheaper model does the work and consults a stronger one at key momentsReach for it when:You want Opus-level judgment without Opus-level bills
/goal …What it does:Claude keeps working, turn after turn, until a condition is metReach for it when:The end state is checkable: tests pass, build is green
/exportWhat it does:Copies or saves the whole conversation as plain textReach for it when:You need a second opinion from a person or another AI
/rewindWhat it does:Rolls code, conversation or both back to an earlier promptReach for it when:Claude just broke something that worked
/btw …What it does:Answers a side question without adding it to the historyReach for it when:You need a quick fact mid-task
/plan …What it does:Claude researches and proposes a plan before editing anythingReach for it when:The change touches more than a couple of files
/initWhat it does:Writes a CLAUDE.md file that briefs Claude on your projectReach for it when:First session in any project
/contextWhat it does:Shows what is filling the context window, as a gridReach for it when:Claude starts forgetting things or slowing down
/compactWhat it does:Summarises the conversation so far to free up spaceReach for it when:The session is long but you are not done
/branchWhat it does:Copies the conversation so you can try a different directionReach for it when:You want to experiment without losing your place
/security-reviewWhat it does:Checks your branch’s changes for security holesReach for it when:Before you merge or launch anything
/verifyWhat it does:Builds and runs your app to check a change really worksReach for it when:Tests pass but you don’t trust it yet
/usageWhat it does:Shows session cost and how much of your plan limit is leftReach for it when:You want to know where the money went
/loop 5m …What it does:Runs a prompt on repeat while the session is openReach for it when:You’re waiting on a deploy, a build or a queue
/remote-controlWhat it does:Lets you continue this session from claude.ai on another deviceReach for it when:You have to leave your desk mid-task
/insightsWhat it does:Builds a report on how you use Claude CodeReach for it when:You want to know what to do better
/fewer-permission-promptsWhat it does:Pre-approves the safe commands you keep saying yes toReach for it when:Claude asks permission for the same thing every time
/copyWhat it does:Copies Claude’s last answer, or one code block from itReach for it when:You need the answer somewhere else
Save money

/advisor: a cheap model with a smart one on call

Sonnet or Haiku does the typing. Opus or Fable steps in for the hard decisions.

Opus and Fable are the strongest models, and the most expensive. But most of what Claude does in a session is routine: reading files, making small edits, running tests. That work doesn’t need the top model.

With the advisor on, you run a cheaper model as your main one. When it reaches a decision that matters, like choosing an approach, getting stuck on an error that keeps coming back, or checking its work before saying it’s done, it consults the stronger model. The advisor reads the whole conversation and sends back guidance.

Turn it on
/model sonnet/advisor opus

Run /advisor on its own to pick from a list, and /advisor off to turn it off. Your choice is saved for future sessions. When Claude consults it, you’ll see an Advising line; press Ctrl+O to read what the advisor said.

Good pairings

  • Sonnet + Opus advisor: the sensible default for most projects.
  • Haiku + Opus advisor: the cheapest setup that still plans well.
  • Sonnet + Fable advisor: Fable’s judgment at the decision points, if your plan includes Fable.
Save prompts

/goal: set the finish line once

No more “fix this, no, fix that”. Claude keeps going until the condition is true.

Normally Claude finishes a turn and hands control back to you, even when the job is half done. With a goal set, a separate model checks after every turn whether your condition is met. If not, Claude starts the next turn on its own.

Example
/goal npm test exits 0 and no test file is modified, or stop after 20 turns

Setting a goal starts work immediately, so you don’t need a separate prompt. Run /goal on its own to see progress, turns used and tokens spent. Run /goal clear to stop early.

Write a condition Claude can prove

The checker doesn’t run commands or read files. It only reads the conversation. So write a condition that shows up in Claude’s output:

  • One measurable end state. “All tests pass”, not “the app works well”.
  • How to prove it. “npm run build exits 0”.
  • What must not change. Without “no test file is modified”, the quickest way to pass a test is to edit the test.
  • A limit. Add “or stop after 20 turns” so a stuck goal doesn’t run all afternoon.
Share

/export: hand the whole session to someone else

Send it to a colleague, a friend, or another AI for a second opinion.

Sometimes you want a teammate to see how a bug was tracked down, or you want ChatGPT or Gemini to review what Claude did. Copying a long terminal session by hand is painful. /export does it in one step.

Two ways
/export                      # choose: copy to clipboard, or save to a file/export login-bug-session.txt  # write straight to this file
Undo

/rewind: go back to before it went wrong

Claude messed up? Pick an earlier prompt and restore the code, the conversation, or both.

Claude Code saves a checkpoint of your files every time you send a prompt. Run /rewind, or press Esc twice with an empty prompt, and you’ll see a list of your earlier prompts. Pick one, then choose what to restore:

  • Code and conversation: as if the later messages never happened.
  • Conversation only: keep the files, go back in the chat.
  • Code only: undo the file changes, keep the discussion so Claude remembers what didn’t work.

Checkpoints are kept with the session, so rewind still works after you close and resume it.

Stay focused

/btw: a side question that leaves no trace

Ask something small without cluttering a long, detailed session.

You’re deep into a session and need to know one small thing: which file had the config, what a function was called, why Claude chose one approach over another. Asking normally adds that to the history, and every extra message makes the session longer.

Example
/btw which file did we put the Stripe webhook in?

The answer pops up in an overlay. Press Space, Enter or Esc to dismiss it, and the main conversation carries on as if you never asked. It works even while Claude is busy, and it’s cheap.

Think first

/plan: review the plan before Claude touches a file

Catch the wrong approach while it’s still one paragraph, not forty edited files.

In plan mode, Claude reads your code and writes a plan, but doesn’t edit anything. You read the plan, push back, and only then let it build. This is the single best habit for bigger changes.

Example
/plan add Google sign-in to the app

You can also press Shift+Tab to cycle into plan mode.

Set up

/init: brief Claude on your project once

Stop re-explaining your stack at the start of every session.

/init scans your project and writes a CLAUDE.md file: how to run it, how it’s organised, which commands test and build it. Claude reads that file at the start of every session, so it already knows the basics.

Then add your own rules to it, like “use Tailwind, not inline styles” or “never touch the payments folder”. Run /memory to open and edit it.

Diagnose

/context: see why Claude is getting forgetful

A colored grid of everything filling Claude’s memory for this session.

Claude can only hold so much at once. That space, the context window, fills up with your messages, files it read, tool output, your CLAUDE.md and any connected tools. When it’s nearly full, Claude starts losing track of earlier details.

/context shows what is using that space and suggests what to trim. If one connected tool or a huge file is taking a big share, you’ll see it straight away.

Free up space

/compact: shrink a long session, keep going

Summarise the conversation so far and carry on in the same session.

When /context shows the window filling up and you’re not done, /compact replaces the history with a summary. You can tell it what matters most:

Example
/compact keep the database schema and the list of bugs still open

Finished with one task and moving to another? Use /clear instead. It starts a fresh conversation but keeps your CLAUDE.md.

Experiment

/branch: try another direction, keep the original

Fork the conversation like you’d branch code.

You’re halfway through and want to try a riskier approach, but you don’t want to lose the session as it stands. /branch makes a copy of the conversation at this point and switches you into it. The original stays as it was, and /resume takes you back to it.

Example
/branch try-redis-cache
Ship safely

/security-review: catch the holes before users do

A security check on everything you changed, in one command.

AI-written code works, but it often skips the boring safety parts: checking who is logged in, cleaning what users type, keeping keys out of the browser. /security-review reads the changes on your current branch and flags risks like injection, broken login checks and leaked data.

Run it before you merge
/security-review
Prove it

/verify: check the app works, not just the tests

Claude builds your app, runs it and looks at the result.

Passing tests and a clean build don’t prove a feature works. The button can still do nothing, or the page can still be blank. /verify has Claude build your app, run it, use the change the way a person would, and report what actually happened.

After Claude says it’s done
/verify
Track spend

/usage: see what this session cost

Session cost, plan limits and activity stats in one screen.

If you’re trying the advisor setup from section 01, this is how you check it’s saving money. /usage shows what the session has cost so far and, on a paid Claude plan, how much of your limit is left and what’s using it up. /cost opens the same screen.

Automate

/loop: repeat a prompt on a timer

Let Claude keep an eye on something while you do other work.

/goal keeps going until a condition is met. /loop repeats on a clock instead. It’s for anything you’d otherwise check by hand every few minutes.

Examples
/loop 5m check if the deploy finished and tell me if it failed/loop check the error logs and fix anything new

Leave out the interval, like the second example, and Claude decides how long to wait between runs.

Go mobile

/remote-control: carry on from your phone

Leave your desk without leaving the session.

Claude is halfway through a long task and you have to go. /remote-control (or /rc) makes the session available on claude.ai, so you can follow along, answer Claude’s questions and send new prompts from your phone or another computer.

Improve

/insights: a report on how you use Claude Code

Where you spend your sessions, where they go wrong, and what to try next.

/insights reads your recent sessions on this computer and builds a report you open in the browser: which projects you work in, how you use Claude Code, where things tend to go wrong, and features you haven’t tried. It’s the quickest way to find your own bad habits.

Fewer interruptions

/fewer-permission-prompts: stop saying yes to the same thing

Pre-approve the safe commands you approve every single time.

If you click “yes” to git status or ls twenty times a day, this one is for you. It scans your past sessions for read-only commands you keep approving and adds them to an allow list, so Claude stops asking.

Small but handy

/copy: grab Claude’s answer cleanly

No more dragging the mouse across a terminal.

Selecting text in a terminal picks up line breaks and spacing that weren’t in the answer. /copy copies Claude’s last reply to your clipboard exactly as written.

Examples
/copy     # the last answer/copy 2   # the answer before that

If the answer has code blocks, a picker lets you copy just the one you need. Press w in the picker to save it to a file instead.

Practice

Try them all this week

Each takes under a minute. Tick them off as you go.

0 of 19 ticked

Set up once
During a task
When things go sideways
Before you ship
Once a week

That’s eighteen. Type / in Claude Code and you’ll find dozens more; the full commands reference lists every one. Start with /plan and /rewind: one stops mistakes, the other undoes them.

And when your project grows past what one person and an AI can comfortably run, that’s the kind of system Kalqore builds.

Launching soon?

Want a second pair of eyes on it before it goes live?

Kalqore builds and runs production software. Tell us what you are shipping and we will tell you where it is likely to break.

Let’s talk (opens WhatsApp in a new tab)
All posts