Claude Code for Clinicians Chapter 21

Chapter 21: Ten Slash Commands Worth Memorizing

A slash command is a shortcut typed at the start of a line inside Claude Code, beginning with a forward slash (/). It is not a programming command; it is an instruction to Claude Code itself rather than to the model. Think of it as a hotkey for things you’d otherwise have to do through a menu.

There are dozens of slash commands. You only need ten in muscle memory. Here they are.


1. /init

Use case. First day in a new repository. You want a CLAUDE.md (the project’s instruction file) but you don’t want to write one from scratch.

What it does. Scans the codebase — your file structure, your test commands, your dependencies — and drafts a starter CLAUDE.md. Per Chapter 20, you then cut the result in half so it actually earns its keep.

Without /init, every new project starts cold. With it, Claude already knows your stack, your test command, and your folder layout before you say a word.

2. /clear

Use case. You finished pulling tomorrow’s clinic list. You now want to write a totally unrelated R analysis. Don’t carry the clinic-list conversation into the R work.

What it does. Wipes the conversation, keeps the project. The most-used command in any serious user’s day, and the one beginners reach for the least.

🧠 Remember. A clean 30-minute conversation beats a confused three-hour one. /clear is how you get there.

3. /compact

Use case. You’re three hours into a productive session and the context bar in the corner says you’re at 70%. You don’t want to lose what you’ve built up, but you also can’t keep adding to a session that’s about to overflow.

What it does. Summarizes everything so far and continues with the summary in place of the full transcript. Always pass an argument so Claude knows what to preserve: /compact focus on the cohort schema decisions and the eval cases we identified. Without an argument, compaction sometimes drops the thread you cared most about.

4. /rewind

Use case. You asked Claude to refactor a Cox regression script and the new version is worse. You want to go back to the version before the refactor without manually undoing the edits.

What it does. Opens a list of every prompt from your current session and lets you jump back to any point. Restore the code only, the conversation only, or both. The keyboard shortcut is Esc Esc (press Escape twice on an empty input line). This is your “I changed my mind” for ideas you were only 40% sure about.

5. /model

Use case. You’re running a long batch classification on patient feedback comments — cheap, mechanical work. Why pay Opus prices for it?

What it does. Switches the model mid-session. Useful patterns:

Match the model to the task and your monthly bill drops in half. Model names and versions change every few months; /model on its own always shows the current menu.

6. /cost

Use case. End of the day. You want to know what this session actually cost.

What it does. Shows what the session has consumed — dollars on API billing, plan-usage percentages on a Pro or Max subscription. /stats opens the same display on its statistics tab, with token counts and a per-model breakdown. Check it before lunch and before you leave. The number is the fastest way to learn which kinds of work are expensive (long architectural conversations on Opus) and which are nearly free (bulk Haiku classification). Pricing intuition is half of using the tool well.

7. /permissions

Use case. You’re tired of approving pytest every five minutes, but you don’t want to use --dangerously-skip-permissions.

What it does. Opens an interactive editor for the allowlist and deny list without forcing you to hand-edit JSON. Tick the boxes for commands you trust; Claude writes the result to .claude/settings.json. Check that file into git and your whole team inherits the same trust settings. This is the recommended alternative to dangerous shortcuts.

8. /agents

Use case. You want a specialized helper — a strict security reviewer, a quick Haiku-based search agent, a docs writer — that you can summon by name later.

What it does. Opens the subagent manager. You can create new specialists (see Chapter 13), give each a description, a model, and an allowed tool list, and save them to .claude/agents/. Once saved, you can summon any of them by description: “Use the security-reviewer to check this file before commit.” Five minutes of setup per agent; it pays off forever.

9. /btw

Use case. You’re deep in a session and you want to ask a side question — “why did you choose that approach?” — without that question and its answer cluttering the conversation history that /compact would later summarize.

What it does. Opens a side conversation overlaid on the main one. You get the answer; the main transcript stays clean. The side question sees everything already in the conversation but cannot use tools, so it answers instantly from what Claude already knows. Small command, big effect on long sessions.

10. /statusline

Use case. You realized halfway through a session that you’d been on Opus for two hours of trivial work. If only you’d known.

What it does. Installs a live heads-up display at the bottom of your terminal: current folder, git branch, context-window usage percentage, model in use. You run it once per laptop and it persists. After installing it, you start noticing things — “I’m at 78% of my context, time to /compact” — that you never would have noticed otherwise. Visibility pays.


Honorable mentions

A few that didn’t make the top ten but earn their keep:

Try This

Create a personal slash command of your own. Make a file at ~/.claude/commands/aidi-eval.md (the tilde ~ means your home folder) with this content:

---
description: Run the deceased-patient eval suite and report deltas
---
Run the eval suite at aidi_catalog.dbo.eval_runs against the frozen
deceased-patient cohort. Compare counts to yesterday's baseline.
Report each delta with the patient MRN (Optimus-encoded only) and the
diff in the structured output. Do not proceed if any case was skipped.

You now have /aidi-eval available in every Claude Code session, on every project, forever. Multiply this by twenty rituals — /check-phi, /regen-figures, /build-report — and you have built yourself a personal command line.

Watch Out

Don’t try to memorize every slash command; you’ll forget half of them by Friday. Memorize these ten, and learn /help so you can find the rest when you need them. The goal is fluency, not encyclopedic recall.