spwn

Claude Code, Herdr, Cursor, Compose

spwn never runs the agent. Whatever creates the worktree calls spwn up; whatever removes it calls spwn down. The [integrations] table declares which hosts the repo wires up, so spwn install is idempotent and every teammate gets the same setup.

Claude Code

[integrations]
claude_code = true
$ spwn install --host claude-code --dry-run
$ spwn install --host claude-code

spwn install edits two files in the project and nothing else, adding or updating only its own entries and leaving everything else byte for byte. Running it twice changes nothing.

FileEntryEffect
.claude/settings.jsonSessionStart hook (matcher startup|resume) running spwn up --no-wait --jsonEvery session starts with its env up, including resumed sessions whose env went idle and worktrees created without the hook. --no-wait parks the env instead of blocking when another session holds the env lock, so the session starts at once.
.claude/settings.jsonSessionEnd hook running spwn unlock --json --detachHands the env lock to the next session within Claude Code's hook budget; it returns as soon as the daemon has the job.
.claude/settings.jsonWorktreeCreate running spwn worktree create --no-wait; WorktreeRemove running spwn worktree removeClaude Code's WorktreeCreate hook replaces its own worktree creation, so spwn creates the worktree under the worktree root, brings its env up and prints the path. Remove is spwn down plus git worktree remove. These two are registered once the verbs are final.
.mcp.json{"spwn": {"command": "spwn", "args": ["mcp"]}}The agent gets the env-scoped tools described on Agent tools.

Add include_in = ["CLAUDE.md"] under [agent] so CLAUDE.md imports .spwn/AGENT.md, and the agent knows its ports and the fork-or-reset rule without being told.

Herdr

[integrations]
herdr = true

The Herdr plugin gives every pane its own env and shows env health in the sidebar. It consumes the same JSON the CLI prints: spwn list --json, spwn status --json, spwn up --json and the job stream. The plugin is a separate repository; spwn install --host herdr arrives with it.

Cursor

[integrations]
cursor = true

Cursor's worktree config gets spwn up as the setup command and spwn down as teardown. Planned for v1.0 (R22).

Docker Compose

Teams that already run their stack with Compose keep their file. spwn reads it with the same library docker compose uses, so it is interpreted exactly as Docker interprets it, and never edits it. The file goes in include, like a shared base; its services appear by their Compose names, and a [services.<name>] table in spwn.toml may add any common key to one of them:

include = ["docker-compose.yml"]        # read exactly as docker compose reads it

[services.db]                           # the service name from the Compose file
healthcheck = { tcp = "db" }            # add any common key; ports are named after the service

[volumes.pgdata]                        # a Compose named volume gets fork settings
source = "snapshot:seeded"

For each env spwn writes .spwn/compose.override.yml and runs docker compose with the project name {{ name }}-{{ env.slug }}, which namespaces containers, networks and volumes. The override remaps published host ports into the env's port block and swaps named volumes backed by a [volumes.*] entry for that entry's forked path, so Compose services fork like everything else.

The Compose driver (PRD 010) and spwn init, which drafts a spwn.toml from a Compose file (PRD 011), are in the P0 scope but not implemented yet. A Compose file in include fails spwn check with a message saying so today; .toml bases in include already work.

Filesystems and platforms

Where the data root livesForkNotes
ZFS, btrfs subvolumeAtomic snapshot, constant time, services keep runningOne-time zfs allow or subvolume ownership setup; spwn doctor prints it. spwn never uses sudo.
APFS (macOS)Per-file clone with a short pause of the owning serviceA containerized database's data still lives on the host's APFS through a bind mount, so forks keep their clone speed. Docker Desktop's file sharing costs some database speed; the benchmark measures it.
XFS, btrfs fileReflink clone with a pause
ext4Copy, with a warningPut the data root on a btrfs or ZFS volume for real forks.

spwn itself runs on a laptop, inside a Coder workspace or a devcontainer, or on an air-gapped Linux host: it makes no network call you didn't configure. A Coder module, a devcontainer feature and an air-gapped install guide are planned for v1.0 (R17).

Tilt and Kubernetes

Not in v1. Kubernetes drivers and live file sync into containers are an open decision pending research; until then, compose with Tilt. A documented Tilt recipe is on the later roadmap (R27).