packages/kilo-docs/pages/automate/tools/new-task.md
The new_task tool creates subtasks with specialized modes while maintaining a parent-child relationship. It breaks down complex projects into manageable pieces, each operating in the mode best suited for specific work.
The tool accepts these parameters:
mode (required): The slug of the mode to start the new task in (e.g., "code", "ask", "architect")message (required): The initial user message or instructions for this new taskThis tool creates a new task instance with a specified starting mode and initial message. It allows complex workflows to be divided into subtasks with their own conversation history. Parent tasks are paused during subtask execution and resumed when the subtask completes, with results transferred back to the parent.
new_task tool is unavailable in subagent sessions. Only primary agents can create subtasks.When the new_task tool is invoked, it follows this process:
Parameter Validation:
mode and message parametersTask Stack Management:
Task Context Management:
Mode Switching and Integration:
Task Completion and Result Transfer:
finishSubTask()taskCompleted event is emitted with performance dataCreating a new task in code mode:
<new_task>
<mode>code</mode>
<message>Implement a user authentication service with login, registration, and password reset functionality.</message>
</new_task>
Creating a documentation task after completing implementation:
<new_task>
<mode>docs</mode>
<message>Create comprehensive API documentation for the authentication service we just built.</message>
</new_task>
Breaking down a complex feature into architectural planning and implementation:
<new_task>
<mode>architect</mode>
<message>Design the database schema and system architecture for our new e-commerce platform.</message>
</new_task>