Files
paseo/plugin-examples/worktrunk/README.md
T
Mohamed Boudra 1230337165 feat(plugins): let plugins manage worktree create, remove, and restore
Adds server.registerWorktreeManager({ create, remove?, restore? }) so external worktree tools such as Worktrunk can own Git worktree creation, removal, and restoration instead of overloading worktree.create.before.

Keeping worktree.create.before purely transformative preserves multi-plugin chaining, rollback, and the 30s hook budget, while giving manager operations a 120s budget matching git worktree commands. Paseo snapshots existing worktrees before create so managers cannot hijack pre-existing user worktrees, writes comparison-base and owning plugin metadata into paseo/worktree.json and the workspace record, saves refs/paseo/kept-commits before removal so restore stays safe, and falls back to built-in Git if a manager declines or is disabled.
2026-11-20 07:52:07 +01:00

1.3 KiB

Worktrunk plugin example

Delegates Paseo worktree creation, removal, and restoration to Worktrunk (wt), and updates wt list activity markers (🤖 / 💬) as agents run.

What it does

  • Create: routes branch-off, branch checkout, GitHub PR (pr:N), and GitLab MR (mr:N) creation through wt switch --no-cd --yes --format=json so Worktrunk controls placement, branch setup, and pre-start / post-start hooks. Unsupported forges decline and fall back to Paseo's Git checkout.
  • Remove: routes archive and creation rollback through wt remove --foreground --no-delete-branch --yes so Worktrunk runs pre-remove and post-remove hooks while keeping the branch for Paseo's restore flow.
  • Restore: routes archived worktree restoration through wt switch --path <recorded-path> for branch restores, and falls back to Paseo for detached-commit restores.
  • Activity markers: sets 🤖 when an agent turn starts, 💬 when a turn ends or awaits permission, and clears the marker on close or archive. Background helpers are skipped.

Prerequisites

Install Worktrunk (wt, or git-wt.exe on Windows) on PATH, or set WORKTRUNK_BIN in the daemon environment.

Install

paseo plugin install /absolute/path/to/plugin-examples/worktrunk