In this article
A bb setup script prepares new worktrees; verify that generated settings reach the running process and diagnose preparation separately from application startup.
A new worktree starts from repository state, but a useful development environment also needs dependencies and local settings. bb’s setup-script mechanism connects those preparation steps to worktree creation. Understanding what the script produces and what the application later consumes helps explain environment failures without changing unrelated source code.
Preparation belongs to a repeatable boundary
Suppose a project needs package installation and a unique frontend port before it can start. A setup script can make those requirements explicit for new worktrees instead of relying on the developer remembering a sequence of terminal actions. The remote-dev-server guide documents this preparation path. Its useful property is repeatability of intent: the repository describes how a new environment is prepared. It does not mean that every dependency download or external service will necessarily succeed on every run.
Generated settings must reach the application
The guide’s example records ports in a local environment file and loads those values before starting the server. This separates generation from consumption. If an application ignores the generated value and starts with a hard-coded port, successful setup has not established the desired runtime arrangement. In a hypothetical frontend/API project, trace which configuration each process reads. An environment file on disk is evidence of written settings, while the listening addresses provide evidence about the values that actually took effect.
Existing worktrees have their own history
Changing the repository’s setup script explains how subsequently created worktrees should be prepared. It should not be described as automatically replaying setup across every already-running environment. The guide calls out older worktrees when discussing port conflicts. A diagnosis therefore identifies when the environment was created and which preparation output it received. The developer can compare that state with the current script rather than assuming that the newest repository instructions have already transformed an older terminal process.
Read the failed preparation stage
The guide also describes inspecting setup failure output. A missing package tool, an unavailable registry and an application startup error occur at different stages. Reporting the actual failed stage preserves this distinction. Optional preparation can be designed differently from a requirement without which the project cannot run, but that decision belongs to the project. A clear setup contract gives the next developer an actionable explanation: what should have been produced, what was observed and which dependency prevented a ready environment.
Primary sources
Related engineering context: Choosing an AI development stack; Git state and undo.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.