Overview
Slash commands are special in-chat commands that modify how HAI Build processes your request. They can be used to trigger specific workflows, load custom instructions, or invoke MCP prompts.Slash commands must appear within XML tags like
<task>, <feedback>, <answer>, or <user_message> to be processed.How Slash Commands Work
Slash commands are processed after @ mentions and transform the user’s message by:- Detecting the slash command pattern:
/(^|\s)\/([a-zA-Z0-9_.:@-]+)(?=\s|$)/ - Removing the command from the message
- Prepending appropriate instructions or content to the message
Built-in Slash Commands
/newtask
Creates a detailed summary of the current conversation for starting a new task with preloaded context. Usage:- Invokes the
new_tasktool - Generates context including:
- Current work description
- Key technical concepts
- Relevant files and code
- Problem solving approaches
- Pending tasks and next steps
/smol
Compacts the current context window while retaining key information. Alias:/compact
Usage:
- Invokes the
condensetool - Creates a detailed summary including:
- Previous conversation overview
- Current work details
- Key technical concepts
- Relevant files and code
- Problem solving history
- Pending tasks and next steps
- Task progress (if focus chain is enabled)
/compact
Alias for/smol. See above for details.
/newrule
Creates a new Cline rule file in the.clinerules directory based on the current conversation.
Usage:
- Invokes the
new_ruletool - Creates a markdown file in
.clinerules/ - Generates guidelines covering:
- Communication style preferences
- Development workflow
- Coding best practices
- Project-specific context
- Other custom guidelines
- File must be in
.clinerules/directory - Filename must be succinct and descriptive (e.g.,
react-conventions.md) - Cannot be named
default-clineignore.md - Use hyphens (
-) instead of underscores (_) in filenames - Format as markdown with distinct sections
/reportbug
Helps submit a bug report to the HAI Build GitHub repository. Usage:- Invokes the
report_bugtool - Guides you through collecting required information:
- Issue title
- What happened vs. what was expected
- Steps to reproduce
- API request output (optional)
- Additional context (optional)
- Command initiates the bug report workflow
- HAI Build asks for any missing required information
- Once all details are collected, generates the bug report
/deep-planning
Enables deep planning mode with enhanced architectural thinking. Usage:- Activates model-family-aware planning prompts
- Provides detailed architectural guidance
- Considers focus chain settings if enabled
- Adapts to the current LLM provider and model
- Complex architectural decisions
- Multi-step implementation planning
- System design tasks
- Refactoring large codebases
The planning approach adapts based on the LLM model being used (GPT-5, generic, etc.)
/explain-changes
Explains code changes between git references with AI-generated inline comments. Usage:- Opens a multi-file diff view
- Generates AI explanations for code changes
- Supports various git reference comparisons:
- Commits:
HEAD~1toHEAD - Branches:
maintofeature-branch - Pull requests: base branch to PR branch
- Staged/unstaged changes
- Commits:
- Gathers information about changes using git commands
- Builds context by reading relevant files
- Determines appropriate git references
- Calls
generate_explanationtool
Descriptive title for the diff view (e.g., “Changes in commit abc123”)
Git reference for the “before” state (commit hash, branch, tag, etc.)
Git reference for the “after” state. Defaults to working directory if omitted.
Workflow Slash Commands
You can create custom slash commands by adding workflow files to:- Local workflows:
.clinerules/in your workspace (project-specific) - Global workflows: Global HAI Build configuration directory (cross-project)
- Remote workflows: Configured via remote config settings
Creating Custom Workflows
File format: Any filename (e.g.,deploy.md, test-suite, code-review.txt)
Usage:
- Local workflows (highest priority)
- Global workflows
- Remote workflows (lowest priority)
- The slash command name must match the workflow filename exactly
- File contents are wrapped in
<explicit_instructions>tags - Instructions are prepended to your message
.clinerules/code-review):
MCP Prompt Slash Commands
If you have MCP (Model Context Protocol) servers configured, you can invoke their prompts using the format: Format:/mcp:<server>:<prompt>
Usage:
Name of the MCP server
Name of the prompt to invoke (can contain colons)
- Fetches the prompt from the specified MCP server
- Formats the prompt response (supports text, images, audio, resources)
- Wraps content in
<mcp_prompt>tags - Prepends to your message
- Text messages
- Images (with MIME type notation)
- Audio (with MIME type notation)
- Resources (with URI and optional text content)
Slash Command Patterns
Valid Command Names
Command names can include:- Letters (a-z, A-Z)
- Numbers (0-9)
- Underscore (
_) - Hyphen (
-) - Colon (
:) - At sign (
@)
/(^|\s)\/([a-zA-Z0-9_.:@-]+)(?=\s|$)/
Where Commands Are Recognized
Slash commands are only processed within these XML tags:<task><feedback><answer><user_message>
What’s NOT Recognized
The following are not treated as slash commands:- URLs:
http://example.com/newtask - File paths:
some/path/newtask - Partial words:
foo/bar
Enabling/Disabling Workflows
Workflows can be toggled on/off in the HAI Build settings: Local workflows:- Managed per workspace
- Stored in workspace state
- Managed globally across all workspaces
- Stored in global state
- Can be marked as
alwaysEnabled - Otherwise controlled by remote workflow toggles in global state
Command Priority
When a slash command name conflicts, HAI Build uses this priority order:- Built-in commands (newtask, smol, compact, newrule, reportbug, deep-planning, explain-changes)
- MCP prompts (format:
/mcp:server:prompt) - Local workflows (from workspace
.clinerules/) - Global workflows (from global config)
- Remote workflows (from remote config)
Telemetry
Slash command usage is tracked with the following categories:builtin- Built-in commandsmcp_prompt- MCP server promptsworkflow- Custom workflow files
Best Practices
Choose descriptive workflow names
Choose descriptive workflow names
Use clear, action-oriented names that describe what the workflow does:
- Good:
deploy,code-review,test-suite - Avoid:
misc,stuff,workflow1
Keep workflows focused
Keep workflows focused
Each workflow should have a single, clear purpose. Create multiple workflows instead of one that tries to do everything.
Document your workflows
Document your workflows
Include comments in workflow files explaining when and how to use them.
Use local vs global appropriately
Use local vs global appropriately
- Local workflows: Project-specific conventions, deployment procedures
- Global workflows: Personal coding style, general best practices
Test new workflows
Test new workflows
Try new slash commands in a test conversation before using them in important work.
See Also
Commands
VS Code commands reference
MCP Integration
Learn more about MCP servers