← All Posts

How to Use Claude Code Slash Commands: Complete Guide

Claude Code slash commands are keyboard shortcuts that let you execute predefined tasks instantly without retyping long prompts. Using commands like /login, /logout, /status, and /usage keeps you in flow by eliminating context switching. For developers managing usage limits on Pro or Max plans, these commands provide instant visibility into your remaining allocation—preventing the frustration of hitting a 5-hour lockout mid-project. You can also create custom commands in .claude/commands/ to automate your own workflows.

  • Built-in commands handle authentication, status monitoring, and plan management
  • /status and /usage show real-time usage allocation across Claude and Claude Code
  • Custom commands use Markdown files in .claude/commands/ or ~/.claude/commands/

What are slash commands in Claude Code?

Slash commands are shortcuts you type into Claude Code starting with a forward slash (/) to run specific, pre-defined tasks. Instead of writing out a full prompt every time you need to check your code for security flaws, initialize a project, or monitor your usage, you invoke a command that handles it all. This keeps you in flow and eliminates the repetitive friction of typing the same instructions over and over.

Claude Code supports two types of commands: built-in system commands provided by Anthropic, and custom commands you create for your specific workflows.

Built-in slash commands you should know

These commands come standard with Claude Code and handle critical functions like authentication and usage monitoring:

Authentication Commands

Usage & Status Commands

  • /status – Monitor your remaining allocation and current plan tier. This gives you a snapshot of where you stand before starting long-running tasks.

  • /usage – Check your detailed usage breakdown across Claude and Claude Code. Pro and Max plans share the same usage pool, so this command shows your combined consumption across both platforms.

  • /help – Display available commands and their descriptions in the terminal.

System Commands

  • claude update – Update Claude Code to the latest version. Run this if you want the newest features, bug fixes, or improved command handling.

  • /compact – Available in interactive mode for certain use cases; check the inline help for details specific to your version.

macOS menu bar showing Claude Code usage allocation

How to create custom slash commands

Custom commands let you automate repetitive workflows without writing new prompts each time. Slash commands have been merged into skills in recent Claude Code updates, so the process is now unified—both .claude/commands/ and .claude/skills/ directories work interchangeably.

Key Takeaways for Creating Custom Commands

  1. Create a commands directory – In your project root, create .claude/commands/ for project-specific commands, or ~/.claude/commands/ in your home directory for commands available across all projects.

  2. Write command files in Markdown – Name your file with the command name (e.g., security-audit.md) and write the prompt in natural language. This becomes executable as /security-audit.

  3. Use $ARGUMENTS placeholder – Insert $ARGUMENTS in your prompt to pass dynamic arguments when you invoke the command. Example: /review-code $ARGUMENTS where $ARGUMENTS gets replaced with your input.

  4. Store both places – Project-scoped commands in .claude/commands/review.md and user-scoped commands in ~/.claude/commands/review.md both create /review and function identically, giving you flexibility in how you organize your tools.

developer using Claude Code in terminal workflow

Essential workflows with slash commands

Monitoring usage to prevent lockouts

The most critical workflow is staying aware of your usage before hitting limits. Run /status at the start of a session to understand your remaining allocation. If you're approaching 75% usage, be strategic about compute-heavy tasks. Knowing exactly when your usage window resets helps you plan around limits—many developers hit a 5-hour lockout precisely when wrapping up a critical PR.

For continuous monitoring without manual checks, use Usagebar, which displays your Claude Code usage directly in the macOS menu bar with smart alerts at 50%, 75%, and 90%. This eliminates the context switch of typing /usage repeatedly and shows you exactly how much time you have left before limits apply.

Switching between accounts

If you manage multiple Claude accounts (work vs. personal, or different subscription tiers), use /logout followed by /login to swap accounts. This ensures your commands execute against the correct authentication and plan.

Automating code reviews

Create a custom /review command in your project's .claude/commands/ directory that scans your code for security issues, performance bottlenecks, or style violations. Save the prompt as review.md and invoke /review src/main.py to run it against any file.

Initializing projects

Build a /setup command that scaffolds your project structure, installs dependencies, and configures linting. One invocation replaces five manual steps, keeping you in flow.

code editor with slash command interface

Best practices for slash commands

  • Check usage before heavy operations – Run /status before starting long-running tasks like generating large codebases or running extensive code reviews. Pro and Max plan usage resets daily at midnight in your timezone.

  • Use project-scoped commands for team consistency – Store shared commands in .claude/commands/ so your entire team runs the same automated workflows, reducing inconsistency and context switching.

  • Name commands clearly – Use descriptive names like security-scan, test-coverage, or docs-generate so teammates understand what each command does without reading the file.

  • Document your custom commands – Add comments in your Markdown files explaining what the command does, what arguments it expects, and what output to expect. This prevents teammates from guessing.

  • Avoid hardcoding paths in commands – Use $ARGUMENTS instead of absolute paths so commands work across different machines and project structures.

  • Monitor credentials securely – If you're using Claude Code with macOS Keychain (recommended for Pro/Max plans), /login and /logout handle credential storage safely without environment variables.

terminal showing usage status and commands

When to upgrade from built-in commands to Usagebar

Built-in /status and /usage commands are essential, but they require you to context-switch out of your editor or IDE each time you check. If you're running multiple large tasks and want continuous visibility without manual checks, Usagebar provides real-time monitoring in your macOS menu bar.

Usagebar sends smart alerts at 50%, 75%, and 90% usage, so you know exactly how much time remains before a lockout kicks in. The app securely stores Claude credentials in macOS Keychain and supports both pay-as-you-go and subscription-based pricing. With Usagebar, you eliminate the friction of typing /usage repeatedly and stay in flow while developing.

Get Usagebar for instant download and flexible pricing—including a free option for students. Start monitoring your Claude Code usage directly from your menu bar and never be surprised by a usage lockout again.

Track Your Claude Code Usage

Never hit your usage limits unexpectedly. Usagebar lives in your menu bar and shows your 5-hour and weekly limits at a glance.

Get Usagebar