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.
# List all commands
/help

# Execute a command
/clear

# Command with arguments
/memory add Remember that I prefer TypeScript

Session Management

/clear

Clear conversation history and start a new session.
/clear
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.
/resume
Opens an interactive picker showing recent sessions with:
  • Session timestamp
  • First user message preview
  • Fuzzy search capability

/quit

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

/compress

Compress context by replacing old messages with a summary.
/compress
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.
/help
Alias: /?

/stats

View session statistics.
# Overall session stats
/stats

# Model-specific usage
/stats model

# Tool usage breakdown
/stats tools
Alias: /usage Displays:
  • Session duration
  • Total API calls
  • Input/output tokens
  • Cost estimates (if available)
  • Tool execution counts

/about

Show version and system information.
/about

Configuration

/settings

Open the settings editor.
/settings
Interactive editor for:
  • User settings (~/.qwen/settings.json)
  • Project settings (.qwen/settings.json)
  • Workspace settings

/approval-mode

Change the approval mode for tool execution.
# Open mode picker
/approval-mode

# Set directly
/approval-mode yolo
/approval-mode default
/approval-mode auto-edit
/approval-mode plan
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.
/model
Opens model picker with:
  • Available models from your provider
  • Model capabilities and context limits
  • Current model highlighted

/theme

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

/vim

Toggle Vim mode for input editing.
/vim
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.
# Show combined memory
/memory show

# Show project-level only
/memory show --project

# Show global only
/memory show --global

/memory add

Add a fact to memory.
# Add to default scope (project)
/memory add User prefers functional programming style

# Add to project memory explicitly
/memory add --project This project uses ESM modules

# Add to global memory
/memory add --global I work at Acme Corp
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.
/memory refresh
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.
# Export to markdown
/export md

# Export to HTML
/export html

# Export to JSON
/export json

# Export to JSONL (one message per line)
/export jsonl
Exported files include:
  • All messages (user and assistant)
  • Tool calls and results
  • Timestamps
  • Token usage stats
  • Session metadata

/copy

Copy content to clipboard.
# Copy last assistant message
/copy

# Copy specific message (by index or search)
/copy 3
Requires xclip (Linux), pbcopy (macOS), or clip.exe (Windows) to be available.

Subagents

/agents

Manage specialized subagents.
# View subagent management
/agents manage

# Create new subagent
/agents create
Subagents allow:
  • Delegating specialized tasks
  • Parallel execution
  • Domain-specific reasoning
  • Isolation of concerns
See Subagents for details.

Skills

/skills

List and use available skills.
# List all skills
/skills

# Use a specific skill
/skills code-review
Skills are reusable prompt templates with:
  • Instructions
  • Context
  • Tools configuration
  • Examples
See Skills System for details.

MCP Integration

/mcp

Manage Model Context Protocol servers.
/mcp
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.
/extensions
Manage:
  • Installed extensions
  • Extension settings
  • Enable/disable extensions
  • Update extensions

Authentication

/auth

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

Editor Integration

/editor

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

/ide

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

Debugging & Development

/insight

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

/bug

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

/docs

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

Advanced Commands

Configure terminal-specific settings:
/terminal-setup
  • Kitty keyboard protocol
  • Color support detection
  • Encoding settings
  • Performance tuning
Change the UI language:
/language
Supported languages:
  • English (en)
  • Chinese (zh)
  • Japanese (ja)
  • And more via extensions
Manage lifecycle hooks:
/hooks
Configure hooks for:
  • Pre/post tool execution
  • Session start/end
  • File operations
  • Custom integrations
Initialize project configuration:
/init
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:
// my-extension/commands/deploy.ts
export const deployCommand: SlashCommand = {
  name: 'deploy',
  description: 'Deploy to staging environment',
  kind: CommandKind.FILE,
  action: async (context, args) => {
    // Custom logic here
    return {
      type: 'message',
      messageType: 'info',
      content: 'Deploying...'
    };
  }
};
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