scripts/launch_agent_container.py creates or reuses a small TOML config and launches a containerized codex or claude session without mounting the full home directory.
- Engine: auto-select
apptaineron Linux when available, otherwisedocker - Image:
node:24-bookworm-slimfor Docker,docker://node:24-bookwormfor Apptainer - Config:
./.agent-container.toml - Skills: mounts this repo's
skills/directory read-only when present - System tools: Docker bootstraps
gitin-container when needed; Apptainer treats the image as immutable and expectsbash,git, and any installer transport likecurlorwgetto already be present
python scripts/launch_agent_container.py \
--agent codex \
--rw-dir /path/to/repo \
--ro-dir /path/to/reference-data \
--skill-dir /path/to/extra-skills \
--write-config \
--dry-runOn first run, the script writes the config file if it does not already exist. Later runs can reuse or edit that TOML file directly.
- mounts only the directories you list, plus a narrow agent state directory and a launcher-specific tool state directory
- does not mount the full home directory
- mounts each skill read-only directly into the agent's in-container skills directory
- expects each discoverable skill to be a top-level directory under the mounted
skills/root; focused lab notebook actions are mirrored as top-levellabnb-*entries for Claude Code and Codex compatibility - mounts task code or data directories read-only or read-write based on the provided flags
The generated config stores:
- selected agent
- container engine and image
- agent state and tool state directories
- extra authentication paths that should be mounted into the container
- read-only and read-write task mounts
- skill directories
- environment variables to pass through
- extra CLI options that should be passed to the agent before positional args
- extra agent CLI arguments
Use --cli-option for agent flags that should appear before positional args or subcommands.
Examples:
python scripts/launch_agent_container.py \
--agent codex \
--cli-option --model \
--cli-option gpt-5 \
--cli-option --full-auto \
--agent-arg login \
--agent-arg statuspython scripts/launch_agent_container.py \
--agent claude \
--cli-option --verbose \
--agent-arg auth \
--agent-arg statusUse agent_args for trailing subcommands or positional args.
The launcher already mounts the selected agent's main state directory, such as ~/.codex or ~/.claude, in read-write mode.
Skill directories are mounted directly into /home/agent/.codex/skills/<skill-name> or /home/agent/.claude/skills/<skill-name> inside the container, so the host skill directories are not rewritten with container-only symlinks.
If credentials or helper auth files live elsewhere, add them with --auth-path /path/to/auth-store. Home-relative auth paths are mounted back into the same relative location under /home/agent, and non-home auth paths are mounted under /home/agent/.agent-auth/.