Excellent AI Prompts

Excellent AI Prompts

The 28 Essential Claude Code Commands I Use Most Often, Explained | Cheat Sheet

What each one does, when to use it, and a real example for every single one +

Excellent AI Prompts's avatar
Excellent AI Prompts
Jun 14, 2026
∙ Paid

You’re reading Excellent AI Prompts.

AI prompt chains, agent skills, and agentic workflows for professionals learning to use AI to earn more, think sharper, and live better.
Copy them. Use them. Build with them.

Claude Code is Anthropic’s agentic coding tool that lives in your terminal, and most of what makes it fast to drive comes down to two kinds of commands: the slash commands you type inside a running session, and the CLI commands and flags you use to launch and script it. If you have ever found yourself pasting the same instructions into the chat over and over, or wishing you could steer a session without breaking your flow, the commands below are the answer. This guide walks through what each category does and when to use it.

This guide assumes you already have Claude Code installed and running; if you do not, the install steps and a quick start live in the official documentation at code.claude.com. Everything below works the same whether you are on the free tier or a paid plan, though a few features noted along the way are paid-only.

Official documentation: see the macOS and Windows setup guides at code.claude.com/docs/en/setup.

In this issue

  • Slash commands for steering a live session

  • Setting up the project

  • Configuring the session

  • Planning the work

  • Managing context as you work

  • Running work in the background

  • Reviewing what was built

  • Recovering and moving on

  • Diagnosing problems

  • Wrapping up

  • Turning repeated instructions into skills

  • Launching and scripting CLI commands from the terminal (or PowerShell)

  • Putting it together

Slash commands for steering a live session

A command is only recognized at the very start of your message, and any text after the command name gets passed to it as an argument or prompt. The fastest way to explore is to type a single slash to bring up the full menu, then keep typing letters to filter it down. Using these commands is mostly intuitive, but it helps to think about them in terms of a workflow.

Here are the commands you will likely use most often, grouped roughly in the order they come up, with a note on what each one does.

To make these concrete, the examples under each command follow a single project from start to finish: building a personal portfolio website, a small static site with a hero, a projects grid, an about section, and a contact form. The commands below are ordered roughly the way you would use them on that project, from setting up the repository through to shipping and reviewing the final result.

Quick reference

  1. /init: generate a starter CLAUDE.md, run once per repo

  2. /memory: edit your CLAUDE.md and auto-memory entries

  3. /mcp: connect and manage MCP servers

  4. /agents: configure and dispatch subagents

  5. /permissions: set allow, ask, and deny rules for tools

  6. /model: switch model and set the default

  7. /effort: set how much reasoning effort to spend

  8. /config: open settings (alias: /settings)

  9. /plan: enter plan mode before touching code

  10. /goal: keep working across turns until a goal is met

  11. /context: visualize context-window usage

  12. /compact: summarize the conversation to free up context

  13. /btw: ask a quick side question off the main thread

  14. /tasks: manage background work (alias: /bashes)

  15. /background: detach the session as a background agent (alias: /bg)

  16. /batch: run large-scale parallel changes across the codebase

  17. /loop: run a prompt on repeat while the session stays open (alias: /proactive)

  18. /diff: view uncommitted changes and per-turn diffs

  19. /code-review: review the current diff, with an ultra option for a deeper cloud pass

  20. /review: read-only review of a pull request locally

  21. /security-review: scan pending changes for vulnerabilities

  22. /clear: start a fresh conversation, keeping project memory

  23. /resume: resume an earlier conversation (alias: /continue)

  24. /branch: branch the conversation to try another direction

  25. /rewind: roll code and chat back to a checkpoint (aliases: /undo, /checkpoint)

  26. /doctor: diagnose your installation and settings

  27. /debug: turn on debug logging to troubleshoot

  28. /usage: see cost, limits, and stats (aliases: /cost, /stats)

Share Excellent AI Prompts

Setting up the project

/init

Generates a starter CLAUDE.md file that captures your project’s conventions, structure, and commands. Run it the first time you open Claude Code in a repository so future sessions start with useful context already loaded.

Portfolio example: run /init in your new portfolio repo or folder so Claude knows that it is building a static HTML, CSS, and vanilla-JS site (describe what you want to build)

My example for this issue, a fiction author’s portfolio site:

/memory

User's avatar

Continue reading this post for free, courtesy of Excellent AI Prompts.

Or purchase a paid subscription.
© 2026 Excellent AI Prompts · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture