Slash Commands = Claude Code’s Shortcuts
When you tell Siri “commute,” it turns off the alarm, starts navigation, and plays music all at once. One word triggers multiple automatic actions.
Claude Code’s slash commands work the same way. A short command starting with / handles complex tasks in one go. Think of them as keyboard shortcuts for the chat interface.
| Smartphone Shortcuts | Claude Code Slash Commands |
|---|---|
| "Commute" → alarm off + navigation + music | /init → auto-generate CLAUDE.md |
| "Good night" → alarm set + silent + lights off | /compact → summarize conversation + save memory |
| "Meeting" → start recording + open notes | /status → view current state at a glance |
| Ctrl+C (copy) | /copy (copy conversation content) |
| Ctrl+Z (undo) | Esc (cancel input) |
One-line summary
Slash commands = keyboard shortcuts for the Claude Code terminal. Type / and the list of available commands appears — no memorization needed.
9 Essential Commands — All You Need
Claude Code has many slash commands, but 9 are the ones worth knowing from the start. Sorted by frequency of use.
/help
Shows help. Lists available commands, shortcuts, and usage. When in doubt, start with /help.
/copy
Copies Claude’s last response to clipboard. Handy for pasting results elsewhere. You can specify a number to copy a specific response.
/clear
Wipes conversation history clean. Use when starting a new topic. No carryover from previous context.
/compact
Summarizes conversation to save memory. Essential when conversations get long. Saves tokens while keeping context.
/init
Auto-generates a CLAUDE.md file. Best to run first when starting a new project. Analyzes project structure automatically.
/config
Changes Claude Code settings. Adjust model, theme, allowed tools, etc.
/status
Shows current state at a glance. Check model, MCP connections, settings, and usage.
/model
Switches the AI model. Toggle between available models like Sonnet, Opus, etc.
/fast
Switches to fast mode (Haiku). The quick model is efficient for simple questions. Switch back with /model.
Type / to see the list
Type / in the Claude Code chat and available commands automatically appear. No memorization needed — just type / and pick from the list.
Slash Commands = Power User’s Secret Weapon
Control everything from the keyboard, no mouse needed
/copy — Instantly Copy Results
When Claude generates code or writes a report, you often want to paste it somewhere else — into an email, document, or send to a colleague.
Dragging to select with a mouse is tedious, especially for long code where getting the selection range right is tricky./copy does it in one word.
Basic Usage
/copyThis copies Claude’s last response to your clipboard. Just Ctrl+V to paste.
Copy a Specific Response
/copy 3Adding a number copies only the 3rd response. Useful in long conversations for grabbing a specific result.
Great for these situations
After code generation
Paste generated code into another file or editor
After report writing
Send analysis results directly to email or Slack
After command suggestions
Run Claude’s suggested command in another terminal
Sharing with colleagues
Forward Claude’s explanation to chat or Slack
Copies in Markdown format
Content copied via /copy is in Markdown format. Paste it into Notion, GitHub, Slack, or any Markdown-supporting platform and the formatting is preserved.
/compact — The Key to Saving Memory
Long Claude Code conversations consume more tokens, make Claude slower, cost more, and in the worst case exceed the context limit, making it impossible to continue.
/compact solves this by summarizing to just the essentials, drastically reducing memory usage.
| Metric | Before /compact | After /compact |
|---|---|---|
| Conversation length | Full 200-line conversation | 20-line key summary |
| Response speed | Slower (long context analysis) | Faster (short context) |
| Token usage | High consumption | Significantly reduced |
| Context maintained | Everything kept | Only essentials kept |
Basic Usage
/compactOne word and done. Claude analyzes the conversation and keeps only key decisions, file changes, and progress — summarizing the rest.
Custom Summary Instructions
/compact Only remember the API integration part. Forget the rest.Adding instructions lets you tell Claude what to prioritize. Especially useful when the work direction has changed.
When to Use It
If you've been chatting 30+ minutes or exchanged 20+ messages, use it
If responses take longer than usual, the context has gotten too long
When starting a new task unrelated to the previous one, clean up
This is urgent. Use /compact immediately
/compact vs /clear
/compact summarizes the conversation./clear completely deletes it. /compact keeps context, /clear starts from zero. Usually try /compact first; only use /clear when you truly need a fresh start.
/init — Auto-Generate CLAUDE.md
Starting a new project? The first thing to do is create a CLAUDE.md file. This tells Claude Code what the project is and how to work on it.
Writing it from scratch is tedious. Type /init and Claude analyzes your project structure to automatically create CLAUDE.md.
/initWhat /init Does
Automatically reads folder structure, package.json, config files, etc.
Figures out what technologies are used: React, Next.js, Python, etc.
Auto-records project description, structure, build commands, etc.
Asks if you want to add CLAUDE.md to git
# CLAUDE.md
## Project Overview
Next.js 14 App Router + Tailwind CSS + TypeScript website.
## Development Commands
- npm run dev — Start dev server
- npm run build — Production build
- npm run lint — Run linter
## Directory Structure
- app/ — Page routes
- components/ — Reusable components
- lib/ — Utility functions
- public/ — Static filesEdit after auto-generating
The CLAUDE.md from /init is a starting framework. Add your own rules like “API keys read from .env” or “write commit messages in English” to make it even better.
/model & /fast — Switch Models
Claude Code supports multiple AI models. Choose the right one per task to optimize speed and cost.
Switching Models
/modelType /model to see the list of available models and pick one.
Quick Mode Switch
/fast/fast is a shortcut to switch to the fastest model (Haiku) instantly. Good enough for simple questions and minor fixes.
| Model | Characteristics | Best For |
|---|---|---|
| Opus | Smartest but slowest | Complex design, long code, tough bugs |
| Sonnet | Balanced (default) | Most everyday tasks |
| Haiku (/fast) | Fastest but for simple tasks | Typo fixes, simple questions, file renames |
Switching strategy
Usually work in Sonnet (default), switch to /fast for quick tasks, and to Opus via /model for hard problems. Switch freely within the same session.
Create Custom Commands (Skills)
The built-in slash commands are great, but for repetitive tasks, you can create your own slash commands called Skills.
Instead of typing “write the commit message in English with conventional format” every time, just type /commit and it’s done.
How to Create — .claude/commands/ Folder
Create this folder in your project root
E.g.: commit.md, review.md, deploy.md
Detail what you want Claude to do
Type /commit in Claude Code and it executes
# Commit Automation
1. Check changes with git diff --staged
2. Analyze changes and write a commit message
3. Commit message rules:
- Write in English
- Convention: feat: / fix: / content: / chore:
- Title under 50 chars + body
4. Show the commit message to the user for approval
5. If approved, run git commit/commitReal-World Custom Command Examples
/review
Automatically run a code review
Analyze changes in the current branch and do a code review.
Check for potential bugs, performance issues, and code style.
Mark severity (High/Medium/Low)./daily
Generate a daily work summary report
Analyze files I modified and commits today.
Create a daily work report:
- Completed tasks
- Number of files changed
- Remaining TODOs (based on TODO comments)
Format as clean Markdown./test
Auto-generate test code
Write tests for the $ARGUMENTS file.
- Include both success and error cases
- Test framework: vitest
- Filename: originalname.test.ts$ARGUMENTS captures arguments after the command. Typing /test src/utils/calculator.ts replaces$ARGUMENTS with src/utils/calculator.ts.
Personal vs project commands
.claude/commands/ are project-wide commands. For personal commands, create them in ~/.claude/commands/ (home folder). They work anywhere, regardless of project.
Keyboard Shortcuts
Beyond slash commands, Claude Code has useful keyboard shortcuts for fast mouse-free work.
| Shortcut | Action | When to use |
|---|---|---|
Esc | Cancel current input | Changed your mind while typing |
Ctrl+C | Stop current task | Claude is taking too long |
Tab | Accept suggestion | Accept Claude's proposed action immediately |
Shift+Tab | Reject suggestion | Proposal isn't what you want |
Up/Down | Navigate previous/next input | Reuse a previous command |
Ctrl+L | Clear screen | Terminal screen is too cluttered |
Frequently Used Combos
1. Esc — Most-used key
When you think “wait, that’s not right” while typing, press Esc. Input disappears and you start fresh. If it hasn’t been sent to Claude yet, nothing happens — safe to press anytime.
2. Ctrl+C — Emergency stop button
If Claude is working but heading in the wrong direction, Ctrl+C stops it. Then say “cancel that and do this instead” with new instructions.
3. Tab — Accept suggestions
When Claude suggests a file edit or command, pressing Tab accepts immediately. No need to type “sure, go ahead.”
The secret to speed
Power users barely touch the mouse, using slash commands + keyboard shortcuts./compact → give instructions → Tab (accept) →/copy (copy result) → paste. Master this flow and your speed doubles or triples.
Try It Yourself
Reading alone won’t click. Open Claude Code and follow these exercises.
Exercise 1: Basic Commands (5 min)
Open Claude Code and enter these commands in order.
/help
# → Check if help appears
/status
# → Check current model and settings
Hello! Nice weather today.
# → Get a response from Claude
/copy
# → Check if the response copies to clipboard (test with Ctrl+V)Exercise 2: Experience /compact (5 min)
Have a longer conversation, then try /compact.
# Chat several times first
Explain this project's structure.
# (after response)
Analyze the package.json.
# (after response)
Summarize the README.
# (after response)
# Then run compact
/compactVerify the conversation gets condensed into a short summary. Test that context is maintained in subsequent messages.
Exercise 3: Create a Custom Slash Command (10 min)
The most fun exercise. Create your own command.
Create a .claude/commands/hello.md file.
Content: "Hello! Show me the current time and today's to-do list."
Then test that the /hello command works.Verification Checklist
Can’t remember a slash command? Just type /. The autocomplete list appears so you can pick from there. No memorization needed.
Tips + Sources
Practical tips for more effective slash command usage.
1. Make /compact a habit
If you’ve been chatting 30+ minutes, always /compact. Clean up before Claude gets slow. Don’t worry about doing it too early — key context is preserved.
2. Share custom commands with your team
Commit .claude/commands/ to Git and the whole team gets the same commands. Standardize /commit, /review, /deploy as team conventions.
3. Use /model to manage costs
No need for the top model on every task. Simple edits with /fast, complex design with Opus. Switching models at the right time saves both speed and tokens.
4. Use /clear carefully
/clear permanently deletes the conversation. Can’t be undone. /compact is usually sufficient, so save /clear for when you truly need a fresh start.
5. Turn frequent tasks into commands
If you think “I’m typing this prompt again,” make it a custom command immediately. Takes 5 minutes to create, saves time every time after. Tell Claude “turn this task into a slash command” and it creates the file in .claude/commands/ automatically.
Slash Commands = Compound Interest on Time
Use /compact to protect memory,/copy for instant results, and custom commands to eliminate repetitive work. Small habits compound into 2-3x productivity.
Start with just /
Remember one thing today: type / in the Claude Code chat. All available commands appear as a list. Pick one and try it — you’ll learn naturally. No memorization needed.
References
- Anthropic Official Claude Code Docs — docs.anthropic.com/en/docs/claude-code/cli-usage
- Claude Code Settings Guide — docs.anthropic.com/en/docs/claude-code/settings
- Claude Code Skills (Custom Commands) — docs.anthropic.com/en/docs/claude-code/slash-commands