worktree
Create a work branch in a ready-to-use git worktree. The normal way to start a branch, so as not to cross another session in the main tree.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 3
- Forks
- 3
01 前言 Front Matter
- name
- worktree
- description
- Create a work branch in a ready-to-use git worktree. The normal way to start a branch, so as not to cross another session in the main tree.
- argument-hint
- <type/branch-name>
03 SKILL.md 正文
Branch asked for: $ARGUMENTS (feat/…, fix/…, chore/…, like the repo's history). Without
an argument, propose one from the task.
- Find the root of the repo (
git rev-parse --show-toplevelof the main tree) and its integration branch: the one the project'sCLAUDE.mdnames, otherwisedevelopif it exists onorigin, otherwise the default branch (git symbolic-ref refs/remotes/origin/HEAD). - From the root, never switching the branch of the main tree:
git fetch -q origin <integration>, thengit worktree add --no-track .claude/worktrees/<name> -b <branch> origin/<integration>(<name>= the branch with/replaced by-). Without--no-track, the branch would trackorigin/<integration>: a baregit pushrefused, agit pullthat pulls the integration branch. If the branch already exists, attach it without-b. Check that.claude/worktrees/is ignored by git; otherwise add it to.git/info/exclude. - Prepare the worktree:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/prepare-worktree.sh" <path of the worktree>(copies the ignored.env*files of the main tree, installs the dependencies of eachpnpm-lock.yaml/package-lock.json). If the repo also provides.claude/worktree-setup.sh, run it next with the same argument. - Move the session into it with Claude Code's
EnterWorktreetool (path= the worktree): the status line, the hooks and the relative paths then describe the branch being worked on, not the main tree's integration branch. Without that tool, work only in the worktree (absolute paths). Give its path. Claude Code's isolation then refuses a command it cannot read (a variable even in a plain path, a heredoc,cd, a loop,$(…),git -C, several commands chained around git): send git commands plain and one by one, and put the rest in a script.
04 同仓库更多 Skills
update
Update ion-repo - the ion-repo tool of the machine and its plugins, then the open repo (ion repo update, on a branch merged right away into develop). Use when the user asks to update ion-repo, or accepts the update offered at session start.
token
Set up a service's credentials (PyPI, Stripe, an API, a host…) in a `.<service>/` folder at the repo root (`token`, chmod 600, and `config` on its scope), with one command that pastes the token unseen. Use when a task needs an API key or a token, or when the user wants to give one.
statusline
Change the look of the status line - its style, its colors, among them the chat's (the person's and Claude's) - each shown before it is chosen. Use when the user wants another status line, other colors for it, or from `/repo:look`.
skill
Write or sharpen a skill of an Ion tool's plugin - intent, SKILL.md in the right craft's plugin, one trigger case, docs; tested with `claude plugin eval` only on request. Use when the user wants a new skill, to fix one, or to check one fires and does its job.
review
暂无简介
resize
Move a repo up or down ion-repo's sizes (tiny, small, medium, large) - what the new size brings or removes shown before the merge, the settings that go with it, ion repo set on a branch, merged. Use when the user asks to change a project's size, or it outgrew its size or is heavier than it needs.