⌨️Essential
Slash Commands
Built-in commands for controlling Claude Code's behavior and context.
Core Commands
Slash commands are the primary way to control Claude Code features and settings within the chat. Type / to see all available commands.
| Command | Purpose |
|---|---|
| /clear | Reset conversation history, start fresh. Keeps project + user memory. |
| /compact | Summarize conversation, keep key info, drop details. Reduces cost and latency. |
| /config | Open settings panel — auto-compact, checkpointing, theme, model, etc. |
| /cost | Show token consumption and cost (API key only) |
| /usage | Show usage against subscription limits |
| /models | List and switch available models |
| /agents | Manage sub-agent configurations |
| /mcp | Manage MCP server connections |
| /memory | Add persistent context to CLAUDE.md files |
| /init | Scan codebase and generate CLAUDE.md |
Context Management
Long conversations accumulate context, which increases cost, adds latency, and can confuse the model. Two commands address this:
- ▸/clear — nuclear option. Wipes the conversation completely. Use when starting a fundamentally different task.
- ▸/compact — surgical option. Summarizes existing conversation, preserves decisions and key information, drops minor details. Use when you want to keep working but the context is getting heavy.
Configuration Hierarchy
Claude Code settings exist at three levels, with more specific levels overriding broader ones:
text
~/.claude/settings.json ← User-wide (global defaults)
.claude/settings.json ← Project-specific (shared with team)
.claude/settings.local.json ← Local only (personal overrides)💡Tip
Enable Auto-compact in /config. This makes Claude automatically compress the conversation when approaching token limits, preventing degradation without manual intervention.