Skip to content

Repository toolchains

A fix run judges the writer’s change by running your repository’s own check, such as npm test or pytest. That check needs the language, the test runner and the project’s dependencies. Before the writer starts, axocoatl run does three things:

  1. It reads your repository’s files to choose a toolchain: node, python, rust or go. The Session runs an official Debian-based image of that language, pinned by digest. Axocoatl builds the image once on your computer.
  2. It runs a setup that installs your dependencies, such as npm ci or pip install -e '.[test]'. Only that ecosystem’s package registries are open while the setup runs, and they close before the first model call.
  3. It runs a probe to make sure the check can work in that image. A check whose program is missing ends the run with exit code 3, before the writer or the reviewer runs.
Terminal window
cd ~/src/my-app
axocoatl run fix --task "Paging skips the last item" \
--model writer=ollama:qwen3-coder:30b --model reviewer=ollama:gpt-oss:20b
· note: image localhost/axocoatl-recipe-node:3b267c748259 · toolchain node (package.json at the repository root) · check npm run test (detected from the repository) · setup npm ci --prefer-offline --no-audit --no-fund (detected; registries registry.npmjs.org open for it alone)
· note: setup `npm ci --prefer-offline --no-audit --no-fund` (detected): exited 0 (2.9 s); 15 connections to registry.npmjs.org allowed, 0 refused; the registries were closed; the Workspace's toolchain cache was made read-only again before the first model call

This applies to the built-in fix, fix-claude-code and fix-codex loadouts, and to any loadout with a detected check. qa and audit do not run your tests, so they keep their images. With --toolchain none, a run works the way it did before toolchains existed.

ToolchainFiles at the repository rootImage
nodepackage.jsonNode.js 24.21.0 with npm, plus pnpm and yarn through corepack, and make
pythonpyproject.toml, setup.py, setup.cfg, requirements*.txt or pytest.iniPython 3.13.16 with pip and venv, and make
gogo.modGo 1.27.2 with gcc and make
rustCargo.tomlRust 1.99.1 with cargo, rustc and gcc, and make

A repository can have the files of more than one toolchain. In that case the run uses the toolchain of the check command’s program: pytest and python3 are Python, cargo is Rust, go is Go, and npm, npx, node, pnpm and yarn are Node.js. When the program does not identify a toolchain, the run is refused with exit code 3. The message lists the candidate toolchains so you can choose one with --toolchain.

The run prints the choice and the reason at the start, records both in the run’s manifest, and includes them in the receipt.

A detected check runs the first one of these that the run finds:

  1. --check "<command>".
  2. A Check command: line in the root AXOCOATL.md, such as Check command: `pytest -q` . The line can be a list item or bold, and the command can be on the next line in a code block.
  3. The repository’s files:
    • a check, test, ci or build script in package.json, run as npm run <script>;
    • cargo test;
    • go test ./...;
    • for Python, python3 -m pytest when the repository uses pytest: a pytest config file, a conftest.py, pytest named in a manifest or requirements file, or test files written as plain def test_... functions, which only pytest runs. Otherwise python3 -m unittest discover -v, for tests written with unittest. python3 -m puts the repository root on the import path, so tests import a module at the root whether or not the project is installed;
    • make test.

The setup installs the dependencies that the repository declares:

ToolchainInstall
nodenpm ci with package-lock.json; pnpm install --frozen-lockfile with pnpm-lock.yaml; with yarn.lock, yarn install --frozen-lockfile for Yarn 1 and yarn install --immutable for Yarn 2 or later (named by packageManager, or a Berry lockfile); otherwise npm install --no-package-lock. Skipped when package.json declares no dependencies.
pythonpip install into a virtual environment: -e '.[test]' for an installable project (or tests, testing or dev, whichever extra it declares first), --group for a matching PEP 735 dependency group, and -r for each root requirements*.txt. Test or dev lists that pip cannot read (Poetry’s dependency groups, uv’s dev-dependencies, PDM’s and Hatch’s) are given as requirements, with Poetry’s ^ and ~ constraints translated. When the check runs pytest and nothing the command installs brings it, pytest is added.
rustcargo fetch, when Cargo.toml declares dependencies or a workspace.
gogo mod download, when go.mod requires modules.

--setup "<command>" replaces the detected install, and it gets the same registries. --no-setup turns the setup off.

The setup runs in the Session as the non-root writer user, with a 15-minute limit. Only the setup’s own processes can reach these registries, and only while it runs:

ToolchainRegistries
noderegistry.npmjs.org, plus registry.yarnpkg.com and repo.yarnpkg.com for a yarn.lock
pythonpypi.org, files.pythonhosted.org
rustindex.crates.io, static.crates.io, crates.io
goproxy.golang.org, sum.golang.org

Axocoatl opens each registry as a per-Session allow and revokes it when the setup ends. Both changes are written to the Session’s network record, with the run as the actor. If a registry cannot be revoked, the run stops before the writer starts. A setup that is refused 30 connections, for example to a git dependency on another host, is stopped at once rather than retrying until the limit. To let a setup reach another host, add it to sandbox.egress.allow. A loadout that sets sandbox.network: none opens no registry, and the run’s first note says so.

A setup that fails ends the run with exit code 5, before any writer or reviewer turn. The error names the command, its exit code and its duration, followed by the last lines of the installer’s output.

The run’s notes, its manifest and its receipt record the setup command, its exit code and duration, the registries, and how many of the setup’s connections were allowed and refused. The run’s network summary counts these connections too.

Each Workspace has its own toolchain cache volume, axo-tc-<24 hex digits>, named after your daemon’s data root and the repository path. Runs mount it at /opt/axocoatl-cache, where the image keeps what the setup installs:

  • Node.js: the npm cache, plus the pnpm store, the Yarn caches and the package managers corepack downloads. npm ci --prefer-offline installs from the cache.
  • Python: the pip cache and the virtual environment.
  • Rust: cargo’s registry (CARGO_HOME).
  • Go: the module cache.

When your dependency files, the command and the image are unchanged since the Workspace’s last Python, Rust or Go setup, the next run installs nothing and opens no registry (nothing to install in its note). Node.js installs into each Session’s own node_modules volume, so npm ci runs every time, from the cache and without downloads.

Only the setup writes the cache. The Workspace’s toolchain directory is handed to the writer user for the setup alone. Then root takes it back, owned by root and read-only to the Session’s users, before the first model call, whether the setup succeeded or not. The writer’s turns and the checks run from the cache but cannot change it. A writer can therefore not change the test runner, a dependency or the virtual environment that its own run’s checks, or any later run’s checks, use. Handing the directory over and taking it back changes the owner of every file in it, so a Node.js run, whose setup runs every time, does it on every run: for a cache of 61,201 files and directories it took 0.4 to 0.6 seconds in all on a Mac’s Podman machine (Apple M5 Pro, 6 CPUs). Build output is not cached: Go’s build cache is in the Session user’s home directory and cargo’s target directory is under the Session’s /tmp, so nothing one run builds is reused by another, and no target/ directory is written into your repository.

To start a repository’s cache over, run axocoatl recipe clear-cache --repo DIR (without --repo, the current directory; --all for every repository of your data root). The next run installs everything again. A cache that a container of one of the repository’s Sessions still uses is left as it is, and the command names that Session: let its run end, or close it, first. A run’s container stops when the run ends.

The toolchain images also keep these files out of your repository: Python bytecode, pytest’s cache, and an editable install’s *.egg-info directory.

The toolchain is an image recipe, like claude-code and codex (External agents). Axocoatl builds it locally from a pinned official image and adds git and make:

ToolchainOfficial image (multi-architecture index digest)First build downloadsImage on disk
nodedocker.io/library/node:24.21.0-bookworm-slim@sha256:d6aa754f16b3197301076f047b5def2f02ea1dbbc2ca920407d46d7ec7f87b20about 100 MBabout 365 MB
pythondocker.io/library/python:3.13.16-slim-bookworm@sha256:a1165e272e578941b84abc79e4ab38a0305cd12803a5c4247979ac7655f4d641about 65 MBabout 250 MB
godocker.io/library/golang:1.27.2-bookworm@sha256:5cf287a799e6b94384bad13d16b14904c531f51ba65792237e122ce42b392f61about 300 MBabout 880 MB
rustdocker.io/library/rust:1.99.1-slim-bookworm@sha256:a24e292b4af7bdee351a31d3a6379972a5652f0ea22a1b6d6883324ac4f5097cabout 330 MBabout 920 MB

The download sizes are the compressed layers of the official image plus the Debian packages for git and make, and the sizes on disk were measured on Apple silicon (linux/arm64). On amd64 the Rust layers are about 40 MB larger.

The first run that needs an image builds it. Before it builds, axocoatl run has the daemon check the run as --dry-run does, without loading any model, so a run that cannot start (a credential that is not stored, a reviewer on a provider that cannot review, a model the provider does not have) is refused with the same message and exit code first, and nothing is built. Then it prints what it builds and about how large it is, and Podman’s progress appears on standard error. Later runs reuse the image. To build it ahead of time, run axocoatl recipe build python. --no-build refuses the run instead and names the build command. axocoatl recipe list lists the toolchains and the images you have built.

fix-claude-code and fix-codex combine their agent recipe with the toolchain into a single image, such as axocoatl recipe build claude-code python. On a Python, Rust or Go image, Node.js from the recipe base’s own pinned image is copied in, because the agent’s install needs it. The build line adds the agent’s size: about 645 MB on disk for claude-code python.

No directory that a Session user can write is on the PATH of root’s commands: every root command in a Session (its readiness checks, its user setup, the cache steps above) runs with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin. The images also drop what the official images leave writable by every user: the Go image’s /go (a Session user’s GOPATH is in their home) and the Rust image’s cargo and rustup directories.

Go runs with GOTOOLCHAIN=local. A go.mod that requires a newer Go than 1.27.2 fails the setup and names the version it needs. Outside the setup, GOPROXY=off, so a module that is not in the cache fails at once.

After the setup, the run checks that the check can work. It confirms the check’s program is on the writer’s PATH, then runs the check once on the untouched tree, as the writer and with no network, through the same supervisor and sandbox that the run’s own checks use. A check still running after 2 minutes is stopped, with every process it started, and the run goes on. A check that runs and fails is expected, because that failure is what the fix is for.

The run is refused before any writer or reviewer turn when:

  • the check’s program, or the test runner its package.json script starts (such as jest for npm test), or a known toolchain or test-runner program is not found (exit code 3). A missing path such as ./bin/greet is not a refusal: the task may be to add it;
  • Python reports No module named for the module python -m runs, or for a package the repository declares as a dependency and the setup did not install (exit code 3). A module the task asks for, or a misspelled import, is the writer’s to fix;
  • the check ran no test although the repository has test files, as when unittest discover finds only pytest-style functions (exit code 3), because no change can make such a check pass;
  • the Session’s sandbox refuses what the check does, such as a cross-directory rename on Linux before 5.19 (exit code 5).

The message names the image, the check, what is missing, and the fixes, which depend on the language and the program. --no-probe skips the probe, for a check it is wrong about.

axocoatl run: the check `npm run test` cannot run in this run's image: the program `jest` was not found. Image: localhost/axocoatl-recipe-node:3b267c748259, with the node toolchain (package.json at the repository root). No writer or reviewer turn ran. To fix it: declare it in package.json's devDependencies, or give its install with --setup "COMMAND", where COMMAND installs jest; …
FlagLoadout fieldEffect
--toolchain node|python|rust|goenvironment.toolchain, or the toolchain among environment.recipesUse this toolchain whatever the files say.
--toolchain detectedenvironment.toolchain: detectedDetect it (the default for a loadout with a detected check).
--toolchain noneenvironment.toolchain: noneNo toolchain: the image as the loadout names it (alpine:3.20 for fix), the setup only from --setup or environment.setup, and only your configured egress lists.
--image <ref>environment.imageRun this image as it is, without a toolchain. It must be a curated or trusted image. Give its installs with --setup. You cannot combine it with --toolchain <language>.
--setup "<cmd>"environment.setupReplaces the detected install. With a toolchain, it gets that toolchain’s registries.
--no-setup—No setup.
--no-build—Refuse instead of building a missing image.
--no-probe—Skip the probe.

A loadout that sets environment.image gets no toolchain unless the run passes --toolchain <language>, which replaces that image with the toolchain’s. A loadout cannot set both image and toolchain.