jordyvanvorselen

Pi Bare Worktrees — Development skill for Claude Code

Development community

Flexible and blazing-fast --bare checkout worktree support for the Pi agent harness.

How to install Pi Bare Worktrees

This entry records only its repository, not the path inside it, so there is no exact command to give. Open jordyvanvorselen/pi-bare-worktrees and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Pi Bare Worktrees does

Flexible and blazing-fast --bare checkout worktree support for the Pi agent harness.

Alternatives in Development

  • Clean Worktree (Interactive) — Interactive cleanup of worktrees: lists merged/stale branches and asks confirmation before deleting 25.5k ★
  • Worktree Cleanup — Remove worktrees and branches that have been merged: $ARGUMENTS 23.4k ★
  • Cancel Pua Loop — 取消当前活跃的 PUA Loop(原子级联:state + worktree + 记录) 19.5k ★

README

pi-bare-worktrees

Git worktrees for `--bare` checkouts in [pi](https://pi.dev). One worktree per task, shared env files linked in, protected branches kept read-only, and a `worktree` tool the agent calls itself.

What it does

  • Every change gets its own worktree. main and other protected branches are read-only. The first edit on them is blocked with a message that tells the model to call worktree create. It then continues in the new worktree without a cd.
  • Shared env, zero config. Every file under /.shared-env/ is symlinked into each worktree at the same relative path. Real files are never overwritten.
  • Fast. No git process on session start or on tool calls. Root detection, worktree listing and link checks read the filesystem. Git runs only when you create, remove, clean, or in the background for the footer.
  • Native. The tool shows up in the system prompt, the footer shows the active worktree, state survives /resume, and subagents inherit the worktree.

Layout it expects

project/
├── .bare/            bare repo (core.bare = true)
├── .shared-env/      gitignored files to mirror, e.g. connect-backend/.env.keys
├── main/             worktree for main
└── feat/login/       worktree for feat/login

Path equals branch name. Create one with:

mkdir project && cd project
git clone --bare git@github.com:org/repo.git .bare
git --git-dir=.bare config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
git --git-dir=.bare fetch
git --git-dir=.bare worktree add main main

Outside this layout the extension turns itself off and says so once at startup.

Install

pi install npm:@jordyvanvorselen/pi-bare-worktrees

Then, inside a worktree:

/wt setup

Setup opens one screen with every setting prefilled: shared env directory, base branch, protected patterns, branch template, fetch before create, auto-link, post-create commands and copy list. Press Enter through the fields to keep the defaults,