Skip to content

Improve worktree UX: add optional guidance for caching and env setup #299

Closed as not planned

Description

@asdlem

Is your feature request related to a problem? Please describe.
Yes. The worktree workflow often requires re-installing dependencies and re-configuring environment variables in each new worktree, which adds noticeable setup cost for small or frequent tasks.
In my experience, each new worktree doesn’t automatically pick up environment configuration from the repo root (e.g., .env / .envrc). I end up re‑configuring it manually every time, which often blocks me at this step and makes the workflow feel less smooth.

Describe the solution you'd like
Add a short optional, example-based section (docs or skill notes) on reducing worktree setup cost, without prescribing a single tool, e.g.:

Dependency caching: suggest leveraging package-manager caches/shared stores to reduce repeated downloads/installs (e.g., pnpm store; for Python, uv could be an option)
Env vars: provide a common per-worktree env management approach (e.g., .env / .envrc example or a small bootstrap snippet) and explain how new worktrees can more smoothly inherit root env config

Describe alternatives you've considered
Keep the current workflow and accept the overhead
Maintain custom scripts per project for caching/env setup

Additional context
This is documentation-only guidance and does not change core worktree behavior; it just offers optional optimization tips.

Activity

  1. added
    enhancement
    on Jan 19, 2026
  2. added
    claude-code
    on Feb 21, 2026
  3. added
    worktrees
    on Mar 23, 2026
  4. added
    stale
    on May 11, 2026
  5. arittr commented on May 11, 2026

    @arittr
    Collaborator

    Thanks for the suggestion. I’m going to close this because dependency-cache and environment setup patterns vary a lot by language, package manager, shell, and project conventions. Adding generic advice here would likely become noisy or project-specific guidance in the core worktree skill.

    Project-local setup scripts or repo docs are the better place for this kind of optimization.

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

    claude-codeenhancementstaleworktrees

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions