Five Claude Code commands worth knowing.
A command in Claude Code is a word starting with a slash that you type into the prompt box, like /context. There are more than a hundred of them in the official list, and most people only ever use a few. I picked five that help when you make content: undo a bad change, ask a quick side question, see how full Claude's working memory is, shrink a long chat on purpose, and save a conversation as text.
- session: one conversation with Claude Code, from when you start it until you close it.
- token: the unit Claude counts its working memory in, roughly three quarters of a word.
- prompt: the message you send to the AI.
- terminal: a window where you type commands instead of clicking, such as PowerShell on Windows.
- Claude Code installed and signed in, which needs a paid Claude plan or an Anthropic Console account. If you have not installed it yet, follow the install guide first.
- Type each command inside Claude Code, in the message box where you talk to Claude, and press Enter, not in PowerShell. When you type / and a few letters, Claude Code filters the list for you.
The famous "secret codes" are not commands
You may have seen a video about "secret Claude codes" such as /ghost, /godmode or /L99. They are not commands. Claude Code answers that the command "isn't installed in this session" and treats your message as a normal request. At the end of a sentence they are ignored.
The commands below are in the official command list, and each one does something you can see. I picked the five that help someone who writes, edits or plans content rather than code.
1. /rewind: undo Claude's last move
What this is: an undo button for Claude's work. It goes back to an earlier message in the chat, and it can also put your files back the way they were at that moment.
Type this inside Claude Code, in the message box
> /rewind
When it saves you. You ask Claude to rewrite a client brief, it changes six files, and the result is worse than what you started with. Instead of arguing it back, you open the menu, pick your message from before the rewrite, and choose Restore code and conversation. You are back at the start, as if the rewrite never happened. Pressing Esc twice on an empty prompt opens the same menu.
The menu also offers Restore conversation, which keeps the new files and forgets the chat, and Restore code, which keeps the chat and undoes the files.
You should see a list of the messages you sent in this chat, and after you choose one, a short list of the options above.
Tip: /rewind puts back the files Claude edited directly. Keep your normal backups for everything else.
2. /btw: ask without cluttering the chat
What this is: a side question that Claude answers from the chat so far and then forgets. It never becomes part of the conversation.
Type this inside Claude Code, in the message box
> /btw what was the name of the file with the interview questions?
When it saves you. Claude is in the middle of a long job, such as turning a transcript into ten posts, and you suddenly wonder which hook you approved an hour ago. If you ask in the normal chat, your question and its answer stay in the conversation and use up space. With /btw the answer appears in a small window, and when you press Esc the main chat is exactly as it was. You can even ask while Claude is still working, and it does not interrupt the job.
You should see your answer in a small window over the chat, and nothing new in the chat itself after you close it.
It answers from the conversation so far. For anything new, ask in the normal chat.
3. /context: see how full Claude's memory is
What this is: a gauge for Claude's working memory. It shows how much of it is already used and by what.
Type this inside Claude Code, in the message box
> /context
When it saves you. Claude starts forgetting what you said at the beginning, or its answers get vaguer, and you wonder whether its working memory is full. Before you add a new plugin or paste in another long document, /context tells you whether there is room.
This is what it printed in a brand new chat:
| Category | Tokens |
|---|---|
| Own instructions of Claude | 1.8k |
| Built-in tools | 6.6k |
| Extra tools, loaded only when needed (not counted in the total) | (7.9k) |
| Skills (built in) | 2.2k |
| Messages | 10 |
| Free space | 956.4k of 1m |
It also works on a longer conversation. After one request for a 400 word announcement plus a list of ideas, the Messages line rose from 10 to 4.8k tokens.
These numbers are estimates, not a bill. With plugins installed, the tools and skills lines will be larger, which is exactly what you want to see.
4. /compact with a focus: shrink the chat and keep what matters
What this is: it replaces the long conversation with a short summary, so Claude keeps working without running out of room. The part most people miss is that you can tell it what to keep.
Type this inside Claude Code, in the message box
> /compact focus on the launch date and the guest, drop the episode ideas
When it saves you. You have spent two hours on one client, the chat is huge, and you want to carry on without starting from scratch. Plain /compact lets Claude guess what matters. Adding a sentence tells it what to keep.
In a fresh chat I asked for a podcast announcement and five episode ideas, and gave three facts to remember: launch date March 3, guest Maria, sponsor Oat Mill. Then I ran the command above.
| Step | Messages in /context |
|---|---|
| Before | 4.8k tokens |
| After /compact | 2.6k tokens |
Tip: what you drop is gone from the chat, so keep anything you still need. Claude Code also compacts by itself when memory is nearly full, and this command lets you do it earlier, on your terms.
5. /export: take the conversation with you
What this is: saves the whole conversation as a plain text file, or copies it to the clipboard.
Type this inside Claude Code, in the message box
> /export client-notes.txt
When it saves you. You worked out a content plan with Claude and want to paste it into Notion, send it to a client, or keep it before you clear the chat. With a file name the command writes the file straight away, and without one it opens a small window where you choose copy or save. If you only want the last answer, /copy does that, and /copy 2 takes the one before it.
You should see either a new text file with your conversation in the folder Claude Code is working in, or a window with the options copy and save.
Three more worth knowing
/recap writes a one line summary of the session, up to 400 characters. It is handy when you come back after lunch and have forgotten where you were.
/branch makes a copy of the conversation at this point so you can try another direction and return to the original with /resume.
/insights builds a report about how you have been using Claude Code. It reads your recent sessions, so think about which work you want it to look at before you run it.
If something fails
It says: /export isn't available in this environment
Menu commands such as /rewind, /btw and /export only work in a normal live chat. If you start Claude Code with claude -p, they say they are not available. Open Claude Code the usual way and type them there.
Claude says the command looks like a path, such as C:/Program Files/Git/context
This happens in Git Bash on Windows, which rewrites anything that starts with a slash. Use PowerShell, type the command inside a live Claude Code chat, or set MSYS_NO_PATHCONV=1 first.
It says the command "isn't installed in this session"
The word is not a real command. Check the spelling against the official list.
How to get the best result
Type / and a few letters to see the commands that fit, and try each one on a small chat first. Run /context before you add a plugin or paste a long document, and /compact with a focus sentence when a chat gets long. Your command list may look a little different from this page.
Want more on this? Follow my content and check my other posts.
Get the next guide when it is ready.
One email a week at most, and you can leave whenever you like.