packages/kilo-docs/pages/automate/tools/switch-mode.md
The switch_mode tool enables Kilo Code to change between different operational modes, each with specialized capabilities for specific types of tasks. This allows seamless transitions between modes like Code, Architect, Ask, or Debug when the current task requires different expertise.
The tool accepts these parameters:
mode_slug (required): The slug of the mode to switch to (e.g., "code", "ask", "architect")reason (optional): The reason for switching modes, providing context for the userThis tool requests a mode change when the current task would be better handled by another mode's capabilities. It maintains context while shifting Kilo Code's focus and available toolsets to match the requirements of the new task phase.
new_task functionality, not general mode switchingWhen the switch_mode tool is invoked, it follows this process:
Request Validation:
mode_slug parameter is provided and validreason parameter (if provided) is properly formattedMode Transition Preparation:
Mode Activation (Upon User Approval):
Continuation:
The switch_mode tool belongs to the "modes" tool group but is also included in the "always available" tools list. This means:
ask_followup_question and attempt_completionEach mode in the system has a specific structure:
slug: Unique identifier for the mode (e.g., "code", "ask")name: Display name for the mode (e.g., "Code", "Ask")roleDefinition: The specialized role and capabilities of the modecustomInstructions: Optional mode-specific instructions that guide behaviorgroups: Tool groups available to the mode with optional restrictionsThe core modes provide these specialized capabilities:
Beyond the core modes, the system supports custom project-specific modes:
Different modes may have specific file type restrictions:
.md extensionFileRestrictionErrorSwitching to Code mode for implementation:
<switch_mode>
<mode_slug>code</mode_slug>
<reason>Need to implement the login functionality based on the architecture we've discussed</reason>
</switch_mode>
Switching to Architect mode for design:
<switch_mode>
<mode_slug>architect</mode_slug>
<reason>Need to design the system architecture before implementation</reason>
</switch_mode>
Switching to Debug mode for troubleshooting:
<switch_mode>
<mode_slug>debug</mode_slug>
<reason>Need to systematically diagnose the authentication error</reason>
</switch_mode>
Switching to Ask mode for information:
<switch_mode>
<mode_slug>ask</mode_slug>
<reason>Need to answer questions about the implemented feature</reason>
</switch_mode>