Agent skill

Move To Worktree

by foyzulkarim in foyzulkarim/claude-lens

After /start-task: park the current clean, pushed feature branch in its own issue-numbered nested worktree (.worktrees/<issue) and return the primary checkout to current main, so the next parallel…

MITAuto-check: notesDevelopment

Install Move To Worktree

skills CLI
$ npx skills add foyzulkarim/claude-lens --skill move-to-worktree -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install foyzulkarim/claude-lens move-to-worktree --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/foyzulkarim/claude-lens.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/move-to-worktree .claude/skills/move-to-worktree && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
move-to-worktree
GitHub stars
250
Token cost
~663 tokens
SKILL.md length
298 words
Files
2
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

After /start-task: park the current clean, pushed feature branch in its own issue-numbered nested worktree (.worktrees/<issue) and return the primary checkout to current main, so the next parallel…

  • Works in 5 steps: Hard-stops unless run in the primary… → Pushes any local-only commits, checks… → git worktree add .worktrees/ — nested… → …
  • The user says to move the branch
  • SKILL.md covers Run (1 bash call), Report and You Must NOT
  • Runs Shell scripts from its folder; calls npm, bash and git

What it does

Move To Worktree is an agent skill from foyzulkarim/claude-lens. After /start-task: park the current clean, pushed feature branch in its own issue-numbered nested worktree (.worktrees/<issue) and return the primary checkout to current main, so the next parallel lane can start. Writes the lane's port base and runs npm ci in the worktree. Use when the user says to move the branch or task to a worktree or open a parallel lane.

Its SKILL.md is about 660 tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `move-to-worktree.sh`).

It sits in Development, covering Git worktrees. It works with npm and Git. The repository describes itself as: A local dashboard for visualizing your Claude Code usage — sessions, token costs, cache performance, tool calls, and daily breakdowns. The licence is MIT.

When your agent uses it

  • The user says to move the branch
  • Task to a worktree
  • Open a parallel lane

Example prompts

  • “/move-to-worktree”

Requirements

  • A Bash shell

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Hard-stops unless run in the primary checkout, on a task branch
  2. Pushes any local-only commits, checks out and fast-forwards main (this must
  3. git worktree add .worktrees/ — nested inside the repo root
  4. Writes the lane's port block to /.env.local (gitignored)
  5. Runs npm ci in the worktree (per-worktree node_modules; also wires

What it can do on your machine

Read from SKILL.md and the folder at commit 7937ea1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • npm
    • bash
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm and git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Move To Worktree loads about 663 tokens when it runs. Until then it costs about 95 tokens; SKILL.md has 298 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~95
When it runs · the whole SKILL.md, loaded when a task matches
~663

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:31
    tes the lane's port block to `<worktree>/.env.local` (gitignored):

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from foyzulkarim/claude-lens at commit 7937ea1, republished under its MIT licence (© foyzulkarim). 298 words, ~663 tokens.

Download SKILL.mdSave it as .claude/skills/move-to-worktree/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
move-to-worktree
description
After /start-task: park the current clean, pushed feature branch in its own issue-numbered nested worktree (.worktrees/<issue#>) and return the primary checkout to current main, so the next parallel lane can start. Writes the lane's port base and runs npm ci in the worktree. Use when the user says to move the branch or task to a worktree or open a parallel lane.

Move-to-Worktree

Companion to /start-task for parallel Phase 4 lanes (see specs/claude-lens-phase4-parallelization.md). /start-task leaves the primary checkout on the new feature branch; this skill moves that branch into its own worktree and puts the primary back on main — one worktree + one branch + one Claude session per in-flight issue.

Run (1 bash call)

bash
bash {base_directory}/move-to-worktree.sh

No arguments — it operates on the branch currently checked out. The script:

  1. Hard-stops unless run in the primary checkout, on a task branch ({type}/{issue#}/{slug}), with a clean tree and its matching origin/ upstream set — i.e. exactly the state /start-task leaves behind.
  2. Pushes any local-only commits, checks out and fast-forwards main (this must happen before the worktree is created — git refuses to check out a branch in two places).
  3. git worktree add .worktrees/<issue#> <branch> — nested inside the repo root (gitignored), never a ../ sibling. The context file specs/context/<issue#>.md travels with the branch (it's committed).
  4. Writes the lane's port block to <worktree>/.env.local (gitignored): CLAUDE_LENS_PORT_BASE = 4128 + 10 × issue# — backend = base, Vite = base+1, E2E = base+2, Storybook = base+3. Issue-derived, so lanes cannot collide.
  5. Runs npm ci in the worktree (per-worktree node_modules; also wires the Husky pre-push hook so npm run verify gates pushes from this lane).

Non-zero exit → hard-stop, print stderr verbatim.

Report

The script's summary block (worktree path, branch, ports), plus: "Open a new Claude session in the worktree and continue the pipeline there (/plan-architecture / /implement → /review → /commit → PR with Closes #N)."

When the PR has squash-merged, /finish-worktree <issue#> (run back in the primary) does the teardown.

You Must NOT

  • Run the underlying git commands yourself — the script owns all mutation.
  • Stash, discard, or commit anything to satisfy the clean-tree check — hard-stop instead.
  • Move a branch whose upstream is ahead or does not match origin/<branch>.
  • Create the worktree while the primary is still on the feature branch.

© foyzulkarim, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .claude/skills/move-to-worktree of foyzulkarim/claude-lens.

  • SKILL.md
  • move-to-worktree.sh

Open the folder on GitHubat commit 7937ea1

Compare with similar skills

Move To Worktree next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Move To Worktree compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Move To Worktree this skillfoyzulkarim/claude-lens250—~663Automated safety check: NotesMIT
Squad Git Branching Workflowmicrosoft/waza1.4k4 repos~1.5kAutomated safety check: PassMIT
Cabloy Worktree Environmentcabloy/cabloy982—~2.9kAutomated safety check: NotesMIT
Git PR Workflowandymai/brepjs115—~2.9kAutomated safety check: PassApache-2.0
Qv PR Testtetherto/qvac683—~4.2kAutomated safety check: PassApache-2.0
Devcontainer Devstacklok/toolhive-studio170—~3.8kAutomated safety check: NotesApache-2.0

Similar skills

  • Official

    Dev-first branching model for the Squad project: feature work branches from dev, issue branches follow a naming rule and parallel issues use git worktrees.

    1.4k GitHub starsUsed in 4 repos~1.5k tokens
    DevelopmentAuto-check passed
  • This skill must be used only when the user explicitly invokes /cabloy-worktree-environment or explicitly asks to perform the named Cabloy worktree-environment setup.

    982 GitHub stars~2.9k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Git PR Workflow

    andymai/brepjs

    This skill should be used when committing, pushing, branching, or merging in the brepjs repository — when a task involves "pre-commit hook failed" (which tier ran, how to bypass), "commit rejected…

    115 GitHub stars~2.9k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Qv PR Test

    tetherto/qvac

    Plan and run local PR validation for tetherto/qvac PRs. An agent skill from tetherto/qvac.

    683 GitHub stars~4.2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Devcontainer Dev

    stacklok/toolhive-studio

    Spin up and interact with ToolHive Studio's containerized dev environment (Xvfb + noVNC + DinD).

    170 GitHub stars~3.8k tokensUpdated yesterday
    Agent WorkflowsAuto-check: notes
  • Using Git Worktrees

    aaddrick/claude-pipeline

    A skill your agent uses when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees in .worktrees/

    130 GitHub stars~1.3k tokensUpdated 7 mo ago
    Agent WorkflowsAuto-check passed

More from foyzulkarim/claude-lens

  • Create Issue

    foyzulkarim/claude-lens

    File GitHub issues for the claude-lens project with the right shape for the work type — plan tasks from specs/claude-lens-plan.md, Phase 4 page tasks, spikes, bugs, enhancements, chores.

    250 GitHub stars~2.4k tokensUpdated 2 mo ago
    Auto-check passed
  • Archive Issue

    foyzulkarim/claude-lens

    Retire a closed issue's working artifacts out of specs/ into the GitHub wiki — use when the user asks to archive a finished issue, empty out specs/ for a done task, or move an issue's…

    250 GitHub stars~2.8k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Move To Worktree

What does Move To Worktree do?

After /start-task: park the current clean, pushed feature branch in its own issue-numbered nested worktree (.worktrees/<issue) and return the primary checkout to current main, so the next parallel…. Move To Worktree is an agent skill from foyzulkarim/claude-lens.worktrees/<issue) and return the primary checkout to current main, so the next parallel lane can start.

When should I use Move To Worktree?

Move To Worktree fits situations like: the user says to move the branch; task to a worktree; open a parallel lane.

How do I install Move To Worktree in Claude Code?

Run `npx skills add foyzulkarim/claude-lens --skill move-to-worktree -a claude-code`. Or copy the skill folder (.claude/skills/move-to-worktree in foyzulkarim/claude-lens) into .claude/skills/move-to-worktree in your project. Claude Code loads it when a task matches its description.

How do I install Move To Worktree in Codex?

Run `npx skills add foyzulkarim/claude-lens --skill move-to-worktree -a codex`. Or copy the skill folder (.claude/skills/move-to-worktree in foyzulkarim/claude-lens) into .agents/skills/move-to-worktree in your project. Codex loads it when a task matches its description.

Can I use Move To Worktree in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add foyzulkarim/claude-lens --skill move-to-worktree -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/move-to-worktree, .gemini/skills/move-to-worktree, .github/skills/move-to-worktree and .opencode/skills/move-to-worktree in your project.

What does Move To Worktree need to run?

Going by SKILL.md and its folder, Move To Worktree needs a shell for the scripts in its folder and the command-line tools its instructions call (npm, bash and git). Our summary lists: A Bash shell.

Does Move To Worktree access the network?

SKILL.md contains no URLs. Its commands use npm and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Move To Worktree safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Move To Worktree use?

Move To Worktree is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Move To Worktree use?

About 663 tokens (SKILL.md is roughly 2.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Move To Worktree?

Skills that share tags, products or a category with Move To Worktree: Squad Git Branching Workflow (microsoft/waza, 1.4k stars), Cabloy Worktree Environment (cabloy/cabloy, 982 stars), Git PR Workflow (andymai/brepjs, 115 stars) and Qv PR Test (tetherto/qvac, 683 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Move To Worktree?

foyzulkarim (a GitHub user) maintains it in foyzulkarim/claude-lens, which has 250 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on August 5, 2026.

Source: foyzulkarim/claude-lens on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.