agentleFS
niksavisniksavis/handily/.claude/skills/worktree-isolation/SKILL.md

worktree-isolation

Skill2 starsChanged 33 days agoMITView on GitHub

Isolates work in a sibling git worktree, then merges and cleans up. Use to keep a change out of the main checkout or when parallel tracks collide.

8 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the retry result and verify the repository state before continuing the loop.

    line 32
  2. Very specific:

    Use create when the work commits: it provisions .venv, node_modules and the hooks, and a plain git worktree add leaves them missing, so the …

    line 44

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- Generated by `basicly skills-build` from skill.yaml. Do not edit; edit the source. -->

Worktree Isolation

Isolate a unit of work in a sibling Git worktree. Ordinary Git is sufficient; basicly worktree is an optional provisioning and landing convenience. It covers placement, provisioning, merge and cleanup. For tracker records see work-tracker. For commits see the git reference of cli-tools and conventional-commits.

Rules

  • Isolate every non-trivial change. This includes multi-file work, work that runs the gates, and work parallel to another track.
  • Skip isolation for a trivial edit, such as a typo. A worktree has a real setup cost.
  • Put the worktree at the sibling path <repo>.worktrees/<name>. The sibling checkout stays outside repository scans. Git hooks share the common Git directory regardless of checkout placement.
  • Avoid accidental hook bypasses. A relative core.hooksPath can silently skip hooks. For explicit user-requested observer repair, use a command-scoped bypass, run affected checks directly and disclose what did not run. Never disable hooks permanently.
  • Resolve conflicts against the whole task intent. Inspect both changes, preserve unrelated work and rerun affected checks; do not restart the plan merely because branches coupled.
  • Run merge commands from the base checkout. Git refuses to update a branch that another worktree has checked out.

Protected destinations

An agent sandbox can allow source edits while protecting .codex, .agents or the Git hook directory. Install and landing preflight planned changes before updating the catalog, committing tracker state or rebasing. An access refusal names the destination and the ordinary command to retry; unchanged protected outputs need no write.

For an already-authorized upgrade or landing, request task-scoped execution review for that exact command in the named checkout. In Codex, use the execution tool's require_escalated permission with the protected destination as the reason. The CLI cannot escalate itself. Preserve dotenv denials, normal hooks, signing and loop checkpoints; do not broaden a machine profile. Read the retry result and verify the repository state before continuing the loop.

Create and finish a worktree

basicly worktree create <name> [--base <branch>]           # add and provision
basicly worktree list                                       # active sessions; stale ones are marked
basicly worktree merge <name> --bead <id> [--mode M]        # rebase, verify, --no-ff merge
basicly worktree merge-queue <name>:<id> ... [--mode M]     # merge several, in the given topological order
basicly worktree cleanup <name> [--force]                   # remove the worktree and its merged branch

Use create when the work commits: it provisions .venv, node_modules and the hooks, and a plain git worktree add leaves them missing, so the first commit fails. A plain git worktree add ../<repo>.worktrees/<name> -b <branch> suits read-only work.

Inspect existing branches and worktrees first; do not replace or discard another session's work. Integrate from the base checkout and preserve shared tracker history.

For each lifecycle step, cleanup refusals, how hooks resolve in a linked worktree and the Claude Code background isolation setting, read lifecycle.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.