title: Dev Container Persistence
When using Kilo Code in development containers (VS Code Dev Containers, GitHub Codespaces, etc.), your threads and settings can persist across container rebuilds by properly configuring volume mounts.
Dev containers are ephemeral by default - when you rebuild the container, all data is lost unless explicitly persisted. Kilo Code stores important data including:
The Kilo Code dev container is pre-configured with named volumes to preserve your data. If you're setting up your own dev container, add these mounts to your devcontainer.json:
{
"name": "Your Project",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"mounts": [
{
"source": "kilocode-global-storage",
"target": "/root/.vscode-remote/data/User/globalStorage/kilocode.kilo-code",
"type": "volume"
},
{
"source": "kilocode-settings",
"target": "/root/.vscode-remote/data/User/settings",
"type": "volume"
}
]
}
| Data Type | Container Path |
|---|---|
| Threads | /root/.vscode-remote/data/User/globalStorage/kilocode.kilo-code/tasks/ |
| Settings | /root/.vscode-remote/data/User/settings/ |
| Cache | /root/.vscode-remote/data/User/globalStorage/kilocode.kilo-code/cache/ |
| Vector Store | /root/.vscode-remote/data/User/globalStorage/kilocode.kilo-code/vector/ |
devcontainer rebuild instead of devcontainer up --rebuildIf named volumes are accidentally deleted:
To manually back up your threads:
# Copy thread data from the container
docker cp <container-name>:/root/.vscode-remote/data/User/globalStorage/kilocode.kilo-code ./kilocode-backup
For advanced configurations, you can specify a custom storage path:
Add a bind mount to your devcontainer.json:
"mounts": [
{
"source": "${localWorkspaceFolder}/.kilocode-data",
"target": "/home/vscode/kilocode-data",
"type": "bind"
}
]
Set the custom storage path in VS Code settings:
Ctrl+, or Cmd+,)/home/vscode/kilocode-dataGitHub Codespaces automatically persists your VS Code settings and extensions. For Kilo Code threads, the pre-configured dev container includes the necessary volume mounts.
If using a custom Codespace configuration, ensure the mounts from the Required Configuration section are included.