worktree-lifecycle

worktree-lifecycle is a skill for Claude Code, Codex from wsauret/flywheel. It costs 10 tokens per session (976 once invoked), scanned A, original, Apache-2.0.

A workflow for creating or adopting a Git worktree, which is a separate working directory connected to the same repository.

In plain words
What is it for?
It helps create worktrees from an up-to-date branch, install dependencies, preserve paths and ownership, rebase safely, compare commits after conflicts, and prepare the work for integration.
Why use it?
It keeps in-progress changes owned, durable, and separate from other work. It reduces the risk of overwriting work or losing changes during integration.

Skill for Claude CodeCodex

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

Good fit It helps create worktrees from an up-to-date branch, install dependencies, preserve paths and ownership, rebase safely, compare commits after conflicts, and prepare the work for integration.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wsauret/flywheel/worktree-lifecycle
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 wsauret/flywheel --skill worktree-lifecycle
Clone the repo
git clone --depth 1 https://github.com/wsauret/flywheel

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-lifecycle

README.md
[![agentmods](https://agentmods.dev/badge/skills/wsauret/flywheel/worktree-lifecycle/github.svg)](https://agentmods.dev/skills/wsauret/flywheel/worktree-lifecycle)
Your own site
<a href="https://agentmods.dev/skills/wsauret/flywheel/worktree-lifecycle"><img src="https://agentmods.dev/badge/skills/wsauret/flywheel/worktree-lifecycle/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for worktree-lifecycle

Your own site · 80×15
<a href="https://agentmods.dev/skills/wsauret/flywheel/worktree-lifecycle"><img src="https://agentmods.dev/badge/skills/wsauret/flywheel/worktree-lifecycle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 976 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.
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.00010 $0.00976
Opus 5.5 $0.00004 $0.00390
Sonnet 5.5 $0.00002 $0.00195
Haiku 4.5 $0.00001 $0.00098

Measured 2d ago against content hash 5dbfe3ec7a7a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

worktree-lifecycle 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 2d 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.

src/orchestration/modules/bash/definitions/skills/worktree-lifecycle/SKILL.md · 41 lines

How it starts

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

Worktree Lifecycle

A worktree is temporary isolation, not disposable work. Preserve ownership, destination, and every diff until integration is proved.

Input and ownership

Start with create or adopt action, canonical path, branch or base, intended destination, integration method, and owner. Record these before mutation. Require Bash and Git before mutation, use a stable sibling path, and never overwrite existing work or place a worktree in disposable session storage.

A check-only worktree is detached at one commit and exists only to run gates, for example when the shared checkout cannot build. You may copy uncommitted files into it. It holds no work of its own, so its creator removes it before handoff.

Method

  1. Create or adopt the worktree and keep its ownership record current. Create a new worktree from a freshly fetched destination tip. In a new worktree, install dependencies from the lockfile before the first gate. Post the full absolute path of the worktree to the user as soon as it exists, so that they can open it in a file manager and inspect its files and diffs.
  2. Keep work durable through commits or an explicit handoff before the owner exits.
  3. After a rebase with conflicts, compare the old and new commits with git range-diff and confirm that each change from the destination side in the conflicted files survives.
  4. Before final verification, fetch the destination and rebase onto its tip. When the base changed, run the gates again, because verification on the old base does not cover the rebased tree. {{if:persona:ship&type:general}}
  5. When publication is required, dispatch ship once without forked history in the existing worktree. Send the files to publish and a short summary of user intent and implemented design. Add a destination only when it differs from the normal push target. Keep integration and cleanup ownership in the parent, consume Ship's publication evidence, then resume destination integration and cleanup. When the parent's integration advances the remote destination, bring that branch's local checkout to the new tip with git merge --ff-only; when Git refuses, leave that checkout untouched. {{end}} {{if:persona:ship&!type:general}}
  6. When publication is required, dispatch ship once in the existing worktree. Send the files to publish and a short summary of user intent and implemented design. Add a destination only when it differs from the normal push target. Keep integration and cleanup ownership in the parent, consume Ship's publication evidence, then resume destination integration and cleanup. When the parent's integration advances the remote destination, bring that branch's local checkout to the new tip with git merge --ff-only; when Git refuses, leave that checkout untouched. {{end}} {{if:!persona:ship}}
  7. When publication is required, publish the selected files yourself from the existing worktree: commit them whole and push the branch to the destination, adding a destination only when it differs from the normal push target. Keep the commit and the pushed remote ref as publication evidence, then resume destination integration and cleanup. When the parent's integration advances the remote destination, bring that branch's local checkout to the new tip with git merge --ff-only; when Git refuses, leave that checkout untouched. {{end}}
  8. Consume fresh verification evidence. Run only lifecycle-specific clean-state and destination-containment proofs here.
  9. Prove ancestry where applicable with git merge-base --is-ancestor <commit> <destination>.
  10. Remove only the owned worktree after integration proof and a clean safety check, using git worktree remove <path> without force. A check-only worktree is integrated when every path that git status --porcelain lists in it is byte-identical to the published commit or to the shared checkout; remove that worktree only with git worktree remove --force <path>.

Read the full file on GitHub · 41 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. 2d ago Changed · +2 lines 5dbfe3ec7a7a
  2. 20d ago Changed · +4 lines e697fcc8fafc
  3. 22d ago Changed · +4 lines 6a2277173eb7
  4. 28d ago First seen · 31 lines · 10 tokens per session scan A adb5a571bdf7

Subscribe to this mod's changes

worktree-lifecycle is a skill published in the GitHub repository wsauret/flywheel (19 stars, last pushed today), licensed Apache-2.0. It adds 10 tokens to every session and 976 once invoked, about $0.0000 per session on Opus 5.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-11-03.

Related

worktree-lifecycle compared with skills from other repositories

worktree-lifecycle next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
worktree-lifecyclewsauret/flywheelSkill19todayApache-2.0A10Claude Code, Codex
codew-release-qa-sweepHmbown/CodeWhaleSkill41k2d agoMITA31Claude Code, Codex
gh-find-prsHmbown/CodeWhaleSkill41k2d agoMITA27Claude Code, Codex
contributor-onboardingHmbown/CodeWhaleSkill41k2d agoMITA57Claude Code, Codex
gh-close-issuesHmbown/CodeWhaleSkill41k2d agoMITA32Claude Code, Codex
gh-credit-harvestHmbown/CodeWhaleSkill41k2d agoMITA30Claude Code, Codex
gh-assign-issuesHmbown/CodeWhaleSkill41k2d agoMITA24Claude Code, Codex