Lesson 3.112 min · 5 cards · 8 exercises · 1 mission

Built-in slash commands worth knowing

The slash commands for each moment of the day: a new repo, mid-task, before you ship, between sessions and when something breaks.

Type / in Claude Code and you get a long list: dozens of commands, with a few more in every release. You don't need to memorise them all, and nobody does. A more useful approach is to remember commands by the moment you need them: opening a new repo, in the middle of a task, before you ship, between sessions, and when something goes wrong. This lesson walks through a working day on todo-api in that order.

What slash commands are

Slash commands control Claude Code from inside a session: switching models, managing permissions, clearing context, running a workflow. Type / to open the list and a few letters to filter it.

Three small rules people often trip over:

  • A command only counts at the start of a message. /compact in the middle of a sentence is just text.
  • Whatever follows the command name is its arguments, as in /code-review high 1234.
  • If you send a command while Claude is replying, it is queued and runs when the current turn ends. A few, such as /status, /tasks and /usage, run immediately without interrupting.

The list holds two kinds. Built-in commands such as /clear and /context run fixed logic inside the CLI. Bundled skills such as /code-review, /doctor and /debug are different: they are a detailed prompt handed to Claude, which then uses its tools to do the work. The docs' commands table marks the second kind as Skill. The distinction matters in lesson 3.2, when you write your own commands: those are skills too.

Starting with a repo

The first time you work in a repo, four commands set things up for every later session:

  • /init writes a starting CLAUDE.md, as in lesson 2.2.
  • /memory opens the memory files so you can trim them.
  • /mcp sets up and manages the MCP servers the project needs (level 5).
  • /permissions sets rules for which tools are allowed or ask first.

For todo-api, you did the first two in level 2. The other two come back in later levels.

In the middle of a task

These are the commands you'll use most:

  • /plan switches into plan mode before a big change: Claude researches and proposes, and changes nothing until you approve (lesson 1.3).
  • /model and /effort change the model and how much reasoning Claude puts in. This is the real control for "think harder", not typing those words into a prompt (lesson 1.2).
  • /context shows what's filling the context window. When a session has run long and answers slow down, look at /context before guessing.
  • /compact summarises the conversation to free space. The project-root CLAUDE.md is re-read after compaction (lesson 2.2).
  • /btw asks a side question without adding it to the conversation history. Fixing an endpoint and suddenly want to check some JavaScript syntax? Ask with /btw so the main task stays focused.

Before you ship

When Claude says it's done, don't commit straight away. Three commands help you check:

  • /diff shows what changed. This is where the three diff-reading questions from lesson 1.3 come in.
  • /code-review checks the current diff for correctness bugs. Add --fix to have Claude apply the findings. Pass a PR number, such as /code-review high 1234, to review a pull request instead of the local diff. /review is another name for the same command. /code-review ultra runs a multi-agent review in the cloud for large changes.
  • /security-review checks the diff for security vulnerabilities.

Remember from lesson 1.2: /code-review runs in a fresh subagent that hasn't seen your conversation, so it isn't swayed by the reasoning that produced the code. That independent look catches mistakes the author tends to miss.

Between sessions

A normal day strings several tasks together. Four commands keep the hand-offs clean:

  • /clear starts a new task with a clean context while keeping project memory. A good habit is /clear whenever you move to something unrelated.

    Why bother, when current models have large context windows and compaction happens on its own? Because running out of space isn't the point. A focused context gets you better answers and costs less: Claude isn't rereading a morning's worth of unrelated work on every turn, and nothing from the previous task leaks into the next one.

  • /resume returns to an earlier conversation.

  • /branch branches the current conversation so you can try another direction without losing this one.

  • /fork copies the conversation into a new background session, leaving this one free for something else.

And /tasks lists the session's background work, including subagents that have finished. Level 4 uses it a lot.

When something goes wrong

  • /rewind rolls code and conversation back to a checkpoint, or summarises part of a conversation that has gone stale (lessons 1.2 and 1.3).
  • /doctor checks your installation and configuration, diagnoses problems and can fix them. In level 2 you saw it suggest cuts to CLAUDE.md.
  • /debug diagnoses problems that happen at runtime.
  • /feedback reports a bug to Anthropic with the session's context attached.

A day on todo-api touches nearly every group: /plan in the morning for the restore endpoint, /btw for a side question and /context as the session grows, /diff and /code-review in the afternoon before committing, and /clear before the next task.

Next lesson: when you keep typing the same instructions, it's time to turn them into a slash command of your own.

Practice lesson 3.1

5 flashcards, 8 exercises checked right on the page, 1 mission on your machine.

Start practice

Related reference

Type to search the reference, templates and lessons.