petri

Run risky work in a throwaway macOS VM

View on GitHub

~/Documents/stackd

Install

git clone https://github.com/sryo/petri ~/.claude/skills/petri

/petri shows up in your slash-command list. Restart your client if it doesn't. Then petri setup once, and your agent takes it from there.

FAQ

When is this the right tool?

When what you're testing can take the whole session down with it: a window manager, a daemon that kills apps, a launchctl reboot userspace, anything you'd rather not aim at the Mac you're working on.

What do I need installed?

Tart on Apple Silicon. The first petri setup pulls a macOS base image, which is tens of GB and happens once. petri doctor tells you what's missing before anything downloads.

How does my project get in there?

The current directory is shared live over VirtioFS, so edits on your Mac are already there. Set PETRI_COPY=1 if you want an isolated tar copy instead.

What happens when the VM wedges?

petri reset throws the scratch VM away and the next run re-clones a pristine one from the golden. That's the whole point: the golden is never tested in.

Can I see what it's doing?

The VM boots windowed by default. petri screenshot grabs the guest's display as a PNG, which is how you check a tiler actually tiled, and petri vnc opens Screen Sharing.

Is there anything it can't run?

SIP is on in the guest, so WindowServer injection needs SIP turned off in the golden first. The guest is a stock image: no Xcode, no Homebrew. Install what your build needs once with petri shell, or bake your own golden.

Is it safe for hostile code?

Isolation is a real VM, but the guest is a stock image with a public default password. Good enough for work that might wedge a session. Not a place to keep secrets or contain something actively adversarial.

Is it free?

Yes, open source and free to use.