pi-worktree
Create, enter, inspect, and clean up git worktrees through the enter_worktree tool, /worktree command, or pi-worktree CLI.
Skill by chaochaoxiaochao
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/chaochaoxiaochao-pi-worktree
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/pi-worktree
What's inside
- Skill name
pi-worktree- Description
- Create, enter, inspect, and clean up git worktrees through the enter_worktree tool, /worktree command, or pi-worktree CLI. Use when a task warrants isolation in its own worktree, or when the user asks to handle something the worktree way.
- License
- MIT
- Instructions
- 35 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# pi-worktree
Worktrees live in `.worktrees/<name>` (added to `.gitignore`), each with a branch of the same name, branched from the current branch (or `HEAD` when detached). The base commit is recorded in `branch.<name>.base` / `branch.<name>.baseRef` so `info` can report where the branch came from.
Installed by the package postinstall hook to `~/.local/bin/pi-worktree`, with bash completion for subcommands and existing worktree names.
## Commands
| Command | Effect |
|---|---|
| `enter_worktree({ name, base? })` | Agent entrypoint: create/reuse a worktree and automatically move this conversation there after the run settles. Call it alone and stop after it returns. |
| `/worktree start <name> [--base <ref>]` | User entrypoint: fork the current persistent session into the worktree and switch the current Pi UI. |
| `pi-worktree create [--base <ref>] [--json] <name>` | Idempotently create/reuse without launching Pi; `--json` is the machine interface. |
| `pi-worktree list` | All worktrees; the main checkout is marked `(main checkout)`, stale registrations are flagged. |
| `pi-worktree info <name>` | Clean/dirty status, branch and HEAD, base commit, ahead/behind `main`, unique commits. |
| `pi-worktree out` | Open a shell in the main checkout (for merging). |
| `pi-worktree remove <name> [<name> ...]` | Remove worktrees and branches in order; asks before discarding dirty files or unmerged commits. Stops on failure without undoing earlier removals. |
| `pi-worktree prune` | Drop registrations whose directory was deleted by hand. |
## Isolating a task
1. **Survey** — `pi-worktree list`, plus `pi-worktree info <name>` when the name you want is already taken. Reuse is free; a removed worktree is gone for good, because `remove` deletes its branch.
2. **Enter** — as an Agent, call `enter_worktree` once and stop; the Extension switches automatically after settlement. A user can instead run `/worktree start <name>`.
3. **Work** — inside the worktree: commit there, and check `pi-worktree info <name>` before claiming progress. `ahead: N commits since base` is the evidence.
4. **Land** — `pi-worktree out`, then `git merge <name>` in the main checkout. Done when the worktree's unique commits are in the target branch.
5. **Clean up** — `pi-worktree remove <name>`. A merged branch goes without prompting; anything unmerged asks once.
## Entry-point rules
- Prefer `enter_worktree` when it is available. After the tool returns, do not read or modify repository files; the Extension waits for `agent_settled`, then forks the session into the target cwd and switches automatically.
- `/worktree` is user-facing and cannot be invoked by the model. It requires a persisted session because it forks history into a session whose header owns the worktree cwd.
- `create` is idempotent and never launches Pi. It reports whether the target was created, attached, reused, or already active, and reports dirty reuse rather than discarding anything.
- `remove` asks before discarding dirty files or unmerged commits, and a non-interactive stdin (EOF) aborts safely. Answer explicitly when the removal is intended: `printf 'y\ny\n' | pi-worktree remove <name>`.From chaochaoxiaochao/pi-toolkit, MIT.
More from chaochaoxiaochao/pi-toolkit
- 0.603score
web-browser
chaochaoxiaochao
Automate and interact with web pages through Chrome or Chromium using the Chrome DevTools Protocol (CDP): navigate, click, fill forms, inspect content, take…
SkillAFreshness: A★ 2Claude Code +9 - 0.597score
tapd
chaochaoxiaochao
通过 tapd CLI 查询和操作 TAPD 中的需求、缺陷、任务和 Wiki。用户提供 tapd.cn 链接,或要求分析、查询、创建、更新 TAPD 条目及其评论、变更、附件和关联提交时使用。
SkillAFreshness: A★ 2Claude Code +9 - 0.589score
agent-team
chaochaoxiaochao
多模型协作分析:按配置的模型和角色调度独立子代理,汇总结果并维护调查档案。
SkillAFreshness: A★ 2Claude Code +9 - 0.554score
html-artifact
chaochaoxiaochao
Create self-contained, responsive HTML artifacts for complex explanations that benefit from visual structure or interaction, including workflows, code/module…
SkillBFreshness: B★ 2Claude Code +9 - 0.551score
pdlog
chaochaoxiaochao
解压和查看 .pdlog 日志文件。触发:.pdlog 文件、普渡日志/Pudu 日志、日志打开是乱码或二进制、ppmd 解压
SkillBFreshness: B★ 2Claude Code +9
Signals
- Stars
- 2
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 12, 2026 (17 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/chaochaoxiaochao/pi-toolkit
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from chaochaoxiaochao
- 0.603score
web-browser
chaochaoxiaochao
Automate and interact with web pages through Chrome or Chromium using the Chrome DevTools Protocol (CDP): navigate, click, fill forms, inspect content, take…
SkillAFreshness: A★ 2Claude Code +9 - 0.597score
tapd
chaochaoxiaochao
通过 tapd CLI 查询和操作 TAPD 中的需求、缺陷、任务和 Wiki。用户提供 tapd.cn 链接,或要求分析、查询、创建、更新 TAPD 条目及其评论、变更、附件和关联提交时使用。
SkillAFreshness: A★ 2Claude Code +9 - 0.589score
agent-team
chaochaoxiaochao
多模型协作分析:按配置的模型和角色调度独立子代理,汇总结果并维护调查档案。
SkillAFreshness: A★ 2Claude Code +9 - 0.554score
html-artifact
chaochaoxiaochao
Create self-contained, responsive HTML artifacts for complex explanations that benefit from visual structure or interaction, including workflows, code/module…
SkillBFreshness: B★ 2Claude Code +9 - 0.551score
pdlog
chaochaoxiaochao
解压和查看 .pdlog 日志文件。触发:.pdlog 文件、普渡日志/Pudu 日志、日志打开是乱码或二进制、ppmd 解压
SkillBFreshness: B★ 2Claude Code +9
Cite this page
pi-worktree skill. Agent Mart. https://agentmart.dev/skills/chaochaoxiaochao-pi-worktree (last updated 2026-10-24)