Agent skill

Worktree Isolate

by open-octo in open-octo/octo-agent

Do risky or experimental work in an isolated git worktree, then merge or discard.

MITAuto-check passedDevelopment

Install Worktree Isolate

skills CLI
$ npx skills add open-octo/octo-agent --skill worktree-isolate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install open-octo/octo-agent worktree-isolate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/open-octo/octo-agent.git skills-src && mkdir -p .claude/skills && cp -r skills-src/internal/skills/defaults/worktree-isolate .claude/skills/worktree-isolate && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
worktree-isolate
GitHub stars
125
Token cost
~793 tokens
SKILL.md length
412 words
Files
1
Skills in repo
40
Repo updated
First seen
Licence
MIT

At a glance

Do risky or experimental work in an isolated git worktree, then merge or discard.

  • Works in 5 steps: Locate the repo and base. → Pick a name and path. Slugify the task… → Create the worktree. → …
  • The user wants changes tried in isolation (试在 worktree 里改
  • SKILL.md covers ⚠️ The absolute-path rule…, Steps and Notes
  • Calls git and go

What it does

Worktree Isolate is an agent skill from open-octo/octo-agent. Do risky or experimental work in an isolated git worktree, then merge or discard. Use when the user wants changes tried in isolation ("试在 worktree 里改", "隔离环境跑一下", "worktree 隔离", "在临时分支上做"), or before a large/uncertain edit that shouldn't touch the main checkout. Trailing text is the task to perform in the worktree.

Its SKILL.md is about 790 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git worktrees. It works with Git. The repository describes itself as: Open-source, single-binary, self-hosted AI agent — your models and data stay on your machine. A coding agent on par with Claude Code and a personal assistant lighter than… The licence is MIT.

When your agent uses it

  • The user wants changes tried in isolation (试在 worktree 里改
  • Before a large/uncertain edit that shouldnt touch the main checkout

Example prompts

  • “试在 worktree 里改”
  • “隔离环境跑一下”
  • “worktree 隔离”
  • “/worktree-isolate”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Locate the repo and base.
  2. Pick a name and path. Slugify the task into . Use
  3. Create the worktree.
  4. Do the task in $WT — following the absolute-path rule above. Build and run the project's tests inside $WT to verify (e.g. cd "$WT" && )…
  5. Finish — ask the user which, unless they already said

What it can do on your machine

Read from SKILL.md and the folder at commit fc1385f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Worktree Isolate loads about 793 tokens when it runs. Until then it costs about 83 tokens; SKILL.md has 412 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~83
When it runs · the whole SKILL.md, loaded when a task matches
~793

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from open-octo/octo-agent at commit fc1385f, republished under its MIT licence (© open-octo). 412 words, ~793 tokens.

Download SKILL.mdSave it as .claude/skills/worktree-isolate/SKILL.md (or your agent's skills folder).
name
worktree-isolate
description
Do risky or experimental work in an isolated git worktree, then merge or discard. Use when the user wants changes tried in isolation ("试在 worktree 里改", "隔离环境跑一下", "worktree 隔离", "在临时分支上做"), or before a large/uncertain edit that shouldn't touch the main checkout. Trailing text is the task to perform in the worktree.

Work in an isolated git worktree

Create a throwaway git worktree on a new branch, do all the work there, verify, then either merge it back or remove it. octo has no session-level working directory — so the one rule that makes this work is: address the worktree by absolute path in every tool call.

⚠️ The absolute-path rule (octo-specific — read first)

octo's terminal runs each command in a fresh shell in the process's launch directory; a cd does not carry to the next terminal call, and read_file / edit_file / write_file resolve relative paths against that same fixed directory. There is no "the session is now inside the worktree" mode.

Therefore, after creating the worktree:

  • Shell: use git -C "$WT" … and absolute paths, or chain everything inside ONE command: cd "$WT" && go build ./... && go test ./.... Never split cd "$WT" from the work into separate terminal calls.
  • Files: always pass the worktree's absolute path to read_file / edit_file / write_file (e.g. $WT/internal/foo.go), never a bare relative path.

Resolve $WT to a real absolute path once and reuse it verbatim.

Steps

  1. Locate the repo and base.

    • terminal: git rev-parse --show-toplevel → this is $REPO (absolute).
    • Note the current branch (git -C "$REPO" rev-parse --abbrev-ref HEAD); the new branch will fork from current HEAD unless the user says otherwise.
  2. Pick a name and path. Slugify the task into <slug>. Use:

    • worktree dir: $WT = $REPO/.worktrees/<slug>
    • branch: wt/<slug>
    • Make sure .worktrees/ is ignored: if git -C "$REPO" check-ignore .worktrees prints nothing, append /.worktrees/ to $REPO/.gitignore first.
  3. Create the worktree.

    git -C "$REPO" worktree add "$WT" -b "wt/<slug>"

    If the branch already exists, drop -b and pass the branch name as a third arg, or pick a fresh slug.

  4. Do the task in $WT — following the absolute-path rule above. Build and run the project's tests inside $WT to verify (e.g. cd "$WT" && <project test command>), not in the main checkout.

  5. Finish — ask the user which, unless they already said:

    • Keep / merge: leave the branch for a PR, or git -C "$REPO" merge wt/<slug> if they want it folded in. Report the branch name and the diff summary.
    • Discard: git -C "$REPO" worktree remove --force "$WT" and git -C "$REPO" branch -D wt/<slug>.
Show full SKILL.md (55 more words)Show less

Notes

  • Don't os.Chdir / don't expect a persistent cwd — that's exactly what this skill routes around.
  • A worktree shares the repo's object store; creating/removing it is cheap and never touches the main working tree.
  • If anything fails mid-way, surface it and leave the worktree in place (so the user can inspect) rather than silently removing it.

© open-octo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in internal/skills/defaults/worktree-isolate of open-octo/octo-agent.

Open the folder on GitHubat commit fc1385f

Compare with similar skills

Worktree Isolate next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Worktree Isolate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Worktree Isolate this skillopen-octo/octo-agent125—~793Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Finishing A Development Branchfarm-fe/farm5.6k34 repos~1.8kAutomated safety check: PassMIT
Git Worktree Cleanuplobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
Pre-Release PR Triagejamiepine/voicebox57k—~3.1kAutomated safety check: PassMIT
Ccmanager Configkbwo/ccmanager1.3k—~1.5kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 34 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Pre-Release PR Triage

    jamiepine/voicebox

    Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.

    57k GitHub stars~3.1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Ccmanager Config

    kbwo/ccmanager

    Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.

    1.3k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Builds a Cap feature in an isolated Git worktree with disposable dev resources, verification, a recorded demo and a neutral pull request, started with /building.

    23k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check: warnings

More from open-octo/octo-agent

All 40 skills in this repo
  • Image Gen

    open-octo/octo-agent

    Acquire images as files — generate them with an AI image model (14 providers: OpenAI/gpt-image, Gemini, Qwen, Zhipu, Volcengine, Stability, FLUX, Ideogram, MiniMax, and more), search openly-licensed…

    125 GitHub stars~3.1k tokensUpdated today
    Auto-check: notes
  • Office XLSX

    open-octo/octo-agent

    Create, read, and edit Excel (.xlsx) spreadsheets programmatically with openpyxl — cell values, formulas, styling (fonts/fills/borders/alignment/number formats), merged cells, multiple sheets…

    125 GitHub stars~1.8k tokensUpdated today
    Auto-check: notes
  • Artifact Design

    open-octo/octo-agent

    Design guidance for any HTML/Markdown file shown in octo's Artifacts panel — reports, dashboards, architecture/system diagrams, generated UIs, slide-style pages, 3D scenes.

    125 GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Code Review

    open-octo/octo-agent

    Review local code changes. An agent skill from open-octo/octo-agent.

    125 GitHub stars~942 tokensUpdated today
    Auto-check passed
  • Ppt Master

    open-octo/octo-agent

    AI-driven multi-format SVG content generation system. An agent skill from open-octo/octo-agent.

    125 GitHub stars~23k tokensUpdated today
    Auto-check: warnings
  • Config Setup

    open-octo/octo-agent

    Configure octo's global settings through guided conversation — set up AI model endpoints (providers, API keys, models), adjust agent defaults (reasoning effort, permission mode, coauthor, workspace…

    125 GitHub stars~3.3k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Worktree Isolate

What does Worktree Isolate do?

Do risky or experimental work in an isolated git worktree, then merge or discard. Worktree Isolate is an agent skill from open-octo/octo-agent. Do risky or experimental work in an isolated git worktree, then merge or discard.

When should I use Worktree Isolate?

Worktree Isolate fits situations like: the user wants changes tried in isolation (试在 worktree 里改; before a large/uncertain edit that shouldnt touch the main checkout.

How do I install Worktree Isolate in Claude Code?

Run `npx skills add open-octo/octo-agent --skill worktree-isolate -a claude-code`. Or copy the skill folder (internal/skills/defaults/worktree-isolate in open-octo/octo-agent) into .claude/skills/worktree-isolate in your project. Claude Code loads it when a task matches its description.

How do I install Worktree Isolate in Codex?

Run `npx skills add open-octo/octo-agent --skill worktree-isolate -a codex`. Or copy the skill folder (internal/skills/defaults/worktree-isolate in open-octo/octo-agent) into .agents/skills/worktree-isolate in your project. Codex loads it when a task matches its description.

Can I use Worktree Isolate in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add open-octo/octo-agent --skill worktree-isolate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/worktree-isolate, .gemini/skills/worktree-isolate, .github/skills/worktree-isolate and .opencode/skills/worktree-isolate in your project.

What does Worktree Isolate need to run?

Going by SKILL.md and its folder, Worktree Isolate needs the command-line tools its instructions call (git and go).

Does Worktree Isolate access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Worktree Isolate safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Worktree Isolate use?

Worktree Isolate is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Worktree Isolate use?

About 793 tokens (SKILL.md is roughly 3.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Worktree Isolate?

Skills that share tags, products or a category with Worktree Isolate: Finishing a Development Branch (obra/superpowers, 296k stars), Finishing A Development Branch (farm-fe/farm, 5.6k stars), Git Worktree Cleanup (lobehub/lobehub, 83k stars) and Pre-Release PR Triage (jamiepine/voicebox, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Worktree Isolate?

open-octo (a GitHub organization) maintains it in open-octo/octo-agent, which has 125 GitHub stars. The repository holds 40 skills in this directory. The repository was last updated on October 8, 2026.

Source: open-octo/octo-agent on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.