---
title: "Where should your code live in a Docker Sandbox?"
description: "Docker's sbx sandboxes for coding agents support three ways to place a repository, and each changes how the human participates."
url: "https://swe.quest/articles/where-should-your-code-live-in-a-docker-sandbox-22cf6de6c5be995d"
canonical: "https://www.docker.com/blog/docker-sandbox-code-checkout-workflows/"
source: "Docker"
published: "2026-11-02"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["ai-agents","sandboxing","version-control","developer-productivity","containers"]
---

# Where should your code live in a Docker Sandbox?

A post on [Docker](https://swe.quest/sources/docker.md), published 2026-11-02, 5 min read, How-to. Original: [https://www.docker.com/blog/docker-sandbox-code-checkout-workflows/](https://www.docker.com/blog/docker-sandbox-code-checkout-workflows/)

## Summary

Docker's sbx sandboxes for coding agents support three ways to place a repository, and each changes how the human participates. Mounting the host checkout gives live shared editing and hot reload, but branch switches and dependency installs are shared, and native binaries like esbuild can break across Linux and macOS/Windows. Mounting a host git worktree isolates tasks but leaves the agent without Git, because the .git file points outside the mount. Clone mode or a mountless sandbox keeps an independent checkout with full Git, at the cost of handoff via remotes, \`sbx ports\` publishing for previews, and losing files when the sandbox is deleted.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Sandboxing & isolation](https://swe.quest/tags/sandboxing.md) (Security)
- [Version control](https://swe.quest/tags/version-control.md) (Engineering practices)
- [Developer productivity](https://swe.quest/tags/developer-productivity.md) (Engineering practices)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)

## Prerequisites

- Git worktrees and remotes
- Docker basics ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))

## Keywords

Docker Sandboxes, sbx, Git worktrees, Claude, jganoff/wsp

## Related posts

- [Running AI agents in GitHub Actions with Docker Sandboxes](https://swe.quest/articles/running-ai-agents-in-github-actions-with-docker-sandboxes-9cf9181798d75585.md): Docker · 2026-08-21 · Medium · 7 min read · AI agents, Sandboxing & isolation, CI/CD, Virtualization, AI for coding
  GitHub Agentic Workflows (gh-aw 0.82.9) supports Docker Sandboxes (sbx) as an agent runtime, so a CI coding agent gets root, sudo and unrestricted shell inside a disposable microVM with its own kernel and private Docker daemon.
- [Why AI Agents Need Isolation](https://swe.quest/articles/why-ai-agents-need-isolation-2e7b1a6342af3236.md): Docker · 2026-07-01 · Easy · 9 min read · Sandboxing & isolation, AI agents, Virtualization, Containers, AI for coding
  AI coding agents that run commands, install packages and handle credentials should execute behind an isolation boundary rather than directly on the developer's host.
- [Agents in the Sandbox](https://swe.quest/articles/agents-in-the-sandbox-6c4d7e3dae7cde47.md): Railway · 2026-06-24 · Medium · 9 min read · AI agents, Sandboxing & isolation, Developer tools, TypeScript
  Railway sandboxes now ship Claude Code, Codex, OpenCode and Pi in the default image and can join an environment's private network, which lets agents test against real Postgres, Redis and internal services.
- [Building AI Teams: How Docker Sandboxes and Docker Agent Transform Development](https://swe.quest/articles/building-ai-teams-how-docker-sandboxes-and-docker-agent-transform-development-50a60f5e32d42807.md): Docker · 2026-03-11 · Medium · 9 min read · AI agents, Sandboxing & isolation, Containers, AI for coding, Virtualization
  Docker Agent defines teams of specialized AI agents in YAML, where a root "product manager" agent delegates to designer, engineer, QA and fixer sub-agents, each with its own model, instructions and toolsets (filesystem, shell, think, todo, memory, MCP).
- [Docker Sandboxes vs. Containers: Choosing the Right Isolation for AI Agents](https://swe.quest/articles/docker-sandboxes-vs-containers-choosing-the-right-isolation-for-ai-agents-9c74485ae65a1b1c.md): Docker · 2026-11-06 · Medium · 14 min read · Sandboxing & isolation, AI agents, Containers, Virtualization, Security
  Containers are isolated processes sharing the host kernel. Docker Sandboxes are microVMs with their own kernel, filesystem, network and private Docker Engine, designed for autonomous coding agents that accumulate state for hours and act on untrusted instructions.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
