dev-container-handoff
Continue in a Dev Container
A plain Dev Container is a Linux container from the Ubuntu base image (mcr.microsoft.com/devcontainers/base:ubuntu) with an agent host running inside. It keeps its files in a Docker volume and is listed in Remote Environments, like one created there with the Create Dev Container action. A new session inside it continues the work. This session stays as the record of the conversation.
1. Confirm
If the user didn't explicitly ask to move the work into a Dev Container, ask once before creating one. Say where it runs and that the new session starts without this conversation's history.
The container runs on the same host as this session by default: this computer, or the SSH, Tunnel, or WSL host this session runs on. For another host the user names, get its exact ID from list_agent_hosts.
2. Create the container
Call create_dev_container, with host only when it should run on a different host than this session. If the tool isn't available, explain that Dev Containers can't be created from this window. Building one can take a few minutes. If it fails, explain the error, such as Docker not running, and help fix it before calling it again: each call creates another container.
The result has the container's hostId and its empty workspace folder. If its status is notReady, the container exists but can't start sessions yet: don't create another one; follow its guidance.