Use when the user wants to undo, absorb, collapse, or reverse a git worktree — "undo worktree", "absorb worktree", "move worktree branch back to main repo", "remove worktree and checkout in main", "get rid of this worktree", or finish work in a ~/worktrees.nosync worktree and continue it in the main studio checkout.
Ships in sejas-ai-code-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Absorbs a git worktree back into the main repo: takes the branch checked out in a worktree, checks it out in the main repo, and deletes the worktree folder. The reverse of the worktree skill.
Main repo: $MAIN_REPO (set to your main checkout — the repo worktrees branch off)
Worktrees live under: ~/worktrees.nosync/
Core principle: Removing a worktree is non-destructive for committed work — commits live in the shared .git, so checking the branch out in the main repo recovers everything. The only thing at risk is uncommitted changes, which is why the dirty check is a hard gate.
~/worktrees.nosync/<name> directory and wants to continue the branch in the main repo.Do NOT use to merely delete a throwaway worktree the user wants discarded (no branch to keep) — that's a plain git worktree remove.
Run these steps in order. Never use --force. Never git add, commit, or push.
git -C $MAIN_REPO worktree list --porcelain
worktree line in the porcelain output.branch line.git rev-parse --show-toplevel). If it sits under ~/worktrees.nosync/, that's the target worktree; read its branch from the porcelain list.You must end this step with both: WORKTREE_PATH and BRANCH. If you cannot resolve both unambiguously, STOP and ask.
git -C <WORKTREE_PATH> status --porcelain
--force. The user must commit, stash, or discard first.git -C <WORKTREE_PATH> log --oneline @{upstream}..HEAD 2>/dev/null
If this lists commits (or there is no upstream), tell the user the branch has local-only commits. Removing the worktree is still safe (the commits stay in the shared repo and come back at step 4), but they should know nothing is being pushed.
git -C $MAIN_REPO worktree remove <WORKTREE_PATH>
This MUST happen before step 4 — git refuses to check out a branch in the main repo while it is checked out in a live worktree. Removing the worktree both releases the branch lock and deletes the folder.
git -C $MAIN_REPO checkout <BRANCH>
git -C $MAIN_REPO branch --show-current
test -d <WORKTREE_PATH> && echo "STILL EXISTS" || echo "removed"
Report: main repo is now on <BRANCH>, worktree folder is gone, and surface any local-only-commits warning from step 2.
fatal: '<branch>' is already checked out at .... Always remove first (step 3 before step 4).--force to get past a dirty worktree → silently discards the user's uncommitted work. Forbidden. The dirty check is a hard stop.worktree remove from inside the worktree directory → can fail or leave cwd invalid. Run with git -C <main-repo> and don't have your shell sitting inside the folder being deleted.What SKILL.md sets; muted values are Claude Code's defaults
/sejas-ai-code-skills:unworktreefrom sejas-ai-code-skills
sejas-ai-code-skills@cascade-code-general-misc-3 is listed by joshuarweaver/cascade-code-general-misc-3 — review the source before installing
npx claudepluginhub joshuarweaver/cascade-code-general-misc-3 --plugin sejas-ai-code-skills40 skills in this plugin
/ai-prsList all open PRs targeting the Studio AI command with draft status, approval state, and requested reviewers/ai-radarUse when Antonio wants to catch up on frontier AI — "what's new in AI", "AI radar", "what is karpathy working on", "AI trends", "research digest", "what should I learn next", "where to invest learning time", or /ai-radar./blog-postThis skill should be used when the user asks to "write a blog post", "draft a blog post", "create a blog post", "write an article about", or wants to produce a markdown blog post on any topic. Outputs to ~/claude.nosync/posts/.