Per-session Git checkouts

Every new coding-agent session in a Git project gets its own working files, Git index and devctrl/sessions/<opaque-id> branch. This applies to new sessions in an existing container as well as sessions in a new container. Agents sharing one container no longer start in the same mutable checkout by default.

The controller assigns immutable checkout ownership when accepting the launch. The execution host materializes it before starting the agent, independently of the TUI, browser or desktop connection. No container rebuild, new bind mount or host-global Git installation is required. A host without the isolated-checkout capability must be updated before it accepts new coding sessions.

Initial state and concurrent work

The checkout starts from the selected repository's current commit, plus tracked changes and nonignored untracked inputs. The source's branch, index and files are not modified. Source staged changes become working-tree changes in the new checkout; the original index is not copied. Ignored dependencies and build caches are not copied. Commit or ignore generated content first if uncommitted inputs exceed 20,000 files or 512 MiB. Git command output, including a binary diff, is limited to 8 MiB while streaming; commit larger patches before launch. If the source changes while preparation is running, startup fails before launching the agent; retry against the latest state.

An additional repository prepared for a shared container starts with the committed files from its host repository. Per-session checkouts then copy that prepared base's current state; unrelated dirty files in the original host repository are not implicitly imported.

A continuation or cross-agent import uses its parent's checkout as its source, including uncommitted work. It receives another branch and directory; the original session and Frozen snapshot remain available. Publish, merge or cherry pick completed work explicitly. Creating a second session does not merge its results into the first one's branch or synchronize branches automatically.

When both the host and container Git support relative worktree links, devctrl uses native Git worktrees backed by one bare object store per repository and container. Relative links keep Git usable at both the host path and the mounted container path, and after archive recovery. Older Git receives an independent clone with its own .git directory and branch. It preserves the same file/index isolation instead of falling back to a shared checkout. This compatibility path shares immutable objects through a relative Git alternate inside the same persistent mount; each clone keeps its own refs, index and new objects. The managed store retains a base ref for every checkout and must stay present while those sessions exist. Dependency/build directories remain separate and can consume additional disk. Submodules are not initialized automatically.

Nested Docker receives only the code-checkout and Git-object subdirectories, not session homes, native history or credentials. Starting a coding session does not require Docker-in-Docker and never starts or repairs its sidecar. A healthy, owned sidecar with the required checkout mounts remains available. Otherwise the session starts with Docker disabled and a reason in its private startup rules and DEVCTRL.AGENTS.MD. Docker context, TLS and socket overrides cannot silently fall back to the host daemon or another workspace. Tasks requiring Docker must request managed repair separately; existing nested workloads are preserved.

Persistence and access

Checkouts and Git metadata live inside the workspace's persistent sessions storage. Native resume, account changes and Thaw retain the original directory; they do not create another checkout or reset existing files. Missing saved files require archive recovery rather than silently recreating an empty conversation workspace. Shell sessions, repository-free Control Room sessions, explicit registration of existing native conversations and already-running sessions keep their previous checkout behavior.

The generated DEVCTRL.AGENTS.MD identifies the session branch and tells the agent to retain other sessions' work. Project devctrl.md, .agent.env and .agents.env delivery refreshes each retained session checkout. Context-tool updates likewise refresh every session's own guide.

Each checkout is bound to one controller user, repository, workspace and session. Git isolation prevents accidental concurrent edits and index conflicts; it is not a security boundary between sessions in the same container. Those sessions still share the filesystem, processes, ports and resources. Different server users continue to run in separate containers.

Host-side Git preparation supports repositories whose metadata belongs to a managed session user. Exact validated checkout and Git-store paths are trusted through a private temporary configuration, including local Git transport child processes. It does not edit the host user's Git configuration or trust wildcard paths. Hooks and filesystem monitors stay disabled, and the temporary file is removed after preparation. A failure reports the Git operation, exit code and a fixed diagnostic category without exposing command arguments or Git stderr.

The Changes tree includes each session checkout separately. Dashboard Git activity scans the primary checkout and retained session checkouts, deduplicating commits by SHA. Missing or capped checkout scans are reported as partial instead of treating unobserved work as zero activity.

Freeze, archives and cleanup

Freeze retains the checkout and branch. S3/Overnight archives include session checkouts, their Git object stores and private ownership receipts alongside native history. Recreating a container mounts that retained state again.

Session shutdown manifests can clean authorized artifacts only beneath that session's checkout or temporary roots; another session's checkout is excluded. The checkout root and Git metadata are retained for resume and are never automatic artifact-cleanup targets. Deleting a session does not authorize deleting retained source changes or shared Git objects. Review retained workspace data separately.

Autonomous Agent Runs checkpoint and verify the session checkout, and preserve its working directory for offline/current-state wake. Exact/fork Run recovery that replaces a container's source is unavailable for these new checkouts; use a separate session continuation for another branch. Existing legacy Run recovery retains its prior behavior.

API, MCP and clients

The ordinary POST /v1/sessions creation flow enables this behavior automatically for a new Git-backed coding session. Session.checkout exposes the assigned branch and host/container paths; Session.source points at the session checkout. DEVCTL_REPOSITORY_WORKDIR is set by the controller and verified against a host-owned receipt before provider launch. Existing launch APIs and MCP commands remain the single implementation used by TUI, web, desktop and CLI.