Claude Code integrates over a dozen slash commands that let you configure, diagnose, and drive your sessions without leaving the terminal. This reference guide groups each command by category - from /init for initialization to /compact for context management - with complete syntax, options, and copy-paste-ready examples.
The slash commands /help, /init, /clear, and the complete list of commands form the foundation of any effective Claude Code usage. Claude Code offers dozens of native slash commands covering the entire work cycle: project initialization, context management, configuration, authentication, and debugging. These commands significantly accelerate repetitive configuration tasks.
What are the /help, /init, /clear slash commands in the complete Claude Code command list?
Here is the quick reference table of the most commonly used commands. Check it before each session to save time.
| Command | Description | Example |
|---|---|---|
/help | Displays help and shortcuts | /help |
/init | Initializes the CLAUDE.md file | /init |
/clear | Clears the conversation context | /clear |
/compact | Compresses the active context | /compact |
/cost | Shows tokens consumed | /cost |
/config | Opens global configuration | /config |
/model | Changes the active LLM model | /model sonnet |
/memory | Edits memory files | /memory |
/doctor | Diagnoses the installation | /doctor |
/login | Authenticates your session | /login |
/logout | Disconnects your session | /logout |
/status | Displays session status | /status |
/permissions | Manages tool permissions | /permissions |
/allowed-tools | Lists authorized tools | /allowed-tools |
/diff | Shows current modifications | /diff |
/context | Visualizes loaded context | /context |
/bug | Reports a bug to Anthropic | /bug |
/feedback | Sends feedback to Anthropic | /feedback |
/mcp | Manages MCP servers | /mcp |
/hooks | Manages Claude Code hooks | /hooks |
/add-dir | Adds a directory to context | /add-dir ./lib |
/resume | Resumes a previous session | /resume |
/plan | Creates a structured action plan | /plan |
Each command runs directly in the Claude Code interactive prompt. Type / followed by the name to activate it. To discover all variants, check the practical slash commands examples which illustrate each use case.
Key takeaway: this table covers the most common commands. Type /help to see the full list in your version of Claude Code.
How to use the initialization and help commands?
/help - Your entry point
The /help command is the entry point to Claude Code's built-in documentation. Run it without arguments to display the list of all available commands, keyboard shortcuts, and configuration options.
$ claude
> /help
In practice, /help displays the available slash commands, keyboard shortcuts, and links to online documentation. The /help command takes no arguments: simply type /help to get the complete list.
/init - Project initialization
The /init command is the automatic generator for the CLAUDE.md file at your project root. This file contains the conventions, instructions, and context that Claude Code will read at each session.
$ claude
> /init
Verify that the CLAUDE.md file was created with ls -la. The generated file weighs on average 2 KB and contains between 30 and 80 lines of configuration. You can then customize this file by following the CLAUDE.md memory system guide which details best practices.
| Aspect | Without /init | With /init |
|---|---|---|
| Project context | None | Auto-detected conventions |
| Setup time | 5-10 min manual | 15 seconds |
| Consistency | Variable | Reproducible |
| Generated file | None | CLAUDE.md (2 KB) |
Key takeaway: launch /init once per project, then maintain the CLAUDE.md file manually.
How to manage context with /clear and /compact?
Context management is the #1 performance lever in Claude Code. The context window consumes tokens with each exchange - mastering it saves budget and improves response quality.
/clear - Full reset
The /clear command is the complete conversation reset function. It deletes all exchange history while keeping CLAUDE.md files in memory. Specifically, it frees 100% of tokens used by the conversation.
> /clear
Use /clear when you switch topics or when response quality decreases after 20+ exchanges. Note: Ctrl+L in the terminal only refreshes the screen display, it does not reset the conversation context like /clear.
/compact - Intelligent compression
The /compact command is the automatic summarization mechanism that compresses your conversation without deleting it. It reduces token consumption by 50 to 70% on average while preserving essential information.
> /compact
> /compact "focus on the REST API part"
You can pass an optional instruction in quotes to guide the compression. In practice, /compact transforms 80,000 tokens into approximately 25,000 tokens, significant. To go further in optimizing your sessions, check the first conversations cheatsheet.
| Command | Effect | Tokens Freed | Context Preserved |
|---|---|---|---|
/clear | Total deletion | 100% | CLAUDE.md only |
/compact | Compression | 50-70% | Intelligent summary |
/compact "focus X" | Targeted compression | 60-75% | Oriented summary |
Key takeaway: alternate between /compact for long sessions and /clear for a radical topic change.
What monitoring tool does /cost offer?
/cost - Consumption tracking
The /cost command is the real-time indicator of your token consumption and API cost for the current session. It shows the number of input tokens, output tokens, and the estimated cost in dollars.
> /cost
# Shows: Session tokens: 45,230 | Cost: $0.34
In practice, a 30-minute session consumes between 20,000 and 120,000 tokens depending on task complexity. Monitor this counter after each /compact to verify the compression impact. If you notice the context becoming too large, use /compact to compress it. To understand the common errors related to slash commands, check the troubleshooting guide.
Key takeaway: check /cost regularly to track your budget and know when to use /compact.
How to configure Claude Code with /config and /model?
/config - Global configuration
The /config command is the centralized management interface for Claude Code settings. It opens an interactive menu that lets you modify permissions, theme, notifications, and default behavior.
> /config
You access 4 categories of settings: permissions (read/write/execute), appearance, default model, and integrations. more than 15 settings are configurable via this command. For a complete overview of initial configuration, refer to the installation and first launch cheatsheet.
/model - Model selection
The /model command is the LLM model selector used during the session. You can switch between Claude Opus 4.6, Claude Sonnet 4.6, and Claude Haiku 4.5 without restarting.
> /model
> /model opus
> /model sonnet
> /model haiku
| Model | ID | Speed | Relative Cost | Recommended Usage |
|---|---|---|---|---|
| Opus 4.6 | claude-opus-4-6 | Standard | 3x | Complex tasks |
| Sonnet 4.6 | claude-sonnet-4-6 | Fast | 1x | Daily usage |
| Haiku 4.5 | claude-haiku-4-5 | Ultra-fast | 0.3x | Simple tasks |
In practice, Sonnet 4.6 offers the best quality-to-price ratio for 80% of use cases. Switch to Opus for multi-file refactoring and to Haiku for quick searches. To finely manage permissions and security, combine /config with the right model settings.
Key takeaway: /model sonnet is the default choice; reserve Opus for architectural tasks.
How to manage authentication with /login and /logout?
/login - Connection
The /login command is the authentication process that links your terminal to your Anthropic account or an API key. It opens an OAuth flow in your default browser.
> /login
The process takes less than 10 seconds. Your session token is stored locally in ~/.claude/ with a 30-day validity period. Check your authentication status by running /login - the command shows "Already logged in" if the session is active.
/logout - Disconnection
The /logout command is the secure disconnection procedure that revokes the active session token. Use it on shared machines or at the end of the day.
> /logout
To set up a CI/CD environment without interactive session, check the headless commands reference which covers authentication via environment variable. In practice, headless mode with ANTHROPIC_API_KEY is 3 times faster to configure than an interactive login.
Key takeaway: /login for interactive sessions, environment variable for automation.
How to use /memory and /doctor daily?
/memory - Persistent memory management
The /memory command is the built-in editor for Claude Code's memory files. It opens the project's CLAUDE.md file in your default editor (defined by $EDITOR). Changes take effect at the next interaction.
> /memory
Specifically, /memory lets you add team conventions, important file paths, or recurring instructions. Discover the advanced CLAUDE.md memory tips to structure this file effectively.
Undoing an action
To undo an action performed by Claude Code, ask it to use git to revert, or directly use git checkout, git stash, or git reset in your terminal.
/doctor - System diagnostics
The /doctor command is the self-diagnostic tool that checks the integrity of your Claude Code installation. It verifies 6 points: Node.js version (minimum 18), API connectivity, file permissions, Git configuration, VS Code extensions, and disk space.
> /doctor
| Check | Success Threshold | Alternative Command |
|---|---|---|
| Node.js | >= v18.0.0 | node --version |
| API connectivity | Latency < 5,000 ms | curl api.anthropic.com |
| Disk space | > 500 MB free | df -h |
| Git | Version >= 2.30 | git --version |
| Permissions | Read/write ~/.claude/ | ls -la ~/.claude/ |
If /doctor reports a problem, fix it before continuing. You will find solutions to common issues in the common slash command errors guide. Also check the permissions and security tips to resolve access problems.
Key takeaway: run /doctor after each Claude Code or Node.js update.
What command combinations to use for common workflows?
Slash commands reach their full power when you combine them. Here are the most effective sequences, tested on real projects.
Starting a new project
$ claude
> /init
> /model sonnet
> /config
This 3-command sequence initializes the project in under 30 seconds. Launch /init first to generate the CLAUDE.md, then select your model and adjust the configuration.
Long session (more than 45 minutes)
> /cost # Check consumption
> /compact # Compress if > 60,000 tokens
> /cost # Verify the compression effect
Task switch
> /cost # Note the previous task's cost
> /clear # Start from scratch
> /model haiku # Switch if the task is simple
Installation debugging
> /doctor # Diagnose
> /login # Re-authenticate if needed
> /config # Check settings
To create your own automated workflows, explore the custom commands and skills reference which lets you define reusable sequences.
Key takeaway: the best workflows combine 2-3 commands executed in a precise order.
What keyboard shortcuts accelerate command usage?
Claude Code offers native keyboard shortcuts that complement slash commands. Memorize the 5 shortcuts below to speed up your sessions by 30%.
| Shortcut | Action | Equivalent Command |
|---|---|---|
Ctrl+L | Refresh the screen display (does not reset context) | - |
Ctrl+C | Cancel the current generation | - |
Tab | Command autocomplete | - |
Up / Down | Navigate history | - |
Escape | Exit current mode | - |
/ + Tab | List available commands | /help |
Here is how to use autocomplete: type /co then press Tab - Claude Code suggests /compact, /config, and /cost. This avoids typos and speeds up input. Find the complete slash commands overview for a comprehensive view.
SFEIR Institute offers a one-day Claude Code training where you will practice each slash command on concrete projects with guided labs. If you want to deepen Claude Code integration into a complete development workflow, the AI-Augmented Developer 2-day training covers the full range of generative AI tools for code. Developers already comfortable can take the AI-Augmented Developer - Advanced level in 1 day to master advanced automation patterns.
Key takeaway: Tab for autocomplete is the shortcut that will save you the most time daily. Note that Ctrl+L only refreshes the display, it does not reset your conversation.
Recent articles about Claude

Claude Managed Agents: Anthropic's Platform for Production Agent Deployment
Anthropic launches Managed Agents: a cloud platform for deploying AI agents in production. Secure sandbox, checkpointing, multi-agent, autonomous sessions lasting hours. Notion, Rakuten, Asana and Sentry already use it.

Claude Code Dream & Auto Dream: Automatic Memory Consolidation
After 20 sessions, Auto Memory notes become a mess. Auto Dream solves this by automatically consolidating Claude Code's memory: deduplication, stale entry removal, relative-to-absolute date conversion.

Claude Code Auto Mode: Autonomy Without the Risk
Auto Mode in Claude Code eliminates permission interruptions while keeping a safety net. A classifier analyzes every action before execution and blocks destructive operations. The sweet spot between approving everything and letting everything through.
This topic is covered in Module 6 of our Claude Code training
Useful Commands and Tips
1-day training • 60% hands-on labs • Expert instructors
View full program