PostHog Code cloud runs
Contents
A cloud run is a task which runs in a sandbox environment instead of on your computer. You can close the app, switch networks, or shut your computer, and the agent keeps going. Reconnect when you're ready to check on progress or hand the task back to your computer.
How a cloud run works
When you start a cloud run, PostHog Code:
- Provisions a fresh, isolated workspace for the task.
- Applies the cloud environment you've picked, which sets the network access rules and injects the secrets and environment variables the workspace needs.
- Checks out your repo at the branch you started from.
- Starts the agent on your prompt.
Once the agent is done, you can pick the work back up locally for review (see Handing off between cloud and local below) or open a PR straight from the run.
Configuring cloud for your workflow
Cloud runs use a cloud environment to control:
- Secrets and environment variables injected into the cloud workspace
- Network access, either an allowlist of trusted services, full internet access, or a custom set of domains
Handing off between cloud and local
A task can move between local and cloud in either direction. When you hand off, PostHog Code transfers:
- All your code changes. Committed, uncommitted, unpushed, untracked, everything in the working folder gets carried over.
- The branch you're on.
- The full agent conversation, so it remembers what you've already discussed.
The other side picks up exactly where you left off, and you can hand off again at any point.
Handoff to local requires a clean working tree on the destination side. If you have uncommitted changes there, commit or stash them first.