sol runs Claude Code inside a container, so Claude only touches the repository you are working in and never the rest of your machine. solr resumes the conversations that a reboot, a crash or a closed terminal left behind.
npm install -g @solirius-reply/ai-cli
cd my-repo
sol # claude, in a container
sol -c # every argument goes straight to claude
solr # pick up where you were- A container per directory. Running
solagain in the same repository joins the container that is already running. Each terminal is its owndocker exec. The container is removed when the last terminal using it exits. - One Claude login for everything. Claude's state (
~/.claudeand.claude.json) lives in a Docker volume calledsol-claude, not on the host. Every container uses it whatever the directory, so you run/loginonce. Your host~/.claudeis never mounted. - Nothing to do in a container. Inside a container already (a dev container, a codespace, or a session
solstarted),soljust runsclaude. - devcontainer.json is honoured. If the repository has
.devcontainer/devcontainer.json, its image, mounts, environment, run arguments, forwarded ports and user are used. If its image has no Claude Code,solinstalls it once into a sharedsol-toolsvolume. - Ports are published as they open. Any server the session starts listening on is published on the same port of
localhost, if that port is free. - Docker works inside. The container runs its own Docker engine, so
docker,docker composeand Testcontainers work without access to the host's Docker.
The default image is ghcr.io/solirius/devcontainer. It is Ubuntu with Java, Node, Python, Claude Code and the usual dev tools; see image/README.md.
- Docker: Docker Desktop on macOS, Docker Engine on Linux. On Windows, run it inside WSL2.
- Node 20 or later.
| The repository | Bind-mounted at its own host path, so paths in transcripts match |
| Claude's state | The sol-claude volume, shared by every session |
~/.gitconfig, ~/.ssh, ~/.config/gh |
Read-only, when they exist (default image only) |
| SSH agent | Forwarded from $SSH_AUTH_SOCK on Linux, or Docker Desktop's agent on macOS |
| Build caches | The sol-m2, sol-gradle, sol-npm and sol-pip volumes, shared by every session |
With a devcontainer.json, the file's own mounts replace the home binds and caches above. The repository, the Claude volume and the SSH agent are always added.
| Property | Behaviour |
|---|---|
image |
Used instead of the default image |
mounts |
String and object forms. ${localWorkspaceFolder}, ${containerWorkspaceFolder}, their Basename forms and ${localEnv:VAR[:default]} are substituted. The host Docker socket is dropped |
containerEnv |
Set on the container |
remoteEnv |
Set on each session |
runArgs |
Passed to docker run, except --network/--net |
forwardPorts |
Numeric ports are published on localhost straight away |
remoteUser / containerUser |
The user the session runs as. Otherwise the image's own user, otherwise root |
build, dockerComposeFile, features, workspaceFolder/workspaceMount and the lifecycle commands are not supported. sol says so when a file uses them. An image that has no Claude Code needs curl or wget for the one-off download of its native binary, which is checksum-verified.
Every conversation registers itself when you first type into it, and closes its entry when you exit it normally. Anything still open after a crash, a reboot or a killed terminal can be restored:
solr # restore the most recent waiting conversation, preferring this directory
solr --list # show what is waiting, in the order solr would restore itsolr changes to the conversation's directory and runs sol -r <id>. That joins the directory's container, or starts it again. A conversation still running in another terminal is never offered. If two terminals run solr at the same time, they restore different conversations.
sol has no flags of its own. Everything is set with environment variables:
| Variable | Effect |
|---|---|
SOL_IMAGE |
Image to use, overriding devcontainer.json and the default |
SOL_PULL |
daily (default: pull if missing, otherwise check once a day), always, missing or never |
SOL_MOUNTS |
Extra binds, written /host:/container[:ro],… |
SOL_SESSION |
Container name to use instead of the one derived from the repository path |
SOL_CLAUDE_VOLUME |
Volume for Claude's state (default sol-claude). Use it to keep work and personal logins apart |
SOL_NO_SSH_AGENT=1 |
Do not forward the SSH agent |
SOL_NO_PORT_WATCH=1 |
Do not publish ports, including forwardPorts |
SOL_PORTS_PUBLIC=1 |
Publish on 0.0.0.0 instead of 127.0.0.1 |
SOL_DRY_RUN=1 |
Print the docker run and docker exec commands and stop |
SOL_VERBOSE=1 |
Explain each decision on stderr |
SOL_NO_UPDATE=1, SOL_OFFLINE=1 |
Skip the check for a newer sol on npm |
SOL_FORCE_HOST=1 / SOL_FORCE_CONTAINER=1 |
Override the in-container detection |
sol updates itself from npm when a newer version is published. It never uses sudo: if the global npm prefix is not writable, it prints the command to run instead.
corepack enable
yarn install
yarn lint && yarn typecheck && yarn test:coverage && yarn build
node dist/bin/sol.js # run the build
docker build -t solirius/devcontainer:test image && image/test.sh solirius/devcontainer:testRead CLAUDE.md before changing anything. It explains the design rules the tests enforce.
- The CLI. A push to
masterthat changes what ships (src,runtime,package.json) publishes to npm. The patch number is bumped automatically, and the release is taggedv<version>. Publishing uses npm trusted publishing (OIDC), so no npm token is stored. Releases carry a provenance attestation once the repository is public; npm refuses one from a private repository. - The image.
.github/workflows/image.ymlrebuilds the image whenimage/changes, every Monday, and on demand. It pusheslinux/amd64andlinux/arm64builds tagged1,latest,1.YYYYMMDDandsha-<commit>. The CLI uses:1, so a rebuilt image reaches everyone without a CLI release. Bump the major tag, andDEFAULT_IMAGE, only for a breaking change to the image contract. - Renovate keeps everything current: the base image digest, every tool version in
image/Dockerfile(eachARGcarries a# renovate:comment), GitHub Actions, and the dev dependencies. Every update, majors included, merges itself once all of its checks pass. Renovate waits for the checks itself, becausemasterhas no required status checks; an image update has to passimage/test.shbefore it can merge.
- On npmjs.com, create the
@solirius-replyorganisation. Do the first publish by hand (npm publish --access public). Then add a trusted publisher forSolirius/sol-cli, workflowrelease-cli.yml. - After the image workflow's first push, open the
devcontainerpackage under the organisation's Packages on GitHub. In its settings, make it public, sodocker pullneeds no login. The workflow pushes withGITHUB_TOKEN, so no secrets are needed. - Install the Renovate GitHub App on the repository.
- Allow
github-actions[bot]to push the release commit and tag tomaster, ifmasteris protected.
MIT. Derived from hmcts/hmcts-ai-cli; see LICENSE.