Run OpenCode
1
Start OpenCode
Replace The first run downloads the package and may take a couple of minutes. OpenCode should render its prompt and offer
./my-project with the project directory you want OpenCode to work on:/connect for provider setup. The two named volumes retain its normal XDG configuration and data directories if you recreate the sandbox.2
Start another session
After leaving OpenCode, return to the same sandbox and workspace with:
3
Verify the installation
Exit the TUI, then run:The pinned example prints
1.18.4.4
Export changes
Review the diff inside the sandbox before copying anything back:For a Git repository, export a patch instead of replacing your host checkout:Copy the patch to the host:Check that it applies cleanly before applying it:
5
Clean up
Remove the sandbox:Remove persisted configuration and data only when you no longer need them:Keep the volumes if you want to retain provider connections, sessions, and OpenCode configuration. Never copy an agent’s entire home directory back to the host.