Skill v1.0.1
currentAutomated scan100/100~1 modified
name: portal description: Creates a git worktree for isolated feature work; respects disableGit. Use to isolate a feature on its own branch. allowed-tools: Read, Bash(git worktree add *) argument-hint: "[feature-name]" metadata: version: "1.0.1"
/portal — Git Worktree Isolation
Create an isolated git worktree for feature development.
Check disableGit Mode
Read .workspace/local/prefs.md for disableGit: true. If set, skip all git operations and work in the current directory.
Process (git mode)
- Get branch name — if
$ARGUMENTSis non-empty, use it as the feature name directly. Otherwise ask: "What's this feature called? (I'll use it as the branch/worktree name.)" End your turn. Wait for their answer before creating anything. - Create worktree (one plain command, so it matches this skill's pre-approval):
``bash git worktree add ../<repo-name>-<name> -b feature/<name> ``
- Workspace files — tracked files (
.workspace/shared/) come with the branch; gitignored ones such as.workspace/local/prefs.mddon't. Worktrees that Claude Code creates itself (claude --worktree, subagent worktree isolation) copy the gitignored files listed in a.worktreeincludefile at the repo root, so listing.workspace/local/prefs.mdthere is a useful tip for the user. For this plaingit worktree add, copy any local file the new worktree needs (that copy goes through the normal permission prompt). - Confirm the new worktree path to the user
- Say: "Worktree created at
../<path>. Work there for isolation. Run /seal when ready to merge."
Alternatives at agent scale
Pick the lightest isolation that fits. Feature-detect each one. Do not ask the user to check a version.
- `claude --worktree <name>`. Use it when
claude --helplists--worktree. It starts a new session in its own worktree and copies the files listed in.worktreeinclude. Tell the user the command. Do not run it from this session. - Agent `isolation: worktree`. Use it for a dispatched subagent that edits files in parallel with others. Set it in the agent's frontmatter or in the
Agentcall when the tool accepts it. Claude Code removes the worktree when the agent made no change. - `git sparse-checkout` in a monorepo. Use it when the repository has more than about 10,000 tracked files and the feature touches one or two packages. After step 2, run
git -C ../<repo-name>-<name> sparse-checkout set --cone <package-dirs>. That command is not pre-approved, so it prompts. Add the shared config folders the build needs. - Plain `git worktree add`. Use it in every other case (the process above).
Keep each change small and state its intent in the branch name and the first commit (lore/git.md).
Process (disableGit mode)
- Create a feature directory:
mkdir -p .features/<name> - Note: no git isolation — be careful about conflicts with other in-progress work
- Say: "Working in .features/<name>/ (disableGit mode — no worktree created)."
Keep sibling worktrees in the loop
Worktrees isolate the files, not the consequences: a rename, a signature change, or a shared-dependency bump made here breaks whatever a sibling session is building on. When Claude Code's cross-session messaging is available, tell the affected session yourself instead of letting it discover the breakage — ListAgents finds the sessions working the other worktrees, SendMessage delivers one self-contained sentence about what landed.
Feature-detect it: no ListAgents, or no peer listed, means carry on exactly as before and note the change in your own summary. It isn't available in every environment, and a session inside a container can't see one on the host. See lore/cross-session.md.
Cleanup After Merge
After /seal completes and the PR merges:
git worktree remove ../<repo-name>-<name>git branch -d feature/<name>
Obstacles
This is a thin git-worktree utility. If a worktree cannot be created (branch already exists, dirty tree), report it in prose to the caller and stop; it emits no structured upward Obstacles block.
See lore/obstacles.md.
Completion Signal
"Portal open. Worktree at <path>, branch <branch>. Start implementation or run /orchestrate."