README.md

Local AI agent development container #

A Fedora 44 development environment for Codex, Claude Code, Pi Agent, RTK, and the Python, Node.js, Deno, Bun, Rust, and Go toolchains. It deliberately exposes only one selected project directory to the agents.

Quick start #

Build and open a shell with the preferred rootless Podman engine:

scripts/agent-dev build
scripts/agent-dev --workspace /absolute/path/to/project

Use Docker explicitly when needed:

scripts/agent-dev build --engine docker
scripts/agent-dev --engine docker --workspace /absolute/path/to/project

The first run of each agent requires its normal interactive login. Its credential and session state then remain in dedicated container-engine volumes, not in the host home directory. Run codex, claude, or pi from /workspace.

Security model #

The launcher runs as your host UID/GID with a read-only root filesystem, no Linux capabilities, no-new-privileges, no published ports, no engine socket, and no host-home mount. The only host bind mount is the selected workspace. It defaults to 4 CPUs, 8 GiB RAM, and 512 processes; set AGENT_CPUS, AGENT_MEMORY, or AGENT_PIDS_LIMIT to override those limits.

The state volumes are named local-ai-agent-dev-{codex,claude,pi,rtk} by default. They are intentionally durable; removing an agent volume logs that agent out. Set AGENT_STATE_PREFIX to use an isolated set of volumes.

On first launch, RTK is configured globally inside those container-only state volumes: Claude Code gets its command hook, Pi gets its global extension, and Codex gets global instructions to run shell commands through rtk. No RTK files are added to the mounted workspace. The RTK configuration persists, while telemetry and persistent raw-output recall are disabled and its tracking database is discarded when the container exits. Set RTK_DISABLED=1 for an individual invocation to bypass RTK, for example RTK_DISABLED=1 codex.

The supported engineering and productivity skills from mattpocock/skills are also seeded into the private skill directory of Codex, Claude Code, and Pi on first launch. The bundle is pinned in versions.env; update that commit and rebuild to take new upstream skills. Existing local skill directories are never overwritten.

Version updates #

versions.env is the single update surface for externally installed tools. Review release notes, update values there, then rebuild. The Fedora base is version-pinned; replace FEDORA_IMAGE with a verified image digest when you need byte-for-byte base-image reproducibility.

When you run Pi in this repository, the project extension at .pi/extensions/update-versions.ts registers a check_versions tool and a /check-versions command. The tool queries upstream feeds (GitHub releases and branch heads, npm, PyPI, the Fedora release feed plus container registry) and reports current versus latest per pin. It is read-only by default; the agent passes apply: true to rewrite only outdated lines, preserving comments. Prereleases are ignored (Fedora rawhide and betas never win), GitHub tag pins keep their prefix style (v0.50.0 → v0.51.0), and CLAUDE_VERSION is the newest claude-code build in the RPM channel named by CLAUDE_CHANNEL, so it never proposes a version the image build cannot install. After applying updates, review the diffs and rebuild with scripts/agent-dev build.

Inside the container the extension works against the image's own pins: the build bakes .pi/ and versions.env into /opt/pi-agent-setup, and the entrypoint mirrors the .pi/ tree into the persistent agent directory (/home/agent/.pi/agent) on every launch. The image copy is the source of truth — new extensions or configuration files added under .pi/ ship with the next rebuild and overwrite the mirrored copies, while runtime files the image does not ship (RTK's global extension, state created by the agents) are left untouched. Extensions in this repository must start their factory with the same shadow guard as update-versions.ts (skip registration when a project .pi/extensions/ copy of the file exists above the working directory): Pi rejects two loaded extensions that register the same tool name, which happens whenever the mounted workspace is this repository itself. Because the container root filesystem is read-only, apply only works on the host; in the container the tool reports available updates and the fix is the usual edit-and-rebuild loop.

The image also ships the Jev complexity router (.pi/extensions/jev-complexity-router.ts, mapping in .pi/jev-router.json), which routes each conversation to an OpenRouter model by Jev-evaluated complexity. On the first launch of a state volume the entrypoint makes jev-router/auto Pi's default model by merging it into the agent settings.json; later /model choices are kept.

The entrypoint also enables Pi's codemode tool once per state volume by adding "+codemode" to defaultTools in the same settings.json. Pi otherwise activates it only when an MCP server needs it. Remove the entry to turn it off again; it is not re-added on later launches.

Pi's built-in system prompt is deliberately minimal, so the image appends working guidance to it (scope, verification, destructive actions, and the container's constraints) from container/pi/APPEND_SYSTEM.md. The build copies container/pi/ over the same image tree as .pi/, and the entrypoint mirrors it to /home/agent/.pi/agent/APPEND_SYSTEM.md, where Pi loads it globally. It is kept out of .pi/ so that Pi on the host does not pick it up as a project file. A workspace that ships its own .pi/APPEND_SYSTEM.md replaces the global one once trusted.

compose.yaml is provided for Compose-compatible workflows, but scripts/agent-dev is the recommended interface because it handles Podman SELinux labels and arbitrary host UID/GID state-volume ownership.