exit-worktree

Exit an active worktree session and return to the original directory.

8|Updated Oct 26, 2025
One-click install
npx skills add https://github.com/sasamuku/dotfiles --skill exit-worktree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: exit-worktree
Source: https://github.com/sasamuku/dotfiles/tree/main/.claude/skills/exit-worktree
Command: npx skills add https://github.com/sasamuku/dotfiles --skill exit-worktree

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill allows users to exit a worktree session and return to the original working directory, providing a simple and efficient way to manage worktree sessions.

Core Features & Use Cases

  • Exit Worktree: End a worktree session and return to the original directory.
  • Keep or Remove: Option to keep or remove the worktree and branch after exiting.
  • Use Case: When a user has entered a worktree session using '/enter-worktree' or '/delegate-worker' and wants to exit the session.

Quick Start

Exit the current worktree session and keep the worktree and branch.

Frequently Asked Questions about exit-worktree

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

FAQPage Schema
How do I exit a git worktree session and return to my original directory?

To exit a git worktree session, you use a command that ends the session and automatically navigates you back to your original working directory, ensuring a smooth transition out of the worktree.

Can I keep my git worktree and branch after exiting the session?

Yes, you can keep your git worktree and branch after exiting the session. The exit process provides options to either retain or remove both the worktree directory and its associated branch.

What happens to my working directory when I end a worktree session?

When you end a worktree session, your working directory is switched back to the original directory you were in before entering the worktree, restoring your previous file system context.

Do I need an active worktree session to use the exit command?

Yes, you need an active worktree session to use the exit command. The command requires that you have previously entered a worktree session to properly return to the original directory.

What is the best way to remove a git worktree and its branch when finished?

The best way to remove a git worktree and its branch when finished is to use an exit command that handles both the directory deletion and branch cleanup simultaneously while returning you to the original directory.