/remote-gateway:worktreefrom remote-gateway
Environment-capable git worktree isolation for ByteDesk gateway. Use when creating, claiming, or pruning worktrees; launching a parallel agent tab; or when terminals share one dirty tree. Delegates to native Grok/Claude --worktree; Codex/Kimi/shell get a unique git cwd.
Ships in remote-gateway. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Default product launch does not isolate. Grok/Claude/Codex/Kimi start in the project CWD unless Isolate is checked, “+ isolated tab” is used, or count
- Creating a tree must not retarget the project desk or other tabs.
| Environment | How you know | Isolation |
|---|---|---|
| Grok | grok CLI, Grok TUI, isolation: worktree | Native. grok --worktree=<name> or spawn isolation: "worktree". Trees live under ~/.grok/worktrees/. List: grok worktree list --json. GC: grok worktree gc --max-age 7d. |
| Claude Code | claude CLI | Native. claude --worktree [name] (-w). Unique name per tab. Community using-git-worktrees is not SoT here — it reuses .worktrees/<BRANCH> and shares trees. |
| Codex | codex CLI | No --worktree. Tightest API is --cd: create a unique git worktree, then codex --cd <path> (gateway does this automatically). |
| Kimi | kimi CLI | No --worktree / --cd. Unique git cwd is the workspace; optional --add-dir for extra trees. |
| Pi / shell | pi / Ghostty | Unique git cwd. |
Name every isolated tree iso-<slug>-<id> or feat/<ticket>-<tab8> — never a
bare branch name if that branch is already checked out.
--worktree only when the operator asked to isolate.--worktree name per tab. Community using-git-worktrees is not SoT.scripts/lib/worktree-bootstrap.sh after git worktree add
to <main>/.worktrees/<slug>-<id>. That helper is in the gateway repo,
not in this plugin.setActiveWorktree / switch the Projects desk as a side
effect of creating a tree.BYTEDESK_EMOTE_GATEWAY_SOURCE_DIR points at another checkout, deploy-safe
prefers this tree. Do not export SOURCE_DIR to a sibling worktree.mk-worktrees.sh) are one tree per goal, not per
terminal. If a goal tree is busy, mint <id>-<n> — do not reuse.# Status: trees × dirty × this cwd
git worktree list
git rev-parse --show-toplevel
git status -sb
# Grok native
grok --worktree=iso-feat-x
grok worktree list --json
# Claude native
claude --worktree iso-feat-x
# Fallback (codex/kimi/shell) from repo root
slug=iso-feat-x
dest="$(git rev-parse --show-toplevel)/.worktrees/${slug}-$(openssl rand -hex 3)"
git worktree add -b "$slug" "$dest" || git worktree add -b "${slug}-x" "$dest"
bash "$(git rev-parse --show-toplevel)/scripts/lib/worktree-bootstrap.sh" "$dest"
cd "$dest"
/commit detects a linked worktree with the commit skill's
scripts/worktree-after-commit.sh (the directory that contains
skills/commit/SKILL.md). After a successful commit it offers to merge
this branch into the main checkout’s branch and remove the tree. Authorize
in the same turn with “commit and merge” / “land and cleanup”, or confirm
after the offer.
# From the isolation tree, after commit is clean
ROOT="${GROK_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}"
COMMIT_DIR="${ROOT:+$ROOT/skills/commit}"
COMMIT_DIR="${COMMIT_DIR:-<directory containing skills/commit/SKILL.md>}"
"$COMMIT_DIR/scripts/worktree-after-commit.sh" detect
"$COMMIT_DIR/scripts/worktree-after-commit.sh" land # merge + remove
Grok-native trees (~/.grok/worktrees/…) also run grok worktree rm on cleanup.
.worktrees/<BRANCH> from the community using-git-worktrees skill
when another terminal is already there.git checkout develop on main when another worktree holds it — open that
tree or create a new one from origin/develop.This plugin copy lives next to this SKILL.md. The gateway repo also keeps setup/skills/worktree/ for its in-repo skill links.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub bytedeskai/bytedesk-marketplace --plugin remote-gateway17 skills in this plugin
/commitCommit and push repo changes with human-only authorship, Keep a Changelog update, and embedded changelog sync. After a successful commit in a linked git worktree, offer to merge into the main checkout and remove the tree (Grok/Claude/Codex isolation). Never attributes coding agents or external co-authors. Use when the user runs /commit, says "commit", "commit and push", "land the changes", "update changelog and push", or wants a clean push of the current worktree.
/cutoverSafe production cutover for bytedesk-remote-gateway via this skill's bundled scripts/deploy-safe.sh, only from the develop branch. DEFAULT always restarts: preflight → stage → restart-cutover → postflight (do not stage-only or ask for restart). Use FORCE_RESTART=1 when stage is UNCHANGED but bounce is still required. Also after every completed implementation task that changes gateway/SPA runtime. After feature cutover PASS, ask the operator to /commit (do not auto-commit). Triggers: /cutover, "safe cutover", "deploy-safe", "stage binary" (stage-only only if user says stage only / no restart), "restart cutover", FORCE_RESTART, postflight healthz.
/desktop-depsCheck desktop/agents profile dependencies for the gateway on Linux, macOS, and Windows. Use when desktop profile, VNC, Xvfb, or ttyd is missing.
Other plugins' skills for the same job