Skip to main content

walls

walls runs Claude Code (or anything else) in an Apptainer/Singularity container where only the current folder is writable. It is meant for large shared file servers, where you, and so any agent you start, can write to many files that belong to many people.

cd /faststorage/project/my-analysis
walls            # bash in a box; the folder is at /work. Now run: claude

What the box can and cannot touch

Host Inside the box
Current folder read-write at /work
$HOME ~/.walls/home (shared by all boxes; holds the Claude Code install and login)
/tmp, /var/tmp private per folder, kept in ~/.walls/work/<folder>-<hash>
Extra folders (--ro, --rw, mounts.*) at their real paths, read-only unless asked otherwise
Host PATH (optional) read-only, at the real paths
Everything else on the host not mounted (--contain --no-mount hostfs,bind-paths)
Host processes not visible and not signalable from inside the box (see below)

The main goal is to shield the rest of the file system from Claude sessions. Shielding boxes from each other matters less: they share ~/.walls/home, so one box can read what another left there.

To make that boundary hold, walls refuses to:

  • wall in / or your home folder,
  • give write access to a folder that contains walls' own folders (claude home, scratch, images, config).

All configuration lives in ~/.walls/config.toml, outside any walled folder. Settings for a single folder are stored there too, under [folders."<path>"], so nothing running inside a box can change what the next box may see.

Install

pip install git+https://github.com/munch-group/walls   # or, once released: conda install -c munch-group walls
walls setup                # creates ~/.walls, pulls the image, installs Claude Code
walls doctor               # checks that everything is in place

If no image has been pulled yet, walls setup asks whether to pull docker://mcr.microsoft.com/devcontainers/base:ubuntu as the image ubuntu. If your home quota is small, point APPTAINER_CACHEDIR and APPTAINER_TMPDIR at a scratch disk first.

Where walls keeps its files

Everything is in one folder, ~/.walls:

Path Holds
~/.walls/config.toml all settings
~/.walls/home $HOME inside every box
~/.walls/work a scratch folder per box
~/.walls/images the .sif images
~/.walls/cache what walls remembers about images

Set WALLS_HOME to keep the whole folder somewhere else, or move a single part with paths.home, paths.work or paths.images (for example the images to a scratch disk). To uninstall, close all boxes and delete the folder; that also removes the Claude Code install and login kept in ~/.walls/home.

Earlier versions kept these in ~/claude-home, ~/claude-work, ~/.config/walls and ~/.local/share/walls/images. walls setup moves them into ~/.walls, and other commands refuse to run until it has. A folder whose location you had set yourself stays where it is.

Usage

walls                              # interactive bash in a box
walls /data/ref /data/db           # ...plus read-only access to these folders
walls --rw ../shared-results       # ...plus read-write access to this one
walls -- claude                    # run a command instead of a shell
walls --host-path --aliases        # one-off: mount host PATH, import bash aliases
walls --dry-run                    # print the apptainer command and rcfile, start nothing

Images

walls image pull                                   # image.source, named 'ubuntu'
walls image pull docker://ubuntu:24.04 --name plain
walls image build my.def --name custom --fakeroot
walls image list
walls image use ubuntu [--folder]                  # default for all boxes, or for this folder
walls image rm ubuntu

Claude Code

walls claude install     # official installer, run inside a box with HOME=~/.walls/home
walls claude update

Configuration

walls config show [--effective] [--folder [DIR]]
walls config get  shell.import_aliases
walls config set  shell.import_aliases true             # globally
walls config set  path.mount_host_path true --folder    # only for the current folder
walls config add  mounts.ro /faststorage/project/ref --folder
walls config remove mounts.ro /faststorage/project/ref --folder
walls config unset path.mount_host_path --folder
walls config folders [--prune]                          # folders with their own settings
walls config edit                                       # $EDITOR, validated afterwards

Settings are applied in this order, each overriding the one before:

  1. built-in defaults
  2. global settings
  3. the current folder's settings
  4. command-line flags

List settings (such as mounts.ro) from different levels are combined rather than replaced.

Key Default Meaning
paths.home ~/.walls/home $HOME inside every box (global only)
paths.work ~/.walls/work per-box scratch (global only)
paths.images ~/.walls/images where named .sif images live (global only)
image.default ubuntu image name or .sif path
image.source docker://mcr.microsoft.com/devcontainers/base:ubuntu what walls image pull fetches when given no source
image.source_name ubuntu the image name that pull is stored under
apptainer.binary auto apptainer, falling back to singularity
apptainer.private_pid true give the box its own process and IPC namespaces (--pid --ipc); no box is started on hosts that refuse this
apptainer.extra_args [] extra arguments passed to apptainer exec
mounts.ro / mounts.rw [] extra folders, mounted at their real paths
mounts.workdir /work where the walled folder is mounted; host mirrors its real host path
shell.import_aliases false copy the aliases from your host bash into the box
shell.import_color_aliases true copy only the host aliases that add a colour option, such as ls='ls --color=auto'
shell.prompt host host gives the box the prompt (PS1) of your host bash; anything else is used as the PS1 itself
shell.prompt_prefix magenta [walls] put in front of the prompt; $BOX in it is the name of the walled folder
shell.env_pass TERM, COLORTERM, LS_COLORS, GREP_COLORS, GCC_COLORS, CLICOLOR, CLICOLOR_FORCE, NO_COLOR, FORCE_COLOR host environment variables passed into the box
path.mount_host_path false mount the host PATH read-only and append it to the box PATH
path.exclude /bin, /sbin, /usr/*, ... PATH entries never mounted (the image provides these)

Prompt. A box shows the prompt of your host shell with a magenta [walls] in front. walls reads PS1 from bash -ic on the host at every start. A prompt that runs commands ($(...) or backticks, as git status prompts do) is replaced by \w\$ , because what it calls is usually missing in the box. A prompt that the host builds in PROMPT_COMMAND (starship and similar) is not mirrored either: the box gets whatever PS1 is before that runs.

Aliases. With shell.import_aliases, walls reads the aliases that bash -ic 'alias -p' reports on the host. They are defined in the box after ~/.walls/home/.bashrc has been sourced. An alias that refers to a host path only works if that path is mounted.

Colours. A box colours command output the way your host terminal does. The colour variables in shell.env_pass are passed in, and with shell.import_color_aliases (on by default) walls copies the host aliases that only run a command with a --color option, such as ls='ls --color=auto' or ll='ls -l --color=auto'. Other aliases are left out unless shell.import_aliases is on. walls --no-aliases starts a box without any host aliases. Colour settings kept in files in your host home, such as ~/.gitconfig or ~/.dircolors, are not copied.

Working directory. By default the walled folder is mounted at /work and that is the box's working directory. With mounts.workdir host (or walls --workdir host for one run) it is mounted at its own host path instead, so an absolute path is the same inside and outside the box and tools that print or store paths behave the same way. Any parent folders the box does not already have are created as empty read-only mounts, so a stray write to a parent fails with "Read-only file system" rather than silently going to the box's throwaway overlay and vanishing when the box closes. walls refuses this mode when the real path sits under a system directory the box provides itself (such as /usr or /opt), or where it would hide the box home or Claude Code's install; use /work in those cases, or move the project.

Host PATH. For a PATH entry ending in /bin, walls mounts the parent prefix so that the rest of the installation is available too: a conda env's bin/python needs the env's lib/. The parent is not used if it is /, a top-level folder, or your home folder. Host entries are appended after the box's own PATH, so the image's tools win. An entry is skipped with a warning if mounting it would hide something in the box home, e.g. ~/.local, where Claude Code is installed. An empty folder in the box home does not count: the container runtime leaves one behind as the mount point.

glibc. A host program runs in the box only if the image's glibc is at least as new as the one the program was built for. When a box starts with host PATH mounts, walls warns if this machine's glibc is newer than the image's. walls doctor goes further and lists each mounted host program that needs a newer glibc than the image has. The image's glibc version is read once per image file and remembered in ~/.walls/cache/image-glibc.json. Only glibc is checked: a host program can still fail in the box because a shared library it needs is not mounted.

The walled folder. The wall protects what is outside the folder, not the folder from what happens in it. A program in a box can change anything in the walled folder and in every folder mounted read-write, and whatever it leaves there runs with your full access when you later run it on the host. That goes for scripts, a Makefile, notebooks and task definitions, and also for git: a hook in .git/hooks or a setting in .git/config is run by ordinary git commands, and a shell prompt that shows git status is enough to trigger one. So after a box has worked in a folder, treat the folder's contents as you would code from someone else: look at what changed (git status, git diff) before you run it on the host, and note that git diff does not show changes inside .git. The same holds for ~/.walls/home, which every box can write to: walls only ever runs what is in it inside a box.

Processes. A box gets its own process and IPC namespaces (--pid --ipc): it sees only its own processes and cannot signal any on the host. This needs a host that lets a user namespace mount a new /proc. A host refuses when files are mounted over parts of /proc, as on some cluster front ends. On such a host walls starts no box and says why; it does not fall back to a weaker box. Start the box on a host that allows it instead, for example a compute node with srun --pty walls. walls doctor tells you whether the current host allows it.

To start a box on such a host anyway, switch the separation off with walls --no-private-pid or apptainer.private_pid false. A program in that box can list all host processes with their command lines and send signals to (and so kill) your own host processes. There is no in-between that works: a box without any /proc hides the host's processes, but Claude Code does not start in it.

User namespace. walls always starts Apptainer in a user namespace (--userns) and fails if the host does not allow that; it never uses Apptainer's setuid mode. The user namespace is what keeps a box from reading host files through /proc/<pid>/root.

Network. The network is not walled in. A box shares the host's network, so a program in it has the same network reach as you have on that host: the internet, other machines on the local network, every service that listens on the host's localhost (on a shared machine that includes other users' services), and abstract unix sockets. This breaks the wall if one of those services acts for you without asking who is calling, such as a Jupyter server without a token, a Dask or Ray scheduler, or a development server. Do not run such services on a host while a box is running there. Files that hold credentials for services, such as SSH keys and Jupyter tokens, are not visible in a box unless you mount them.

walls starts a box with a clean environment, so the host's proxy variables (HTTPS_PROXY and the like) are not set in it. On a host that reaches the internet only through a proxy, add them to shell.env_pass.

How it works

walls resolves the settings, then writes a small bash rcfile to ~/.walls/work/<box>/walls.bashrc, which is mounted read-only at /walls/bashrc. That rcfile sources ~/.walls/home/.bashrc and then sets the prompt, PATH and aliases. Finally walls replaces itself with:

apptainer exec --userns --contain --cleanenv --pid --ipc --no-mount bind-paths,hostfs \
  --home ~/.walls/home:/home/$USER --workdir ~/.walls/work/<box> --writable-tmpfs \
  --bind $PWD:/work --pwd /work --bind <extra mounts> <image>.sif bash --rcfile /walls/bashrc -i

Run walls --dry-run to see the exact command for the current folder.

Metadata

Release files for walls 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for walls 0.2.3
File Size Uploaded Provenance Actions
walls-0.2.3.tar.gz 479.0 kB Without provenance Details for walls-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for walls 0.2.3
File Interpreter ABI Platform Actions
walls-0.2.3-py3-none-any.whl Python 3 none any Details for walls-0.2.3-py3-none-any.whl

Total release size: 527.6 kB

Release files / walls-0.2.3.tar.gz

Download URL walls-0.2.3.tar.gz
Size 479.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d79cb608b2354c8047353a36b77b090a637ae49923868238e120233052d72e5a
BLAKE2b-256 checksum
How to use checksums
97864db38340b35b70652ca2a12aa646661429117cb9d56a059111ad00c516bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / walls-0.2.3-py3-none-any.whl

Download URL walls-0.2.3-py3-none-any.whl
Size 48.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d07d1bcc8b2534f6efc1146671adb160a2ba3baa51dcb18d46b6f4282a26a95b
BLAKE2b-256 checksum
How to use checksums
47fe099addc339712372bebb89d8b7b6d8951162bfcb70457d0556baa61faf7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for walls 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page