fleur-worktree

A workflow guide for using separate Git worktrees, which are extra checkouts of one repository, when several coding tasks run at the same time.

In plain words
What is it for?
It is for creating task-specific branches and directories, coordinating parallel work, validating merges, and cleaning up completed worktrees.
Why use it?
It reduces the chance that parallel agents overwrite each other’s files, branches, or unfinished changes, while documenting what worktrees do not isolate.

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

Made for: Claude Code, Codex.

Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,507 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 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.00074 $0.02507
Opus 5 $0.00037 $0.01254
Sonnet 5 $0.00015 $0.00501
Haiku 4.5 $0.00007 $0.00251

Measured 3d ago against content hash 98225776a764, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

fleur-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 3d 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.

- **直接 `rm -rf` 会留下 stale metadata**:优先 `git worktree remove`,必要时再 `git worktree prune`。
docs/skills/fleur-worktree/SKILL.md · 255 lines

How it starts

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

Fleur Worktree

当同一个 fleur 仓库需要同时推进多个 Codex/agent 任务时,使用这个 skill。目标是一任务一 worktree、一任务一分支、一套明确验证和清理规则,避免 agent 互相踩文件、共享运行时状态或把未完成分支混入主工作区。

依据

  • OpenAI Codex app 公开材料强调并行 agent、内置 worktrees、隔离环境和可审阅 diff。
  • OpenAI harness engineering 文章提到让应用可按每个 Git worktree 启动,使 Codex 能为每个变更管理独立实例。
  • Git 官方 git-worktree 文档定义了 addlistremoveprune 等生命周期命令;清理 worktree 时优先用 Git 命令而不是直接删除目录。

原则

  • 每个并行任务使用独立 worktree 和独立 branch。
  • worktree 放在仓库外部的兄弟目录,不放进 fleur/ 内部。
  • 不从脏工作区创建新任务,除非用户明确要求把当前未提交改动带过去。
  • worktree 只隔离文件系统和 Git checkout,不隔离 S3、PostgreSQL、Dagster run storage、端口、后台进程或外部 API。
  • 能串行就不伪装并行:两个任务会改同一模块、同一迁移、同一资产契约或同一运行状态时,指定 integrator 分支串行合并。
  • 合并前必须在目标分支上重新验证;合并后必须清理 worktree 和 stale metadata。

布局

主仓库:

/storage/program/fleur

推荐 worktree 根目录:

/storage/program/fleur-worktrees/

命名规则:

  • worktree 目录:<yyyymmdd>-<short-task>
  • branch:codex/<yyyymmdd>-<short-task>
  • slug 只用小写字母、数字和 -

示例:

/storage/program/fleur-worktrees/20260531-scheduler-runner
branch: codex/20260531-scheduler-runner

创建流程

在主仓库或任意干净 worktree 中执行:

git status --short
git worktree list
git fetch --all --prune

mkdir -p ../fleur-worktrees
git worktree add -b codex/20260531-topic ../fleur-worktrees/20260531-topic HEAD

如果要基于远端主线创建,先确认默认分支名,再显式指定:

git branch --show-current
git worktree add -b codex/20260531-topic ../fleur-worktrees/20260531-topic origin/main

进入新 worktree 后先同步依赖:

cd ../fleur-worktrees/20260531-topic/pipeline
uv sync --all-packages --all-groups

环境隔离

.env 不提交。需要运行本地命令时,按任务选择:

  • 只做文档、静态代码、单测:通常不需要复制 .env
  • 需要访问同一套外部 S3/PostgreSQL/API:可以复制或软链接 .env,但必须确认任务不会写入生产或共享状态。
  • 需要并行运行 Dagster、服务或数据库相关任务:不要共享 DAGSTER_HOME、端口、临时目录或本地数据库 schema。

Dagster 运行建议:

  • dg check defs、ruff、pyright、pytest 可在 feature worktree 内运行。
  • 物化、回填、OCR、外部 API 写入类任务默认不要从普通 feature worktree 执行。
  • 如果确实要在 worktree 中运行 Dagster,使用该 worktree 自己的 .dagster,并在命令前显式设置 DAGSTER_HOME="$PWD/.dagster"
  • 任何涉及真实 S3/PostgreSQL 写入的操作,先使用 docs/skills/fleur-dagster-backfill-runbook/SKILL.md 判断是否应该切回主工作区或专用 ops worktree。

Read the full file on GitHub · 255 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. 3d ago First seen · 255 lines · 74 tokens per session scan C 98225776a764

Subscribe to this mod's changes

fleur-worktree is a skill published in the GitHub repository WackyGem/Fleur (110 stars, last pushed 1mo ago), licensed MIT. It adds 74 tokens to every session and 2,507 once invoked, about $0.0004 per session on Opus 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.

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

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens