Overview
Slash commands let you control the session, manage settings, and perform special actions without asking the AI. Commands start with/ and are executed immediately.
Session Management
/clear
Clear conversation history and start a new session./reset, /new
Clears the conversation history and resets the chat context, but preserves your configuration, settings, and approval mode.
/resume
Resume a previous session from history.- Session timestamp
- First user message preview
- Fuzzy search capability
/quit
Exit the CLI gracefully./exit
Displays session summary:
- Total duration
- Number of turns
- Token usage statistics
/compress
Compress context by replacing old messages with a summary./summarize
Use when:
- Approaching token limits
- Session becomes slow
- Want to free up context for new information
Information & Stats
/help
Display help information about Qwen Code./?
/stats
View session statistics./usage
Displays:
- Session duration
- Total API calls
- Input/output tokens
- Cost estimates (if available)
- Tool execution counts
/about
Show version and system information.Configuration
/settings
Open the settings editor.- User settings (
~/.qwen/settings.json) - Project settings (
.qwen/settings.json) - Workspace settings
/approval-mode
Change the approval mode for tool execution.- plan
- default
- auto-edit
- yolo
Plan Mode - Analysis only, no modificationsAI can:
- Read files
- Search code
- Analyze and reason
- Edit files
- Run commands
- Make changes
/model
Switch the AI model for this session.- Available models from your provider
- Model capabilities and context limits
- Current model highlighted
/theme
Change the UI theme.- Light
- Dark
- High Contrast
- Solarized Light
- Solarized Dark
- Custom themes from settings
/vim
Toggle Vim mode for input editing.- Modal editing (normal/insert mode)
hjklnavigation- Word movements (
w,b,e) - Line operations (
dd,yy,p)
Memory Management
/memory show
Display current memory contents./memory add
Add a fact to memory.Memory is loaded at session start and injected into the AI’s context. Use it to persist preferences, project conventions, and important facts across sessions.
/memory refresh
Reload memory from source files..qwen/qwen.md(project memory)~/.qwen/qwen.md(global memory)- Extension-provided context files
Data Export
/export
Export session history to a file.- All messages (user and assistant)
- Tool calls and results
- Timestamps
- Token usage stats
- Session metadata
/copy
Copy content to clipboard.Requires
xclip (Linux), pbcopy (macOS), or clip.exe (Windows) to be available.Subagents
/agents
Manage specialized subagents.- Delegating specialized tasks
- Parallel execution
- Domain-specific reasoning
- Isolation of concerns
Skills
/skills
List and use available skills.- Instructions
- Context
- Tools configuration
- Examples
MCP Integration
/mcp
Manage Model Context Protocol servers.- View connected servers
- Enable/disable servers
- Configure server settings
- View available tools from each server
Extensions
/extensions
Manage Qwen Code extensions.- Installed extensions
- Extension settings
- Enable/disable extensions
- Update extensions
Authentication
/auth
Manage authentication settings.- API keys
- OAuth tokens
- Provider selection
- Credentials management
Editor Integration
/editor
Configure external editor for file edits.- VS Code
- Vim/Neovim
- Emacs
- Sublime Text
- Custom command
/ide
Configure IDE integration.- VS Code integration
- JetBrains integration
- LSP connections
- Workspace sync
Debugging & Development
/insight
View detailed information about the current session.- Internal state
- Context usage
- Tool registry
- Active configurations
/bug
Create a bug report.- Session information
- Error logs
- System configuration
- Steps to reproduce
/docs
Open documentation in browser.Advanced Commands
/terminal-setup
/terminal-setup
Configure terminal-specific settings:
- Kitty keyboard protocol
- Color support detection
- Encoding settings
- Performance tuning
/language
/language
Change the UI language:Supported languages:
- English (en)
- Chinese (zh)
- Japanese (ja)
- And more via extensions
/hooks
/hooks
Manage lifecycle hooks:Configure hooks for:
- Pre/post tool execution
- Session start/end
- File operations
- Custom integrations
/init
/init
Initialize project configuration:Creates
.qwen/ directory with:- Default settings
- Memory file template
- Recommended ignore patterns
Command Availability
- Interactive Mode
- Headless Mode
- ACP Mode
All commands are available in interactive mode.
Custom Commands
You can add custom slash commands via extensions:Tips & Tricks
Quick Mode Switching
Use
Shift+Tab to cycle approval modes without typing /approval-mode.Command History
Use ↑/↓ arrows to navigate command history, including slash commands.
Partial Completion
Type
/ and press Tab to see command suggestions with fuzzy matching.Chain Operations
Some commands can be chained:
/compress then /memory add to optimize context.Next Steps
Interactive Mode
Learn about the interactive UI
Approval Modes
Understand permission modes in depth
Memory System
Master the memory and skills system
Headless Mode
Automate with non-interactive mode
