finish-work-on-local-worktree

finish-work-on-local-worktree is a skill for Claude Code from mayank-io/mstack. It costs 130 tokens per session (1,369 once invoked), scanned A, original, MIT.

A worktree-closing workflow for a completed Git branch. A worktree is a separate working copy of a repository, and Git is a tool for tracking code changes.

In plain words
What is it for?
Use it after tests pass and the worktree has no uncommitted changes, when you need to merge the branch, mark related documentation complete, update the project plan, and choose the next milestone.
Why use it?
It brings finished branch work into the main branch and updates the related project records so the work is properly closed out.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code.

Part of the dev plugin — 9 skills shipped together

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.

agentmods
npx agentmods add skills/mayank-io/mstack/finish-work-on-local-worktree
Any agent
npx skills add mayank-io/mstack --skill finish-work-on-local-worktree
Clone the repo
git clone --depth 1 https://github.com/mayank-io/mstack

Made for: Claude Code.

Or install dev, the plugin that ships this one along with the rest of its 9 skills.

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 finish-work-on-local-worktree

README.md
[![agentmods](https://agentmods.dev/badge/skills/mayank-io/mstack/finish-work-on-local-worktree.svg)](https://agentmods.dev/skills/mayank-io/mstack/finish-work-on-local-worktree)
Your own site
<a href="https://agentmods.dev/skills/mayank-io/mstack/finish-work-on-local-worktree"><img src="https://agentmods.dev/badge/skills/mayank-io/mstack/finish-work-on-local-worktree.svg" alt="Measured on agentmods" height="20"></a>
Per session 130 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,369 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00130 $0.01369
Opus 5 $0.00065 $0.00685
Sonnet 5 $0.00026 $0.00274
Haiku 4.5 $0.00013 $0.00137

Measured 5d ago against content hash 75536779eb18, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

finish-work-on-local-worktree 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 5d 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.

plugins/dev/skills/finish-work-on-local-worktree/SKILL.md · 146 lines

How it starts

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

Finish Work on Local Worktree

Complete a worktree lifecycle: squash-merge the branch into main, update all related documentation status, update the project plan, and recommend what to work on next.

Prerequisites

  • All tests pass on the worktree branch
  • No uncommitted changes in the worktree
  • Work on the branch is verified and ready to integrate

Arguments

Accept an optional branch name argument. If not provided, detect from the current worktree or ask the user.

Workflow

Execute these phases in order. Stop and report if any phase fails.

Phase 1: Local Merge

Invoke the git-worktree:local-merge skill via the Skill tool, passing the branch name if provided as an argument.

Wait for the merge to complete before proceeding. If the merge fails (conflicts, dirty worktree, not in a worktree), stop and help the user resolve the issue.

After the merge succeeds, note the BRANCH name — it drives doc discovery in Phase 2.

Phase 2: Update Related Documentation

Find all docs related to the merged branch and update their status to completed.

Step 2a: Find related docs

Use the Grep tool to search docs/ for files whose YAML frontmatter contains work: <BRANCH> (substituting the actual branch name from Phase 1). Also check the related: frontmatter array in those docs to find transitively related docs.

Step 2b: Update frontmatter status

For each related doc found:

  1. Read the current status: and stage: frontmatter fields
  2. If status: is not already completed, update it to completed
  3. If stage: exists, update it to impl (implementation is done)
  4. Do NOT change docs that are already completed or archived

Step 2c: Report changes

List each doc updated with its old and new status:

Updated docs:
- docs/2026-04-04-feature-design.md: active → completed
- docs/2026-04-04-feature-impl-plan.md: active → completed

Phase 3: Update Project Plan

Find and update the project plan to reflect the completed milestone. If no project plan is found, skip this phase entirely and note in the final report that no project plan was updated.

Read the full file on GitHub · 146 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. 5d ago First seen · 146 lines · 130 tokens per session scan A 75536779eb18

Subscribe to this mod's changes

finish-work-on-local-worktree is a skill published in the GitHub repository mayank-io/mstack (5 stars, last pushed 11d ago), licensed MIT. It adds 130 tokens to every session and 1,369 once invoked, about $0.0006 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-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens