Commands & Shortcuts
Quick reference for Claude Code commands and keyboard shortcuts.
Built-in Slash Commands
| Command | Description |
|---|---|
/help | Show help information |
/clear | Clear conversation history |
/compact | Compact conversation to save context |
/config | Open configuration |
/cost | Show token usage and cost |
/doctor | Check Claude Code installation health |
/init | Initialize CLAUDE.md in current project |
/login | Switch accounts or re-authenticate |
/logout | Sign out of current account |
/memory | Edit CLAUDE.md memory file |
/model | Switch AI model |
/permissions | Manage tool permissions |
/review | Review conversation/code |
/status | Show current status |
/terminal-setup | Configure terminal integration |
/vim | Toggle vim mode |
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl+C | Cancel current operation |
Ctrl+D | Exit Claude Code |
Ctrl+L | Clear screen |
Up/Down | Navigate command history |
Tab | Autocomplete |
Escape | Cancel current input |
Useful Command Patterns
Git Workflows
# Quick commit with AI-generated message"commit these changes"
# Create a PR with description"create a pr for this branch"
# Review changes before committing"show me what changed and suggest a commit message"Code Navigation
# Find where something is defined"where is the User class defined?"
# Understand code flow"how does the authentication flow work?"
# Find usages"where is this function called from?"Refactoring
# Rename with updates"rename this function to X and update all usages"
# Extract code"extract this logic into a separate function"
# Improve code"refactor this for readability"Testing
# Generate tests"write tests for this function"
# Run specific tests"run tests for the auth module"
# Fix failing tests"why is this test failing?"Debugging
# Investigate errors"why am I getting this error: [paste error]"
# Trace issues"find where this value becomes null"
# Explain behavior"why does this return undefined?"Team-Specific Commands
Add your team’s common command patterns here:
Deployment
# Deploy to staging/deploy-staging
# Check deployment status"what's the status of the staging deployment?"Database
# Run migrations/db-migrate
# Generate migration"create a migration to add email_verified column to users"Tips
-
Be specific - “fix the bug” is less effective than “fix the null pointer in UserService.getUser”
-
Provide context - Reference file names and line numbers when possible
-
Use plan mode - For complex tasks, let Claude plan before executing
-
Check permissions - Use
/permissionsto see what tools are allowed -
Save context - Use
/compactwhen running low on context window