Skip to content

Support .worktreeinclude for copying gitignored files into sandbox branches #57

@liemle3893

Description

@liemle3893

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions