worktree

worktree is a skill for Claude Code, Codex from zts212653/clowder-ai. It costs 43 tokens per session (3,673 once invoked), scanned A, original, MIT.

A workflow for creating an isolated Git worktree, which is a separate working copy of a repository tied to its own branch. It also defines checks and project-specific rules before development begins.

In plain words
What is it for?
Use it before non-trivial development involving code, scripts, APIs, command-line tools, or other executable project areas. It also covers memory searches, branch locations, and required checks.
Why use it?
It keeps feature work away from the main branch and helps prevent changes from interfering with production files or other work.

Skill for Claude CodeCodex

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/zts212653/clowder-ai/worktree
Any agent
npx skills add zts212653/clowder-ai --skill worktree
Clone the repo
git clone --depth 1 https://github.com/zts212653/clowder-ai

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/zts212653/clowder-ai/worktree.svg)](https://agentmods.dev/skills/zts212653/clowder-ai/worktree)
Your own site
<a href="https://agentmods.dev/skills/zts212653/clowder-ai/worktree"><img src="https://agentmods.dev/badge/skills/zts212653/clowder-ai/worktree.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,673 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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 $0.00043 $0.03673
Opus 5 $0.00022 $0.01836
Sonnet 5 $0.00009 $0.00735
Haiku 4.5 $0.00004 $0.00367

Measured today against content hash f2073ccefbaf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

worktree scanned grade A 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 today.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- 🔴 **`localhost:3003/3004` 默认属于 `cat-cafe-runtime`**。如果你要验证当前 worktree 的未合入改动,浏览器 / Playwright / curl 不能直接打这两个端口,除非你明确是在做 runtime 验收而不是开发验证
cat-cafe-skills/worktree/SKILL.md · 265 lines

How it starts

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

Worktree

开始任何非 trivial 的功能开发前,必须拉 worktree 隔离,不要直接在 main 上改代码。Skill / MCP description 如果改到 API route、localhost、script、CLI command、第一方执行面,即使只有几行,也不按“纯文档免验证”处理:默认跑 skill reference/surface 与 claim 对应的定向检查;只有五轴实际命中高风险或 targeted 无法覆盖跨包合流风险时才跑 full pnpm gate。非 trivial 行为改动仍应开 worktree。

Co-Creation Docs 边界

纯文档不再按行数决定是否进 worktree。用户授权落盘的共创文档先加载 co-creation-docs;显然低风险时猫可直接判定,拿不准或准备升到重载体时才运行 pnpm classify:co-creation-docs

  • 显然 low-risk 或 delivery=direct_push → 不加载本 skill;走轻量文档校验 + 按内容决定 review=required|reuse|skip + commit/push。
  • delivery=pull_requestlane=co_creation_docs → 独立分支用于冲突/治理 review,但不自动升级 full gate。
  • lane=regular_development → 正常加载本 skill。

cat-cafe-skills/**sop-definitions/**、脚本、CLI 与其他第一方执行面始终属于 regular development;文件扩展名是 .md 也不例外。

开工前 Recall(F102 记忆系统)🔴

拉 worktree 前,先用记忆系统搜一下相关上下文(见 CLAUDE.md 记忆系统段落):

search_evidence("{feature关键词}")
search_evidence("{topic}", scope="all")

不搜就开工 = 从零开始,可能重蹈覆辙。

目录位置(铁律)

Clowder AI 项目:../cat-cafe-{feature-name}(relay-station/ 同级)

git worktree add ../cat-cafe-{feature-name} -b feat/{feature-name}
  • 🔴 禁止在项目内部创建(不要用 .worktrees/ 子目录)
  • 🔴 cat-cafe-runtime 是生产环境,绝对不能删/清理! 它不是开发 worktree
  • 🔴 禁止在 cat-cafe-runtime 里执行 pnpm start / pnpm runtime:start(会先 kill 旧 API,等于把在线 runtime 踢掉)
  • 🔴 localhost:3003/3004 默认属于 cat-cafe-runtime。如果你要验证当前 worktree 的未合入改动,浏览器 / Playwright / curl 不能直接打这两个端口,除非你明确是在做 runtime 验收而不是开发验证

其他项目:先查 CLAUDE.md / AGENTS.md 有没有指定位置 → 有就用 → 没有再问用户。

创建前:Main 同步检查(F073 门禁)

开 worktree 前必须确认 main 与 origin/main 完全同步(双向)。其他猫看的是 origin/main,不同步 = 信息不对称。

# Step 1: 检查是否有未提交的文档变更
git status --porcelain docs/ | head -5
# 如果有输出 → 先 commit 再继续

# Step 2: 检查 main 与 remote 双向同步
git fetch origin main --quiet
AHEAD=$(git rev-list --count origin/main..main)
BEHIND=$(git rev-list --count main..origin/main)
echo "ahead=$AHEAD behind=$BEHIND"
# ahead > 0 → 先 git push origin main
# behind > 0 → 先 git pull origin main
# 两者都 = 0 → 可以继续

Read the full file on GitHub · 265 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. today Changed f2073ccefbaf
  2. 3d ago First seen · 265 lines · 43 tokens per session scan A af508f637a0e

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository zts212653/clowder-ai (2,878 stars, last pushed today), licensed MIT. It adds 43 tokens to every session and 3,673 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

bigquery-ai-ml

Leverages BigQuery's built-in machine learning and GenAI capabilities for advanced data analytics. Use when you need to write SQL queries that perform time-series forecasting, predict values, detect outliers or anomalies, find key drivers, perform semantic search or vector search, classify text, calculate similarity…

google/skills · 104 tokens

moderator-page-migration

Port a moderator page from the main Next.js app (src/pages/moderator/) into apps/moderator. Use when asked to migrate, move or cut over a /moderator/ page to the spoke, or to port its tRPC procedures and Prisma services to SvelteKit loads/actions and Kysely.

civitai/civitai · 71 tokens

prisma-upgrade-v7

Complete migration guide from Prisma ORM v6 to v7 covering all breaking changes. Use when upgrading Prisma versions, encountering v7 errors, or migrating existing projects. Triggers on "upgrade to prisma 7", "prisma 7 migration", "prisma-client generator", "driver adapter required".

nitrocloudofficial/nitrostack · 67 tokens

ddia-systems

Design data systems by understanding storage engines, replication, partitioning, transactions, and consistency models. Use when the user mentions "database choice", "which database should I use", "SQL or NoSQL", "replication lag", "partitioning strategy", "consistency vs availability", "stream processing", "ACID…

wondelai/skills · 138 tokens

sqlitecpp-update-sqlite

How to update the bundled SQLite3 amalgamation (sqlite3/sqlite3.c and sqlite3.h), the Meson wrap, README.md, and CHANGELOG.md. Use when upgrading SQLite, refreshing the vendored amalgamation, or bumping the sqlite3 wrap.

SRombauts/SQLiteCpp · 61 tokens

dsql

Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, diagnose cluster performance, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, FK…

awslabs/agent-plugins · 227 tokens