working-in-worktrees

working-in-worktrees is a skill for Claude Code from dork-labs/dorkos. It costs 66 tokens per session (4,709 once invoked), scanned A, original, MIT.

A guide for using separate Git worktrees, which are extra working folders linked to the same repository. It explains when to isolate code changes and how to create and clean up those folders safely.

In plain words
What is it for?
Use it before parallel development, delegated tasks, or any code change in a shared checkout. It covers choosing a worktree, entering it, and removing it safely.
Why use it?
It prevents two agents or sessions from changing the same checkout at once and accidentally overwriting or mixing work.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions Claude Code; mentions AGENTS.md.

Part of the flow plugin — 32 skills, 43 commands, 5 agents, 4 hooks shipped together

Good fit Use it before parallel development, delegated tasks, or any code change in a shared checkout. It covers choosing a worktree, entering it, and removing it safely.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dork-labs/dorkos/working-in-worktrees
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 dork-labs/dorkos --skill working-in-worktrees
Clone the repo
git clone --depth 1 https://github.com/dork-labs/dorkos

Made for: Claude Code.

Or install flow, the plugin that ships this one along with the rest of its 32 skills, 43 commands, 5 agents, 4 hooks.

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 working-in-worktrees

README.md
[![agentmods](https://agentmods.dev/badge/skills/dork-labs/dorkos/working-in-worktrees.svg)](https://agentmods.dev/skills/dork-labs/dorkos/working-in-worktrees)
Your own site
<a href="https://agentmods.dev/skills/dork-labs/dorkos/working-in-worktrees"><img src="https://agentmods.dev/badge/skills/dork-labs/dorkos/working-in-worktrees.svg" alt="Measured on agentmods" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,709 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 163
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 166
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • medium Rogue Agent · line 35
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
  • medium Rogue Agent · line 127
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.00066 $0.04709
Opus 5 $0.00033 $0.02354
Sonnet 5 $0.00013 $0.00942
Haiku 4.5 $0.00007 $0.00471

Measured 2d ago against content hash b7b435b6af56, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

working-in-worktrees 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.

.claude/skills/working-in-worktrees/SKILL.md · 197 lines

How it starts

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

Working in Worktrees

Overview

This skill governs workspace isolation for code work in DorkOS — a repo that is routinely worked by several agents and sessions at once. It teaches the one decision rule (one checkout, one writer), the concrete failure mode that makes isolation non-optional, the exact mechanics for creating, entering, and cleaning up a worktree without losing anyone's work — and the half that isolation does not buy you, because worktrees separate working trees but share every ref.

The repo-wide rule lives in AGENTS.mdWorktrees. This skill is the mechanics and the why.

When to Use

  • You are about to make a code change and the checkout may be shared with another agent or session.
  • You are running the /flow:execute stage (the workspace-choice phase of the flow plugin's executing-specs skill) — the unified /flow execution gate.
  • You are running parallel work that mutates tracked files.
  • You are comparing your branch against main across more than one command — a conflict investigation, a red-before drill, a changelog gate, a "what did main change" question.
  • You need to create, enter, exit, or remove a worktree and want the safe procedure.
  • You are unsure whether to isolate — the default answer for code work in this repo is yes.

Key Concepts

The rule: one checkout, one writer

main is the clean integration tree, not a shared scratchpad. Code changes default to an isolated worktree; main stays clean and is where branches merge back.

Default to a worktree for any code change. Stay in main only when all three hold:

  1. You are certainly the sole writer in this checkout, and
  2. The work is non-code (research/, specs/, tracker, docs prose) or a single commit you land immediately, and
  3. No long-running dev server in this checkout needs to stay undisturbed.

Create a worktree when any trigger fires:

  • 🔴 Another agent/session may be active here — the DorkOS default. You usually cannot prove you are alone, so assume you are not.
  • 🔴 Multi-commit / long-lived code work — a feature, refactor, or spec implementation.
  • 🟡 The checkout is already dirty or on an unrelated topic branch.
  • 🟡 A dev server or build must run undisturbed (port isolation).

Read the full file on GitHub · 197 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 · +31 lines b7b435b6af56
  2. 4d ago First seen · 166 lines · 66 tokens per session scan A 284ae691c9aa

Subscribe to this mod's changes

working-in-worktrees is a skill published in the GitHub repository dork-labs/dorkos (9 stars, last pushed today), licensed MIT. It adds 66 tokens to every session and 4,709 once invoked, about $0.0003 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-09-03.