MCPInstall

isolate

Use when starting task work that needs branch isolation, before planning or coding — creates a worktree branching from current remote main with freshness verification and project setup

Installs
391
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/camacho/ai-skills --skill isolate
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads isolate automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Isolate

Create a worktree branched from the latest origin/main so task work never starts on stale code.

Announce: "Setting up an isolated worktree for this task."

Inputs

  • Branch name: from /orient Step 1 (e.g., feat/auth, fix/login-crash). Ask if not provided.
  • Base ref: the current branch's parent (detected via reflog, default main). Override only when explicitly stacking on a different branch.

Detect parent branch

The parent branch (what this branch will eventually merge into) is determined from the reflog:

PARENT_BRANCH=$(
  git reflog show HEAD --pretty=format:'%gs' \
    | grep "^branch: Created from" \
    | head -1 \
    | sed 's/branch: Created from //' \
    | sed 's|^origin/||'
)
PARENT_BRANCH=${PARENT_BRANCH:-main}

Returns empty when the branch was created from a detached HEAD or in a web session with no reflog — falls back to main. Correct 99% of the time for normal local development.

Already in a Worktree?

If the session CWD is already inside a linked worktree (not the primary), freshen the branch instead of creating a new one:

WORKTREE="<absolute-path-to-current-worktree>"
git -C "$WORKTREE" fetch origin "$PARENT_BRANCH"
git -C "$WORKTREE" merge "origin/$PARENT_BRANCH"

If conflicts arise, stop and present them to the user. Do not auto-resolve.

After freshening, skip ahead to Baseline test.

Step 1: Select directory

PriorityCheckAction
1.worktrees/ existsUse it
2worktrees/ existsUse it
3Both exist.worktrees/ wins
4CLAUDE.md specifiesFollow preference
5None foundAsk user (.worktrees/ recommended)

Step 2: Verify gitignored

git check-ignore -q .worktrees

If NOT ignored, fix before proceeding:

echo ".worktrees" >> .gitignore
git add .gitignore
git commit -m "chore: gitignore worktree directory"

Step 3: Fetch and create

A worktree branched from a stale local parent means baked-in merge conflicts. Always fetch first, always branch from origin/$PARENT_BRANCH (not the local copy).

REPO_ROOT="$(git rev-parse --show-toplevel)"
WORKTREE_DIR="$REPO_ROOT/.worktrees/<name>"

git fetch origin "$PARENT_BRANCH"
git worktree add "$WORKTREE_DIR" -b <prefix>/<name> "origin/$PARENT_BRANCH"

Lock the worktree immediately so git worktree prune doesn't sweep it during long-running agent sessions. Run from the main repo context (not the worktree):

git -C "$REPO_ROOT" worktree lock --reason "Agent session in progress" "$WORKTREE_DIR"

/ship will unlock before removing the worktree at the end of the task.

Claude Code: optionally call EnterWorktree({path}) to move session CWD into the new worktree.

Step 4: Install dependencies

Auto-detect from manifest files:

FileCommand
pnpm-lock.yamlpnpm install
yarn.lockyarn install
package-lock.jsonnpm install
package.json (no lockfile)Ask before installing
Cargo.tomlcargo build
requirements.txtpip install -r requirements.txt
pyproject.tomlpoetry install
go.modgo mod download

Run from the worktree path: pnpm --dir "$WORKTREE_DIR" install

Step 5: Baseline test

Run the project's test suite. If tests fail, report failures and ask whether to proceed. Do not silently continue.

Report

Worktree ready at <absolute-path>
Branch: <prefix>/<name> (from origin/main @ <short-sha>)
Tests: <N> passing

Path Discipline

cd does not persist between Claude Code Bash calls. Use absolute paths for all file operations and git -C <abs-path> for git commands.

Integration

Called by: /task (Step 2), /brainstorming, /build Pairs with: /ship (cleans up worktree after work is done)

FAQ

What does the isolate skill do?

Use when starting task work that needs branch isolation, before planning or coding — creates a worktree branching from current remote main with freshness verification and project setup

How do I install isolate?

Run npx skills add https://github.com/camacho/ai-skills --skill isolate in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/isolate/ (personal) or .claude/skills/isolate/ (project).

Which AI agents can use isolate?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is isolate safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains isolate?

It is published by camacho in camacho/ai-skills. It has 391 recorded installs.

More from camacho/ai-skills

View all →

archive

camacho/ai-skills

Fills Outcomes & Learnings in a plan file and renames it to .done.md.

bail

camacho/ai-skills

Reflects, updates GitHub Issue, closes PR if open, cleans up worktree/branch.

capture

camacho/ai-skills

Creates a draft GitHub Issue with triage label from natural language description.

669 installs

plan-review

camacho/ai-skills

Auto-assembles review panel using deterministic rules, dispatches agents against plan file, collects verdicts.

orient

camacho/ai-skills

Fetches issue context, auto-detects task type, maps to branch prefix, presents brief.

reflect

camacho/ai-skills

Use after merging a branch or completing a task to consolidate learnings into memory layers, close out issues, and verify the phase gate.

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.