worktree-recycle

worktree-recycle is a skill for Claude Code, Codex from yunsii/wezdeck. It costs 86 tokens per session (1,702 once invoked), scanned A, original, MIT.

A procedure for resetting a long-lived Git worktree after its current round of work has been delivered. A worktree is another working directory connected to the same Git repository; this procedure checks it, resets it to the latest main branch, and performs project setup for the next task.

In plain words
What is it for?
Use it to check whether a worktree is ready to recycle, reset it after merged work, or reset it and initialise it for a newly supplied task.
Why use it?
It reduces the risk of carrying old changes or an inconsistent branch into the next work round. It also reports blockers before performing destructive reset operations.

Skill for Claude CodeCodex

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

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./scripts/dev/link-platform-skills.sh.

Good fit Use it to check whether a worktree is ready to recycle, reset it after merged work, or reset it and initialise it for a newly supplied task.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/yunsii/wezdeck
agentmods
npx agentmods add skills/yunsii/wezdeck/worktree-recycle

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/yunsii/wezdeck/worktree-recycle/github.svg)](https://agentmods.dev/skills/yunsii/wezdeck/worktree-recycle)
Your own site
<a href="https://agentmods.dev/skills/yunsii/wezdeck/worktree-recycle"><img src="https://agentmods.dev/badge/skills/yunsii/wezdeck/worktree-recycle/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-recycle

Your own site · 80×15
<a href="https://agentmods.dev/skills/yunsii/wezdeck/worktree-recycle"><img src="https://agentmods.dev/badge/skills/yunsii/wezdeck/worktree-recycle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,702 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.00086 $0.01702
Opus 5.5 $0.00034 $0.00681
Sonnet 5.5 $0.00017 $0.00340
Haiku 4.5 $0.00009 $0.00170

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

Security

Grade A, and why

worktree-recycle 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 20d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (lib/init.sh, lib/preflight.sh, run.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/worktree-recycle/SKILL.md · 132 lines

How it starts

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

Worktree recycle (platform skill — single source)

Who runs: the coding agent, not the human.
Never tell the user to copy-paste worktree-task recycle as the primary path — load this skill and run the co-located runner.

Hard git ops stay in worktree-task recycle (dirty check, optional delivered gate, allowlisted clean, branch align to slug, reset --hard origin/HEAD, sync origin/<branch>).
This skill owns soft preflight and readiness hints. Project bootstrap is not part of recycle — the next task initializes what it needs.

When to load / run

User intent (examples) You do
重置开发分支 / 重置工作站 / recycle / 收尾换下一轮 preflight (optional glance) → recycle -y
重置并开始做 X / recycle with task X same, pass --task "X"
只要看看能不能重置 preflight or recycle --dry-run only
主 worktree / primary / master 对齐最新主分支 same recycle path on the primary checkout
wezdeck standing close-out: worktree round delivered onto origin/HEAD / 「合入主分支后收尾」 same recycle path — default, not optional

Skip / redirect:

  • Short-lived task-* / hotfix-* end-of-life → worktree-task reclaim / Ctrl+k g r (not this skill)
  • Pure git reset without this skill → do not bypass; still use the runner

wezdeck policy: worktrees = isolation; delivery = direct mainline (no PR).
Invariant: idle dev/* tip must equal origin/HEAD. After landing on mainline (or when mainline moved while the workstation sat idle), immediately recycle — do not leave dev/* behind. See docs/workspaces.md → Maintenance loop.

Resolve TOOL_HOME (first hit wins)

1. $WORKTREE_RECYCLE_HOME
2. directory of this SKILL.md if run.sh is co-located
3. $HOME/.agents/skills/worktree-recycle
4. $WEZDECK_ROOT/skills/worktree-recycle
5. $HOME/github/wezterm-config/skills/worktree-recycle
TOOL_HOME=…   # dir that contains run.sh
R="$TOOL_HOME/run.sh"

Install / refresh discovery (idempotent, from wezdeck):

Read the full file on GitHub · 132 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 20d ago Changed 157bffa0c247
  2. 26d ago Changed · -3 lines · +9 tokens per session e99d50e3abac
  3. 1mo ago First seen · 135 lines · 77 tokens per session scan A 6abb83b92b64

Subscribe to this mod's changes

worktree-recycle is a skill published in the GitHub repository yunsii/wezdeck (5 stars, last pushed yesterday), licensed MIT. It adds 86 tokens to every session and 1,702 once invoked, about $0.0003 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-09-13.

Related

Other skills, from other repositories

author-contributions

Identify all files a specific author contributed to on a branch vs its upstream, tracing code through renames. Use when asked who edited what, what code an author contributed, or to audit authorship before a merge. This skill should be run as a subagent — it performs many git operations and returns a concise table.

workstream-labs/workstreams · 68 tokens

commit

Commit staged or unstaged changes with an AI-generated commit message that matches the repository's existing commit style. Use when the user asks to 'commit', 'commit changes', 'create a commit', 'save my work', or 'check in code'.

workstream-labs/workstreams · 52 tokens

release-announcement

Write a release announcement — changelog, blog post, in-app note, or social post — that leads with user impact, names the audience, and includes upgrade/migration steps without filler.

paperclipai/paperclip · 42 tokens

github-pr-workflow

Prepare a GitHub pull request from a feature branch — branch hygiene, commit shape, title/body, verification notes, screenshots for UI work, and replies to review comments.

paperclipai/paperclip · 39 tokens

contributor-onboarding

Help a new contributor get productive on this checkout - inspect sync state against main, build, run the repository's exact verification gate, and produce a local what's-new digest. Never fetches, pulls, or modifies a dirty tree on its own. Explicit-only.

Hmbown/CodeWhale · 57 tokens

codew-release-qa-sweep

Use before claiming Codewhale release work is done: run the full gate sweep and list the manual QA targets.

Hmbown/CodeWhale · 31 tokens