← All Posts

Claude Code Slash Commands: Complete List & Guide

Claude Code slash commands are shortcuts that automate common development workflows like committing, pushing, creating PRs, and running tests. The most frequently used commands include /commit for generating conventional commit messages, /push for staging and pushing changes, /pr for creating pull requests, and /fix-pipeline for debugging CI failures. These commands save developers 5–10 minutes per task by eliminating context switching, though you'll still need to monitor your Claude Code usage limits to avoid hitting the 5-hour weekly lockout.

What are Claude Code slash commands?

Slash commands in Claude Code are special terminal directives that start with a forward slash (/) and automate repetitive development tasks. Unlike traditional CLI tools that require complex arguments, these commands use Claude's intelligence to understand context from your git history, code changes, and CI logs—then take action automatically.

There are two types of slash commands: built-in commands that come standard with Claude Code, and custom commands you can create in your project's .claude/commands/ directory for team-specific automations.

developer working at terminal with code

Built-in slash commands reference

Git & Commit Commands

/branch – Creates a feature branch with best practices. Checks out main, pulls the latest changes, and creates a new branch, keeping your local repository synchronized before you start coding.

/commit – Analyzes your staged changes and generates a Conventional Commit message that matches your project's commit style. No more guessing whether to use "fix:", "feat:", or "refactor:"—Claude Code writes it for you based on the diff.

/push – A three-in-one command that stages all changes, generates a commit message, and pushes to GitHub in a single step. Ideal for quick fixes and updates when you're confident in your changes.

Code Quality Commands

/lint – Runs your project's linter with automatic fixes enabled. For remaining errors that can't be auto-fixed, Claude Code uses the Haiku model (faster, lower cost) to correct them without context switching.

/vitest – Executes your unit tests and fixes any failures by correcting the implementation rather than modifying the test suite. Keeps your test coverage intact while fixing broken code.

Pull Request & CI Commands

/pr – Analyzes all commits on your feature branch and generates a pull request with an auto-written title and description. Saves 5–10 minutes on PR creation and ensures consistent documentation across your team.

/review-coderabbit – Fetches CodeRabbit AI review comments, verifies the suggestions are correct, implements the fixes, and resolves review threads. Automates the feedback loop so you're not manually copy-pasting code changes.

/fix-pipeline – Pulls CI failure logs from your build pipeline and debugs errors using Claude Sonnet (more powerful reasoning). Identifies root causes and implements fixes without requiring you to dig through logs.

/merge-to-main – Squash merges your PR to main, deletes the feature branch, and pulls the latest main branch locally. One command completes the entire merge workflow.

Utility Commands

/help – Lists all available slash commands, including built-in commands, custom commands from your .claude/commands/ directory, and any commands from connected MCP servers. Run this anytime you need a reminder of what's available.

/install-github-app – Connects Claude Code to your GitHub account. After setup, Claude Code automatically reviews your pull requests and can integrate feedback loops into your workflow.

/context – Checks for warnings about excluded skills or configuration issues that might affect command functionality. Useful when debugging why a command isn't working as expected.

/usage – Displays your current Claude Code usage and remaining weekly limit. Essential for monitoring your allocation before hitting the 5-hour weekly lockout that blocks further usage.

/logout – Disconnects your Claude account from Claude Code. Useful if you're switching accounts or resetting authentication.

Creating custom slash commands

Project-specific commands live in your repository's .claude/commands/ directory and are checked into version control. This means your entire team uses the same custom commands—no setup variation.

To create a custom command:

  1. Create a .claude/commands/ folder in your project root
  2. Add a markdown file named after your command (e.g., deploy.md)
  3. Write the command logic in natural language markdown
  4. Use the $ARGUMENTS variable to pass arguments into the prompt

Example: A custom /deploy command in deploy.md can read "Run the build, push to staging, and test the deployment"—Claude Code handles the actual execution based on your project's setup.

Workflow optimization with slash commands

Slash commands eliminate context switching by handling routine tasks automatically. Instead of manually running linters, committing, pushing, and creating PRs (each requiring you to leave your editor), you run one command and keep coding.

Power users create shell aliases for speed:

  • alias clint='claude /lint' – Quick linting
  • alias cpush='claude /push' – Fast push workflow
  • alias cpr='claude /pr' – Quick PR creation

This approach is especially valuable during critical tasks like wrapping up a PR or debugging production issues, where the 5-hour usage reset window can catch you off guard. Using Usagebar alongside these commands prevents frustration—you'll know exactly when your usage resets and get smart alerts at 50%, 75%, and 90% of your weekly limit.

macOS menu bar showing usage tracking

Best practices for slash commands

  • Know your usage limits – Each slash command consumes a portion of your weekly Claude Code allocation. Get Usagebar to track usage in your menu bar and avoid unexpected lockouts.
  • Combine commands for workflow efficiency – Use /lint, then /commit, then /push in sequence to clean up and deploy in one session.
  • Use /fix-pipeline for CI debugging – Instead of reading logs manually, let Claude Code analyze failures and suggest fixes.
  • Check /help regularly – New commands may be added to Claude Code, and custom commands from your team might change.
  • Create aliases for repetitive commands – Save keystrokes by aliasing frequently used commands in your shell.

Why track your usage while using slash commands

Every slash command consumes Claude Code credits from your weekly limit. A heavy day of /lint, /fix-pipeline, and /pr commands can consume 30–40% of your allocation. The frustration hits when you hit the 5-hour lockout mid-task and can't use Claude Code for the rest of the week.

Usagebar monitors your usage in real-time, sitting in your macOS menu bar. You'll see smart alerts at 50%, 75%, and 90% usage, preventing the scramble to finish critical work before lockout. The tool uses secure macOS Keychain storage for your credentials and offers flexible pay-what-you-want pricing—plus free access for students.

macOS menu bar Claude Code limits tracking

Key takeaways

  • Slash commands automate 9+ common dev tasks (/commit, /push, /pr, /lint, /vitest, /fix-pipeline, /review-coderabbit, /merge-to-main, /branch)
  • Built-in commands come with Claude Code; custom commands live in your project's .claude/commands/ directory and can be team-specific
  • Using slash commands efficiently means monitoring your weekly usage limit to avoid the 5-hour lockout during critical tasks
  • Shell aliases and Usagebar together create a frictionless workflow where you stay in flow without context switching

Sources

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