unContainer

For developers running coding agents in parallel

A Linux for every agent.
Your disk stays flat.

unContainer gives each Git worktree its own disposable Linux session. Builds, dependencies and Docker state live in guest memory and disappear when the session closes.

No Docker Desktop, no VM manager, no sudo · macOS ARM64 / Linux ARM64

Three worktrees, three isolated sessions
  • feat/api Linux :3000files · processes · Docker 127.0.0.1:57155
  • fix/login Linux :3000files · processes · Docker 127.0.0.1:57161
  • chore/deps Linux :3000files · processes · Docker 127.0.0.1:57170
Host diskbudget cacheMaxSize
Guest images
one per distro, shared
Package downloads
compressed, capped
Builds, node_modules, volumes
never written here

The problem

One laptop was set up for one branch at a time.

Put four agents on four worktrees and the shared machine starts leaking between them.

  1. 01

    Two branches want port 3000.

    The second dev server fails to start, or quietly serves the wrong branch to the agent reviewing it.

  2. 02

    Every worktree installs everything again.

    node_modules, .venv and target get copied into each checkout and stay there after the branch is merged.

  3. 03

    Container state outlives the task.

    Images, volumes and build cache pile up in the VM disk until somebody remembers to prune.

  4. 04

    The agent can reach what your laptop reaches.

    An install script or a confused agent can call production APIs, your LAN or any host on the internet.

Disk

Know where every byte goes.

A guest writes to an overlay held in memory, not to your disk. What unContainer does keep on the host is shared across worktrees and has a budget you set.

WhatWhere it livesWhen it goes away
Checkout copied into /workGuest memoryWhen the session closes
node_modules, .venv, target, build outputsGuest memoryWhen the session closes
Docker images, containers and volumes in a debian:docker guestGuest memoryWhen the session closes
Guest distro imagesHost cacheOne copy per distro, shared by every worktreeKept for offline reuse
Package downloads in named cachesHost cacheOne compressed snapshot per cache, repo and distroOldest first at cacheMaxSize, or cache clean

How project caches are saved and restored

The host streams each new snapshot through zstd as it saves. Debian and updated Alpine guests decompress it as they restore. For older images without zstd, the host decompresses the stream and the guest unpacks it.

Existing .tar.gz snapshots still open and switch to zstd on the next successful save. Set up a shared cache →

Set a ceiling once

Put cacheMaxSize in uncontainer.json at the primary checkout. It covers every worktree and distro of the project. When a new snapshot would pass the limit, the oldest ones go first.

{
  "cacheMaxSize": "512MiB",
  "profiles": { … }
}

See what is retained

uncontainer cache stats --json

Reclaim the project's downloads

uncontainer cache clean

Close sessions whose worktree is gone

uncontainer session prune --dry-run

The trade-off: the cost moves to RAM. Each guest gets 128 MiB to 4 GiB, set with --memory. session list shows guest RAM and the host process’s resident size side by side. Where data lives →

Parallel agents

Every branch can listen on :3000.

Each worktree gets its own session: its own files, processes and localhost. Publish the guest port and the host picks a free loopback port for each one.

Agents sharing a worktree share its session, so one can start the API while another runs integration tests against it.

Tutorial: compare two agent previews →

Local HTTPS · new in v0.4.0

A real https:// URL for every branch.

Start a dev server with --https and its worktree gets its own name under uncontainer.localhost, signed by a local CA that only your account trusts.

The URL survives restarts, even on a different guest port. While the app is down it answers 503 instead of reaching another branch.

Source edits on the host are copied into the guest as you save, so Vite’s watcher sees them and hot updates arrive over WebSockets. HTTP/2 and HTTP/1.1 both work.

Guide: local HTTPS per worktree →

Isolation

Offline until you say otherwise.

New guests start with no outbound network. Allow exactly the registries a build needs, and nothing else answers. Guest DNS resolves only the names you listed.

The guest sees a snapshot of your checkout in /work, not your home directory, your SSH keys or your other projects.

Network policies →

Default: nothing goes out

uncontainer run -- curl -fsS https://example.com
curl: (6) Could not resolve host: example.com

Allow one registry

uncontainer session open --allow pypi.org:443 --allow files.pythonhosted.org:443

Or opt in to everything

uncontainer run --network full -- curl -fsS https://example.com

Workloads

Real builds, not just shell scripts.

Pick Debian, Alpine or Debian with Docker, size it with --cpus and --memory, and save the settings as profiles in uncontainer.json.

A one-off check

Run the test script in a fresh copy of the checkout, including uncommitted files. Your terminal gets the output and the exit code, and the guest is gone.

uncontainer run -- sh ./tests/run.sh

Dependencies once, offline after

One worktree downloads from PyPI. The next one installs from the shared cache with the network off. Each keeps its own .venv.

uncontainer run --profile deps -- uv sync --locked
uncontainer run --profile test -- uv sync --locked --offline

A Compose stack per branch

Each session gets its own Docker daemon, images and volumes. Close it and they are gone. The base image stays cached for the next worktree.

uncontainer session open --distro debian:docker --network full --publish 3000
uncontainer session exec -- docker compose up -d

Guests start from a plain distro image. Tools like uv, Node or Cargo need to be available in the guest. Share downloads across worktrees → · Docker and Compose →

How it works

A Linux kernel in an ordinary process.

unContainer runs the real Linux kernel compiled to WebAssembly through unkernel. Each session is a process on your host, not a VM you manage.

The distro image is mounted read-only under an in-memory overlay. That is why a guest can install, build and run Docker without growing your disk.

Inside unContainer
Host userspace
uncontainer CLI
unkernel
Guest userspace

Debian or Alpine · ARM64

ProcessesServices/work
Docker Engine + Compose with debian:docker
Linux kernel WebAssembly
Host operating system

Agent skill

Your agent knows when to use it.

The unContainer skill teaches Codex and Claude Code when a fresh check is enough, when to keep a session open for a build or a running service, how to serve a dev app at a local HTTPS URL, and to close what it opened.

Read the skill on GitHub ↗

Add the skill from your project root

npx skills add iddar/uncontainer

Then ask

“Build this checkout in Linux, then run the tests in the same session using that build.”
“Start the API on port 3000 in this worktree and tell me which host port to open.”
“Serve this branch’s Vite app over HTTPS as checkout and give me the URL.”

Install

One command. No daemon.

The installer verifies the archive checksum and puts uncontainer in ~/.local/bin. The first run downloads the guest image once. Later, uncontainer update upgrades the CLI and the images you use, after checking each download against the release registry, which lists every release and image with its checksum.

Runs on macOS ARM64 and Linux ARM64 with glibc. Guests are ARM64. Host edits reach an open session when you close and reopen it, and stream live into run --https. Local HTTPS needs mkcert.

Install the CLI

curl -fsSL https://uncontainer.dev/install | sh

Run your first Linux command

uncontainer run -- uname -m
aarch64

Stay current

uncontainer update --check