noodle: Skill for Claude Code

.agents/skills/worktree/SKILL.md

worktree is a skill for Claude Code, Codex from poteto/noodle. It costs 54 tokens per session (1,401 once invoked), scanned C, original, MIT.

A workflow for giving concurrent coding sessions their own linked Git worktrees, which are separate working directories connected to the same repository. It also provides commands for creating, listing, using, and cleaning up those worktrees.

In plain words
What is it for?
It is for isolated feature work, running commands in a named worktree, checking merge status, and managing worktrees safely when several agents or sessions work at once.
Why use it?
Separate directories prevent simultaneous sessions from overwriting each other's files or branches. The workflow also handles setup details such as dependencies and local settings.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions subagents; installed under .agents/ (shared by several agents).

This is poteto/noodle's own configuration. It tells Claude Code and Codex how to work on noodle itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything noodle configures →

Reuse

Borrowing it

Nothing to install: this file belongs to poteto/noodle. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/poteto/noodle/main/.agents/skills/worktree/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/poteto/noodle

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/poteto/noodle/worktree"><img src="https://agentmods.dev/badge/skills/poteto/noodle/worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,401 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00054 $0.01401
Opus 5.5 $0.00022 $0.00560
Sonnet 5.5 $0.00011 $0.00280
Haiku 4.5 $0.00005 $0.00140

Measured 1mo ago against content hash 0d1100c02712, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

worktree scanned grade C with 1 finding 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 1mo 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

The Bash tool maintains a persistent shell — `cd` in one call persists to ALL future calls. A later `rm -rf` or `git worktree remove` on that path kills the shell instantly.
.agents/skills/worktree/SKILL.md · 145 lines

How it starts

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

Worktree

Default to linked-worktree isolation. Multiple sessions often run concurrently. Setup costs ~30 seconds and prevents hours of merge pain.

Valid Workspace Definition

  • Valid for significant or autonomous work: linked checkout created via Skill(worktree) create (typically .worktrees/<name>)
  • Not valid by default: primary checkout at repo root
  • Allowed exception: interactive, single-agent, small changes can run in primary checkout when that is the deliberate choice

All operations use noodle worktree — it enforces CWD safety, correct sequencing, stash/rebase handling, and dep reinstall.

Commands

Preflight

noodle worktree list

Shows all worktrees with merge status. Run at session start to spot stale worktrees from crashed sessions.

Create

noodle worktree create <name>

Creates worktree + branch at .worktrees/<name>, symlinks .claude/settings.local.json, auto-detects package manager, installs deps.

Run commands inside a worktree

noodle worktree exec <name> <command...>

Runs the command inside the worktree via cmd.Dir. The parent shell's CWD never changes — this is the safe way to run builds, tests, or any tool that needs the worktree as CWD.

# Examples
noodle worktree exec my-feature go test ./...
noodle worktree exec my-feature go build ./...

For git operations, git -C also works and doesn't need exec:

git -C <project-root>/.worktrees/<name> status
git -C <project-root>/.worktrees/<name> add -A
git -C <project-root>/.worktrees/<name> commit -m "message"

File reads/edits use absolute paths directly — no exec needed.

Merge

noodle worktree merge <name>
noodle worktree merge <name> --into <branch>

Single command does: CWD safety check -> stash worktree noise -> rebase onto target branch -> merge -> remove worktree -> delete branch -> prune -> reinstall deps. Refuses to run if CWD is inside the worktree or if root checkout is not on the target branch.

Read the full file on GitHub · 145 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. 1mo ago First seen · 145 lines · 54 tokens per session scan C 0d1100c02712

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository poteto/noodle (529 stars, last pushed 7mo ago), licensed MIT. It adds 54 tokens to every session and 1,401 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.