Skip to content

Copy gitignored config files (.env) into new worktrees (.worktreeinclude) #185

Closed

Description

@currentbits

What competitors do

Conductor supports a checked-in .worktreeinclude file listing gitignored paths copied verbatim into each new worktree (docs); Emdash preserves configuration files (.env, etc.) to the worktree on task creation.

Solenta today

setupWorktree (electron/worktrees.js:501-536) is exactly git worktree add and nothing else. #153 covers setup SCRIPTS; this is the simpler declarative sibling.

Why it matters

Every thread starts in a worktree missing .env, local certs or fixture DBs, so the agent's first minutes are spent rediscovering "database won't connect." Both Conductor and Emdash treat this as core, not optional.

Fix direction

On worktree creation, read .worktreeinclude (or a sensible default list like .env*) from the repo root and copy the listed gitignored paths into the new worktree.

Activity

  1. currentbits commented on Aug 19, 2026

    @currentbits
    OwnerAuthor

    Claude Code Desktop uses .worktreeinclude with the same name and semantics — "to include gitignored files like .env in new worktrees, create a .worktreeinclude file in your project root" (docs). Convergent naming; nothing to change.

    Two adjacent settings they expose that Solenta hardcodes:

    • Worktree location — default <project-root>/.claude/worktrees/, user-overridable to a custom directory. Users on encrypted or synced home directories, or with tooling that scans the repo root, need worktrees somewhere else.
    • Branch prefix — a configurable string prepended to every generated worktree branch name. Solenta always emits coder/<slug>-<hash>; teams with branch naming policy or CI branch filters cannot adopt that.

    Both are one store field and one call site each.

  2. added and removed on Oct 10, 2026
  3. added and removed on Oct 10, 2026
  4. currentbits commented on Oct 10, 2026

    @currentbits
    OwnerAuthor

    Shipped in #1563 (08c1d5a): new worktrees get untracked+gitignored files matching .worktreeinclude, or root .env* by default. Copied before the #153 setup script; never overwrites; best-effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions