Agent skill
switch-worktree
Switch the current session to work in an existing git worktree
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/switch-worktree-thanhhuong0209-dlt-normalization
SKILL.md
Switch to worktree
Switch the current session to an existing worktree.
Steps
1. Resolve the worktree
If $ARGUMENTS is empty, list available worktrees and ask the user to pick one:
git worktree list
Otherwise, let NAME = $ARGUMENTS. The worktree path is <repo-root>/.worktrees/<NAME>.
Verify the worktree exists in git worktree list output. If not, stop with an error.
Let WORKTREE = the absolute path to the worktree.
2. Switch cwd
cd WORKTREE
Then verify the switch took effect:
pwd
If pwd does not show WORKTREE, stop with an error — the cwd did not persist.
3. Report
Switched to worktree: WORKTREE
Branch: <current branch from git branch --show-current>
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?