⌨️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.

CommandPurpose
/clearReset conversation history, start fresh. Keeps project + user memory.
/compactSummarize conversation, keep key info, drop details. Reduces cost and latency.
/configOpen settings panel — auto-compact, checkpointing, theme, model, etc.
/costShow token consumption and cost (API key only)
/usageShow usage against subscription limits
/modelsList and switch available models
/agentsManage sub-agent configurations
/mcpManage MCP server connections
/memoryAdd persistent context to CLAUDE.md files
/initScan 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.

Before you continue

We use analytics cookies to understand how the documentation is used and improve the experience. Privacy Policy.