Agent skill

Recursive Worktree

by try-works in try-works/recursive-mode

A skill your agent uses when starting any recursive-mode requirement to set up an isolated git worktree.

Apache-2.0Auto-check passedDevelopment

Install Recursive Worktree

skills CLI
$ npx skills add try-works/recursive-mode --skill recursive-worktree -a claude-code

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

GitHub CLI
$ gh skill install try-works/recursive-mode recursive-worktree --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/try-works/recursive-mode.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/recursive-worktree .claude/skills/recursive-worktree && 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
recursive-worktree
GitHub stars
136
Token cost
~1.2k tokens
SKILL.md length
514 words
Files
2
Skills in repo
9
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when starting any recursive-mode requirement to set up an isolated git worktree.

  • Works in 4 steps: A feature-branch worktree exists. → The worktree directory is git-ignored if… → Project setup has completed. → …
  • Starting any recursive-mode requirement to set up an isolated git worktree
  • SKILL.md covers Purpose, Hard Rule, Default Location Order and Main Branch Protection, plus 7 more sections
  • Calls git, npm and cargo

What it does

Recursive Worktree is an agent skill from try-works/recursive-mode. Use when starting any recursive-mode requirement to set up an isolated git worktree. Required before implementation phases: create an isolated workspace, verify a clean baseline, and keep main/master clean.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Development, covering Git worktrees. It works with Git. The repository describes itself as: Recursive workflow for agentic engineering. Like Factory Missions but properly recursive, free and open source. The licence is Apache-2.0.

When your agent uses it

  • Starting any recursive-mode requirement to set up an isolated git worktree
  • Tasks that involve Git worktrees

Example prompts

  • “/recursive-worktree”

Requirements

  • Python 3
  • Node.js

Workflow steps

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

  1. A feature-branch worktree exists.
  2. The worktree directory is git-ignored if it lives inside the repo.
  3. Project setup has completed.
  4. A clean or explicitly acknowledged baseline test state has been recorded.

What it can do on your machine

Read from SKILL.md and the folder at commit ff75bc7. 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
    • npm
    • cargo
    • pip
    • go
    • mvn
    • dotnet
    • python

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

  • Network

    No URLs in SKILL.md. Its commands use git, npm and pip, 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

Recursive Worktree loads about 1.2k tokens when it runs. Until then it costs about 56 tokens; SKILL.md has 514 words of instructions outside code blocks.

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

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 try-works/recursive-mode at commit ff75bc7, republished under its Apache-2.0 licence (© try-works). 514 words, ~1,184 tokens.

Download SKILL.mdSave it as .claude/skills/recursive-worktree/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
recursive-worktree
description
Use when starting any recursive-mode requirement to set up an isolated git worktree. Required before implementation phases: create an isolated workspace, verify a clean baseline, and keep main/master clean.

recursive-worktree

Purpose

Use this skill at the start of a recursive-mode run to set up an isolated worktree before Phase 1+ work begins.

The canonical overall workflow still lives in /.recursive/RECURSIVE.md. This skill covers only the worktree-isolation discipline for 00-worktree.md.

Hard Rule

Do not proceed with recursive-mode phase work until:

  1. A feature-branch worktree exists.
  2. The worktree directory is git-ignored if it lives inside the repo.
  3. Project setup has completed.
  4. A clean or explicitly acknowledged baseline test state has been recorded.

Default Location Order

Use this priority:

  1. Existing .worktrees/
  2. Existing worktrees/
  3. A preference documented in repo instructions
  4. Ask the user
  5. Default to .worktrees/

Global fallback location:

  • ~/.config/recursive-mode/worktrees/<project-name>/

Main Branch Protection

If the current branch is main or master, default to creating a worktree on a feature branch:

bash
git worktree add .worktrees/<run-id> -b recursive/<run-id>
cd .worktrees/<run-id>

If the user explicitly insists on main-branch work, record that exception in 00-worktree.md.

Minimum Phase 0 Checklist

00-worktree.md must cover:

  • selected worktree location
  • git-ignore verification
  • branch name and worktree path
  • setup commands executed
  • baseline test command and result
  • normalized diff basis fields including Baseline type, Baseline reference, Comparison reference, Normalized baseline, Normalized comparison, and Normalized diff command
  • explicit note that subsequent phases run from the worktree
  • the required ## TODO heading from the scaffold

Suggested Commands

Check branch:

bash
git branch --show-current

Check ignore status:

bash
git check-ignore -q .worktrees || git check-ignore -q worktrees

Create worktree:

bash
git worktree add .worktrees/<run-id> -b recursive/<run-id>

Setup Guidance

Run the setup command that matches the repo:

  • Node.js: npm install
  • Rust: cargo build
  • Python: pip install -r requirements.txt or project-specific install
  • Go: go mod download
  • Maven: mvn compile -q
  • Gradle: ./gradlew compileJava
  • .NET: dotnet restore

Then run the baseline test command appropriate to the project and record the result in 00-worktree.md.

Show full SKILL.md (243 more words)Show less

Router State In Worktrees

Before delegated or routed work runs from an isolated worktree, verify the router files inside that same worktree:

bash
test -f .recursive/config/recursive-router.json
test -f .recursive/config/recursive-router-discovered.json
powershell
Test-Path .recursive/config/recursive-router.json
Test-Path .recursive/config/recursive-router-discovered.json

If the controller/source repo has a configured router policy or discovery inventory and the worktree lacks it, sync both files into the worktree before resolving or invoking routed roles. Preserve user edits to the worktree policy; when changing bindings, prefer recursive-router-configure over hand edits.

recursive-router-discovered.json is local discovery state and may be untracked. Its absence in a fresh worktree is expected, but it is still not safe to resolve an external role from stale assumptions. Refresh it with python ./.recursive/scripts/recursive-router-probe.py --repo-root . --json from the worktree, or copy the current inventory from the controller/source repo when that is the intended policy basis.

Record the router policy path, discovery path, validation/probe command, and resulting route decision in 00-worktree.md or in the delegated action record before accepting routed work.

Output Contract

Write the artifact to:

  • /.recursive/run/<run-id>/00-worktree.md

Use feature branches named:

  • recursive/<run-id>

Routing Awareness

If this skill uses delegated review or any other routed external model to validate worktree setup, baseline verification, or branch safety, re-read:

  • /.recursive/config/recursive-router.json
  • /.recursive/config/recursive-router-discovered.json

immediately before choosing that CLI/model, and honor the routed policy or explicit fallback instead of hardcoding a reviewer model.

Integration

  • Invoke this skill before AS-IS analysis and planning.
  • After Phase 0 is lock-valid, continue the run from the worktree context.
  • Keep later phases, including STATE.md, DECISIONS.md, and memory updates, on the same feature branch until merge time.

© try-works, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/recursive-worktree of try-works/recursive-mode.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit ff75bc7

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders. This page covers the copy in try-works/recursive-mode, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Recursive Worktree 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.

Recursive Worktree compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Recursive Worktree this skilltry-works/recursive-mode136—~1.2kAutomated safety check: PassApache-2.0
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 try-works/recursive-mode

All 9 skills in this repo
  • Recursive Mode

    try-works/recursive-mode

    Repository workflow orchestration skill for staged implementation, locked artifacts, late-phase receipts, and durable memory maintenance.

    136 GitHub stars~3.4k tokensUpdated 2 mo ago
    Auto-check passed
  • Recursive Debugging

    try-works/recursive-mode

    A skill your agent uses when a recursive-mode requirement involves debugging a bug, test failure, or unexpected behavior.

    136 GitHub stars~3.4k tokensUpdated 2 mo ago
    Auto-check passed
  • Recursive Review Bundle

    try-works/recursive-mode

    A skill your agent uses when recursive-mode work needs a canonical delegated-review or audit handoff.

    136 GitHub stars~873 tokensUpdated 2 mo ago
    Auto-check passed
  • Recursive Subagent

    try-works/recursive-mode

    A skill your agent uses when recursive-mode work may benefit from delegated audit, review, or bounded implementation support.

    136 GitHub stars~3k tokensUpdated 2 mo ago
    Auto-check passed
  • Recursive TDD

    try-works/recursive-mode

    A skill your agent uses when implementing any code in recursive-mode Phase 3.

    136 GitHub stars~2.8k tokensUpdated 2 mo ago
    Auto-check passed
  • Recursive Spec

    try-works/recursive-mode

    Approval-gated, repo-aware requirements/spec authoring for new recursive-mode runs.

    136 GitHub stars~1.4k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Recursive Worktree

What does Recursive Worktree do?

A skill your agent uses when starting any recursive-mode requirement to set up an isolated git worktree. Recursive Worktree is an agent skill from try-works/recursive-mode. Use when starting any recursive-mode requirement to set up an isolated git worktree.

When should I use Recursive Worktree?

Recursive Worktree fits situations like: starting any recursive-mode requirement to set up an isolated git worktree; tasks that involve Git worktrees.

How do I install Recursive Worktree in Claude Code?

Run `npx skills add try-works/recursive-mode --skill recursive-worktree -a claude-code`. Or copy the skill folder (skills/recursive-worktree in try-works/recursive-mode) into .claude/skills/recursive-worktree in your project. Claude Code loads it when a task matches its description.

How do I install Recursive Worktree in Codex?

Run `npx skills add try-works/recursive-mode --skill recursive-worktree -a codex`. Or copy the skill folder (skills/recursive-worktree in try-works/recursive-mode) into .agents/skills/recursive-worktree in your project. Codex loads it when a task matches its description.

Can I use Recursive Worktree 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 try-works/recursive-mode --skill recursive-worktree -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/recursive-worktree, .gemini/skills/recursive-worktree, .github/skills/recursive-worktree and .opencode/skills/recursive-worktree in your project.

What does Recursive Worktree need to run?

Going by SKILL.md and its folder, Recursive Worktree needs the command-line tools its instructions call (git, npm, cargo, pip, go and mvn). Our summary lists: Python 3; Node.js.

Does Recursive Worktree access the network?

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

Is Recursive Worktree 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 Recursive Worktree use?

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

How many tokens does Recursive Worktree use?

About 1.2k tokens (SKILL.md is roughly 4.7k 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 Recursive Worktree?

Skills that share tags, products or a category with Recursive Worktree: 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 Recursive Worktree?

try-works (a GitHub user) maintains it in try-works/recursive-mode, which has 136 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on July 24, 2026.

Source: try-works/recursive-mode on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.