Skip to content
Back to skills

Exit Worktree

ASecurity

Return the Claude Code session from a worktree, keeping it by default or removing it when requested.

  • 10 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 9, 2026
tools

Works with

  • claude code

Security analysis

A100/100

Scanned November 9, 2026

npx -y skills add sasamuku/dotfiles --skill exit-worktree --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Exit Worktree?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Exit Worktree
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sasamuku-exit-worktree/badge)](https://www.skillsdirectory.com/skills/sasamuku-exit-worktree)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: exit-worktree
description: Return the Claude Code session from a worktree, keeping it by default or removing it when requested.
argument-hint: [keep|remove]
---

# Exit Worktree

引数: $ARGUMENTS。既定は `keep` (worktree・ブランチを保持)。`remove` は削除指定。

```text
ExitWorktree({ action: "keep" })  // 削除指定なら "remove"
```

- `path` で入ったworktreeは `remove` でも削除されない。`keep` で戻り、削除が必要なら `wt remove <branch>` を案内する。worker所有なら先にworkerを終了させる。
- `Could not verify worktree state` で削除が拒否された場合は `keep` で戻り、元のリポジトリから `wt remove --foreground <worktreeの絶対パス>` を使う。状態確認を飛ばすための強制削除はしない。
- 削除は Worktrunk plugin に任せる。失敗時は理由を報告し、強制削除はユーザーの破棄承認後だけ行う。worktree とブランチの削除結果は別々に確認する。
- worktreeセッション外ならno-opと報告して終了する。

復帰先を報告し、保持した場合はworktreeのパス・ブランチも示す。

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.