Problem
When using sbx with --branch, gitignored files (.env, local.settings.json, etc.) are excluded. These files are almost always required to run or test a project locally. There is currently no way to carry them into a sandbox branch without manual intervention.
Proposed Solution: .worktreeinclude file
Claude Code already implements this pattern for git worktrees: if a .worktreeinclude file exists in the repository root, Claude copies all listed files/patterns into each new worktree — preserving directory structure — even if they are gitignored.
Example .worktreeinclude:
.env
local.settings.json
.autoflow
sbx could adopt the same convention: when creating a sandbox from a branch, detect .worktreeinclude and bind/copy those files into the sandbox environment.
Benefits:
- Declarative and repo-local — the include list is tracked in git, the secrets are not
- Zero per-invocation flags required
- Follows an established pattern from Claude Code tooling
- Works naturally with
.gitignore (secrets stay out of git, but reach the sandbox)
Problem
When using
sbxwith--branch, gitignored files (.env,local.settings.json, etc.) are excluded. These files are almost always required to run or test a project locally. There is currently no way to carry them into a sandbox branch without manual intervention.Proposed Solution:
.worktreeincludefileClaude Code already implements this pattern for git worktrees: if a
.worktreeincludefile exists in the repository root, Claude copies all listed files/patterns into each new worktree — preserving directory structure — even if they are gitignored.Example
.worktreeinclude:sbx could adopt the same convention: when creating a sandbox from a branch, detect
.worktreeincludeand bind/copy those files into the sandbox environment.Benefits:
.gitignore(secrets stay out of git, but reach the sandbox)