packages/kilo-docs/pages/automate/tools/attempt-completion.md
The attempt_completion tool signals that Kilo Code believes a task is complete and presents results to the user. It provides a summary of what was accomplished, optionally includes a command to demonstrate the result, and supports continued refinement through user feedback.
The tool accepts these parameters:
result (required): The final result description summarizing what was accomplishedcommand (optional): A CLI command to execute to demonstrate the resultThis tool marks the end of a task by presenting a final summary of what was accomplished. It signals to both the user and the system that the current task is complete. When a command is provided, it can also demonstrate the result through a live execution.
When the attempt_completion tool is invoked, it follows this process:
Safety Consideration (guideline, not enforced):
Result Presentation:
removeClosingTag functionCommand Execution (if provided):
Feedback Collection:
Task Completion and Continuation:
Implementation Integration:
parse-assistant-message.tsThe result message should follow these guidelines:
Note: The system automatically strips XML closing tags from the result text through the removeClosingTag function.
When including a command, follow these guidelines:
open index.html to display a created websitenpm start to launch a development serverpython app.py to run a created applicationecho or cat)The attempt_completion tool has a unique feedback mechanism:
When used within subtasks:
open index.html to show the result. The user provides feedback, and Kilo Code refines the design.Completing a task with just a result summary:
<attempt_completion>
<result>
I've updated the CSS for the navigation bar to match the design mockup. The changes include:
1. Updated color scheme to use the new brand colors
2. Added responsive behavior for mobile devices
3. Fixed the alignment issues in the dropdown menus
</result>
</attempt_completion>
Completing a task with a result and demonstration command:
<attempt_completion>
<result>
I've created a simple React application with the following features:
1. A responsive landing page with the requested hero section
2. A working contact form with validation
3. Navigation between all three requested pages
4. Styling that matches the provided design mockup
</result>
<command>npm start</command>
</attempt_completion>
Completing a Python script task with execution:
<attempt_completion>
<result>
I've created a data processing script that:
1. Reads the CSV files from the data directory
2. Cleans and normalizes the data as requested
3. Generates the summary statistics in JSON format
4. Outputs the processed data to the output directory
</result>
<command>python process_data.py</command>
</attempt_completion>