Summary
Aiden already has a strong owned-worktree core (userData/worktrees, ownership markers, fail-closed admission, quarantine delete, startup crash reconcile, desktop + remote APIs). We should not rewrite that stack — add OpenClaw’s product lifecycle layer on top.
Reference plan (Notion draft): https://app.notion.com/p/3da80314a1c481ea9631e23994e8689d
OpenClaw docs: https://docs.openclaw.ai/concepts/managed-worktrees
OpenClaw PRs: openclaw/openclaw#100535 · openclaw/openclaw#100788
steipete (2026-09-13): worktrees ~80% faster via APFS/Btrfs/XFS/ReFS folder clones — treat CoW as P2 after correctness.
What Aiden has today
- Layout:
userData/worktrees/<repo>-<12hex>/<branchSlug>-<uuid8> (git.ts:4645-4654)
- Create:
git worktree add -b <branch> … HEAD only — no base-ref picker (git.ts:4625-4658)
- Ownership:
aiden-owner + device/inode; admission gates terminals/LLM/schedules
- Delete: clean-only (incl. ignored); quarantine + native remover; no snapshot/restore (
git.ts:4835-4851)
- UI:
/worktree, create → new chat (chat-pane.tsx:2459-2504); remote create/delete
P0
- Snapshot-before-delete + restore (
refs/aiden/snapshots/…) — dirty work is stuck today
- Disk admission before create
- Disable Git hooks on managed
worktree add
.worktreeinclude provisioning
- Fail-closed
.aiden/worktree-setup.sh with sanitized env only (AIDEN_SOURCE_TREE_PATH / AIDEN_WORKTREE_PATH)
P1
aiden/<name> branch namespace + base-ref picker
- Idle GC (~7d) + snapshot retain (~30d); manual never auto-swept
- Settings → Worktrees (list / restore / force)
P2
- APFS/Btrfs/ReFS CoW acceleration
- Configurable
worktreeRoot
Do not
- Run setup scripts with full process env
- Auto-sweep manual worktrees
- Chase CoW before snapshot/restore is correct
Acceptance (MVP)
Summary
Aiden already has a strong owned-worktree core (
userData/worktrees, ownership markers, fail-closed admission, quarantine delete, startup crash reconcile, desktop + remote APIs). We should not rewrite that stack — add OpenClaw’s product lifecycle layer on top.Reference plan (Notion draft): https://app.notion.com/p/3da80314a1c481ea9631e23994e8689d
OpenClaw docs: https://docs.openclaw.ai/concepts/managed-worktrees
OpenClaw PRs: openclaw/openclaw#100535 · openclaw/openclaw#100788
steipete (2026-09-13): worktrees ~80% faster via APFS/Btrfs/XFS/ReFS folder clones — treat CoW as P2 after correctness.
What Aiden has today
userData/worktrees/<repo>-<12hex>/<branchSlug>-<uuid8>(git.ts:4645-4654)git worktree add -b <branch> … HEADonly — no base-ref picker (git.ts:4625-4658)aiden-owner+ device/inode; admission gates terminals/LLM/schedulesgit.ts:4835-4851)/worktree, create → new chat (chat-pane.tsx:2459-2504); remote create/deleteP0
refs/aiden/snapshots/…) — dirty work is stuck todayworktree add.worktreeincludeprovisioning.aiden/worktree-setup.shwith sanitized env only (AIDEN_SOURCE_TREE_PATH/AIDEN_WORKTREE_PATH)P1
aiden/<name>branch namespace + base-ref pickerP2
worktreeRootDo not
Acceptance (MVP)
.worktreeincludecopies recorded ignored files