worktree-isolate

worktree-isolate is a skill for Claude Code, Codex from open-octo/octo-agent. It costs 91 tokens per session (851 once invoked), scanned A, original, MIT.

A workflow for doing risky or experimental changes in an isolated Git worktree, which is a separate working copy of the same repository. The changes can then be merged into the main checkout or discarded.

In plain words
What is it for?
Use it to try large changes, experiments, or risky fixes, run verification there, and decide whether to merge or remove the worktree.
Why use it?
It keeps unfinished or uncertain edits away from the main working copy while they are tested.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to try large changes, experiments, or risky fixes, run verification there, and decide whether to merge or remove the worktree.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/open-octo/octo-agent/worktree-isolate
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add open-octo/octo-agent --skill worktree-isolate
Clone the repo
git clone --depth 1 https://github.com/open-octo/octo-agent

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for worktree-isolate

README.md
[![agentmods](https://agentmods.dev/badge/skills/open-octo/octo-agent/worktree-isolate.svg)](https://agentmods.dev/skills/open-octo/octo-agent/worktree-isolate)
Your own site
<a href="https://agentmods.dev/skills/open-octo/octo-agent/worktree-isolate"><img src="https://agentmods.dev/badge/skills/open-octo/octo-agent/worktree-isolate.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 851 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00091 $0.00851
Opus 5 $0.00046 $0.00426
Sonnet 5 $0.00018 $0.00170
Haiku 4.5 $0.00009 $0.00085

Measured 8d ago against content hash ab77daf1981a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

worktree-isolate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

internal/skills/defaults/worktree-isolate/SKILL.md · 49 lines

How it starts

The opening of the file, as written. The whole thing — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

Read the full file on GitHub · 49 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 49 lines · 91 tokens per session scan A ab77daf1981a

Subscribe to this mod's changes

worktree-isolate is a skill published in the GitHub repository open-octo/octo-agent (96 stars, last pushed today), licensed MIT. It adds 91 tokens to every session and 851 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.