packages/kilo-docs/pages/getting-started/settings/auto-cleanup.md
Auto Cleanup automatically manages your task history by removing old tasks to free up disk space and improve performance. Tasks are intelligently classified and retained based on their type and age, ensuring important work is preserved while temporary or experimental tasks are cleaned up.
{% callout type="warning" %} Task deletion is permanent and cannot be undone. Deleted tasks are completely removed from disk, including all conversation history, checkpoints, and associated files. {% /callout %}
As you work with Kilo Code, each task creates files containing conversation history, checkpoints, and other data. Over time, this accumulates and can consume significant disk space. Auto-Cleanup solves this by:
{% callout type="info" title="Key Benefits" %}
Auto-Cleanup uses an intelligent classification system to determine how long each task should be retained:
Every task is automatically classified into one of these categories:
| Task Type | Description | Default Retention |
|---|---|---|
| Favorited | Tasks you've marked as favorites | Never deleted (or 90 days if configured) |
| Completed | Tasks that successfully finished | 30 days |
| Incomplete | Tasks that were started but not completed | 7 days |
| Regular | Default classification for other tasks | 30 days |
A task is considered "completed" when Kilo Code uses the attempt_completion tool to formally mark it as finished. Tasks without this completion marker are classified as incomplete, even if you consider them done. This distinction helps clean up abandoned or experimental tasks more aggressively.
When Auto-Cleanup runs, it:
Access Auto-Cleanup settings through the Kilo Code settings panel:
{% image src="/docs/img/auto-cleanup/settings.png" alt="Auto-Cleanup settings panel" width="800" caption="Auto-Cleanup settings panel" /%}
Check the "Enable automatic task cleanup" option to activate the feature. When enabled, tasks will be automatically removed based on your retention settings.
Configure how long different types of tasks are kept before cleanup:
Default: 30 days
Minimum: 1 day
Sets the base retention period for regular tasks that don't fall into other categories.
Never delete favorited tasks (recommended)
When enabled, favorited tasks are preserved indefinitely regardless of age. This is the safest option to prevent accidental deletion of important work.
If disabled, you can set a custom retention period:
Default: 90 days
Minimum: 1 day
To favorite a task, use the star icon in the task history panel.
Default: 30 days
Minimum: 1 day
Tasks successfully completed via the attempt_completion tool are retained for this period. These tasks typically represent finished work that may still be useful for reference.
Default: 7 days
Minimum: 1 day
Tasks without completion status are retained for a shorter period. This helps clean up experimental or abandoned tasks more quickly while still giving you time to review them.
The settings show when the last cleanup operation ran, helping you understand the cleanup schedule.
Click the "Run Cleanup Now" button to immediately trigger a cleanup operation using your current settings. This is useful when:
For Individual Developers:
For Experimentation:
For Limited Disk Space:
To ensure important tasks are never deleted:
Consider these factors when setting retention periods:
Issue: Old tasks remain after cleanup runs
Solutions:
Issue: A task you needed was removed
Prevention:
{% callout type="warning" %} Deleted tasks cannot be recovered. Always favorite important tasks or adjust retention periods to prevent accidental deletion. {% /callout %}
Issue: Cleanup operation impacts system performance
Solutions:
Auto-Cleanup automatically protects your currently active task from deletion, even if it meets the age criteria. This ensures you never lose work in progress during a cleanup operation.
When a task is deleted, the following are permanently removed:
Task data is stored in your VS Code global storage location:
~/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code/%APPDATA%\Code\User\globalStorage\kilocode.kilo-code\~/.config/Code/User/globalStorage/kilocode.kilo-code/Yes, when enabled, Auto-Cleanup runs automatically based on the configured schedule. You can also trigger it manually using the "Run Cleanup Now" button.
No, task deletion is permanent. Always favorite important tasks or adjust retention periods to prevent accidental deletion.
No, the active task you're currently working on is automatically protected from deletion.
All checkpoints associated with a deleted task are permanently removed along with the task data.
Yes, simply uncheck the "Enable automatic task cleanup" option in settings. Your configuration is preserved for when you enable it again.
Check if they are: