Skip to main content

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.
Aliases: /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.
Opens an interactive picker showing recent sessions with:
  • Session timestamp
  • First user message preview
  • Fuzzy search capability

/quit

Exit the CLI gracefully.
Alias: /exit Displays session summary:
  • Total duration
  • Number of turns
  • Token usage statistics

/compress

Compress context by replacing old messages with a summary.
Alias: /summarize Use when:
  • Approaching token limits
  • Session becomes slow
  • Want to free up context for new information
Compression is lossy - older details may be forgotten. Use /memory add to preserve important facts.

Information & Stats

/help

Display help information about Qwen Code.
Alias: /?

/stats

View session statistics.
Alias: /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.
Interactive editor for:
  • User settings (~/.qwen/settings.json)
  • Project settings (.qwen/settings.json)
  • Workspace settings

/approval-mode

Change the approval mode for tool execution.
Plan Mode - Analysis only, no modificationsAI can:
  • Read files
  • Search code
  • Analyze and reason
AI cannot:
  • Edit files
  • Run commands
  • Make changes
Best for: Code review, architecture planning
Press Shift+Tab to cycle through approval modes quickly without using the command.

/model

Switch the AI model for this session.
Opens model picker with:
  • Available models from your provider
  • Model capabilities and context limits
  • Current model highlighted

/theme

Change the UI theme.
Available themes:
  • Light
  • Dark
  • High Contrast
  • Solarized Light
  • Solarized Dark
  • Custom themes from settings

/vim

Toggle Vim mode for input editing.
Enables Vim keybindings in the input field:
  • Modal editing (normal/insert mode)
  • hjkl navigation
  • 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.
Re-reads:
  • .qwen/qwen.md (project memory)
  • ~/.qwen/qwen.md (global memory)
  • Extension-provided context files

Data Export

/export

Export session history to a file.
Exported files include:
  • 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.
Subagents allow:
  • Delegating specialized tasks
  • Parallel execution
  • Domain-specific reasoning
  • Isolation of concerns
See Subagents for details.

Skills

/skills

List and use available skills.
Skills are reusable prompt templates with:
  • Instructions
  • Context
  • Tools configuration
  • Examples
See Skills System for details.

MCP Integration

/mcp

Manage Model Context Protocol servers.
Opens MCP management dialog to:
  • View connected servers
  • Enable/disable servers
  • Configure server settings
  • View available tools from each server
See MCP Support for details.

Extensions

/extensions

Manage Qwen Code extensions.
Manage:
  • Installed extensions
  • Extension settings
  • Enable/disable extensions
  • Update extensions

Authentication

/auth

Manage authentication settings.
Configure:
  • API keys
  • OAuth tokens
  • Provider selection
  • Credentials management

Editor Integration

/editor

Configure external editor for file edits.
Set preferred editor:
  • VS Code
  • Vim/Neovim
  • Emacs
  • Sublime Text
  • Custom command

/ide

Configure IDE integration.
Manage:
  • VS Code integration
  • JetBrains integration
  • LSP connections
  • Workspace sync

Debugging & Development

/insight

View detailed information about the current session.
Shows:
  • Internal state
  • Context usage
  • Tool registry
  • Active configurations

/bug

Create a bug report.
Generates a report with:
  • Session information
  • Error logs
  • System configuration
  • Steps to reproduce

/docs

Open documentation in browser.
Note: Requires a browser and internet connection.

Advanced Commands

Configure terminal-specific settings:
  • Kitty keyboard protocol
  • Color support detection
  • Encoding settings
  • Performance tuning
Change the UI language:
Supported languages:
  • English (en)
  • Chinese (zh)
  • Japanese (ja)
  • And more via extensions
Manage lifecycle hooks:
Configure hooks for:
  • Pre/post tool execution
  • Session start/end
  • File operations
  • Custom integrations
Initialize project configuration:
Creates .qwen/ directory with:
  • Default settings
  • Memory file template
  • Recommended ignore patterns

Command Availability

All commands are available in interactive mode.

Custom Commands

You can add custom slash commands via extensions:
See Extension Development for details.

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