workflow-worktree-session

Switch an active engineering session into a specified Git worktree.

2|8|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/lugassawan/swe-workbench --skill workflow-worktree-session
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: workflow-worktree-session
Source: https://github.com/lugassawan/swe-workbench/tree/main/skills/workflow-worktree-session
Command: npx skills add https://github.com/lugassawan/swe-workbench --skill workflow-worktree-session

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of keeping an active coding session correctly aligned with the Git worktree the user wants to work in, without requiring a restart.

Core Features & Use Cases

  • Switch into an existing worktree: Resolves the worktree path by matching the user’s mentioned worktree name or directory basename, then transitions the session using EnterWorktree.
  • Create a new worktree safely: Defers all consent, safety checks, and baseline test setup to superpowers:using-git-worktrees instead of duplicating logic.
  • Exit the current worktree on request: Returns to the parent context using ExitWorktree(action: "keep") by default, with remove only when explicitly requested.

What problem does it solve?

It solves confusing session state when switching branches/workspaces via Git worktrees, ensuring Claude’s effective working directory moves correctly.

Quick Start

Tell the assistant to switch into your existing worktree named feat-login.

Frequently Asked Questions about workflow-worktree-session

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I switch my active coding session into an existing Git worktree?

To switch into an existing Git worktree, resolve the worktree path by matching the user's mentioned worktree name or directory basename, then transition the session using EnterWorktree with an absolute path to update the correct CWD.

Why should I avoid using Bash(cd ...) when changing my Claude session directory?

Using Bash(cd ...) fails to correctly update the Claude session directory state. You must use EnterWorktree with an absolute path to ensure the effective working directory moves correctly to the linked Git worktree.

How do I create a new Git worktree safely within my workspace management workflow?

Creating a new Git worktree safely requires deferring all consent, safety checks, and baseline test setup to the superpowers:using-git-worktrees skill, avoiding the duplication of creation logic within the current workflow.

How do I exit a Git worktree and return to the parent context?

To exit a Git worktree and return to the parent context, use ExitWorktree with the action set to keep by default. The worktree is only removed when explicitly requested by the user.

How can I validate linked Git worktrees before attempting a session switch?

Validate linked Git worktrees by executing the git rev-parse command. This confirms the worktree path exists and is linked correctly before calling EnterWorktree to transition the active engineering session.