Worktree Start logo

Worktree Start

Community
StringKe
worktree-start

进入隔离 worktree。Claude Code 调用 EnterWorktree,会话切到 .claude/worktrees/<名字>,分支为 worktree-<名字>,基线是 origin 默认分支。工作区干净且会话没用 --name 或 /rename 起名时,交互退出会删掉 worktree 和分支。没有 EnterWorktree 时用 git worktree add,会话目录不变,退出不删。用户运行 /worktree-start 或 /worktree-start <名字>,或任务需要隔离检出时使用,AI 自己调用,不交给用户。

Overview

PublisherStringKe
Repositorydotfiles
Skill nameworktree-start
Stars
93
Forks
9
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by StringKe on GitHub. Read the source before you install it.

Installation

Install the Worktree Start AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/StringKe/dotfiles/tree/main/ai/plugins/worktree/skills/worktree-start
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/StringKe/dotfiles.git /tmp/dotfiles
mkdir -p .claude/skills
cp -r /tmp/dotfiles/ai/plugins/worktree/skills/worktree-start .claude/skills/worktree-start
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Worktree Start in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Worktree Start on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Worktree Start is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

进入 worktree

用户输入 /worktree-start 或 /worktree-start <名字>,或任务需要隔离检出时,AI 直接调用本 skill 开始,不请用户代为运行。只进入隔离检出,不 commit,不 push。不使用 Claude Code agents view。

git rev-parse --show-toplevel 已在 .claude/worktrees/ 下:停下,报告路径、分支、HEAD。不再创建。

不切换主检出的当前分支,不动它的未提交改动。

名字与基线

  • 用户给了名字,且每个 / 分段只含字母、数字、点、下划线、连字符,总长不超过 64:原样使用。
  • 否则从本轮任务取一个短 slug:小写字母、数字、连字符,首尾是字母或数字,不超过 40 个字符。报告里写实际名字。
  • 主检出是 git rev-parse --path-format=absolute --git-common-dir 的父目录(该路径以 /.git 结尾)。
  • 默认分支:git symbolic-ref --short refs/remotes/origin/HEAD,取斜杠后的名字。没有这条 ref 时,远程有 main 用 main,否则用 master。
  • 在主检出执行 git fetch origin <默认分支>。
  • 目录 .claude/worktrees/<名字> 已存在就换名字,不覆盖,不复用。
  • Claude Code 还要看分支 worktree-<名字>。没有 EnterWorktree 时还要看分支 <名字>。已存在就换名字。

Claude Code

本会话有 EnterWorktree 时走这里。

调用 EnterWorktree,只传 name,不传 path。它创建并进入:

  • 目录:<主检出>/.claude/worktrees/<名字>
  • 分支:worktree-<名字>
  • 基线:worktree.baseRef 为 fresh 时是刚 fetch 的 origin/<默认分支>,不带主检出的未提交改动

进入后执行 git config --worktree worktree.plugin worktree。已有这个值就不改。

之后的读、改、测试、git 都在这个目录。先不复制 vendor/、node_modules/。要跑测试时按 /worktree-done 的验证一节再补。任务碰到 submodule 时,再 git submodule update --init <路径>。

交互会话退出时,只处理 Claude Code 自己建的 worktree:

状态退出
工作区干净,相对进入时没有新提交,会话没有 --name 或 /rename自动删除 worktree 和分支
会话起过名,或有未提交改动、新提交,或状态核对不了先问保留还是删除。选删除会连未提交改动和新提交一起去掉
claude -p不删,并留下 lock。pid 已退出时由 /worktree-done 解锁再删

要提交并快进推送到默认分支,用 /worktree-done。退出删除不会推送。

没有 EnterWorktree

Grok 和 OpenCode 走这里。本会话的工作目录不变,退出不删除。

在主检出执行:

bash
git worktree add -b <名字> .claude/worktrees/<名字> origin/<默认分支>
git -C .claude/worktrees/<名字> config --worktree worktree.plugin worktree

分支名是 <名字>。之后的读、改、测试、git 都用该目录的绝对路径。不在主检出改文件。收尾用 /worktree-done。

报告

一行:路径、分支、基线提交号、本会话是否已进入、退出会不会自动删。

Frequently asked questions

What does the Worktree Start AI skill do?

进入隔离 worktree。Claude Code 调用 EnterWorktree,会话切到 .claude/worktrees/<名字>,分支为 worktree-<名字>,基线是 origin 默认分支。工作区干净且会话没用 --name 或 /rename 起名时,交互退出会删掉 worktree 和分支。没有 EnterWorktree 时用 git worktree add,会话目录不变,退出不删。用户运行 /worktree-start 或 /worktree-start <名字>,或任务需要隔离检出时使用,AI 自己调用,不交给用户。

Why use Worktree Start on TypingMind?

Because you install it once and use it with any model. Worktree Start is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Worktree Start in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/StringKe/dotfiles/tree/main/ai/plugins/worktree/skills/worktree-start. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Worktree Start?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Worktree Start?

As many as you like. As long as a model supports skills, you can use Worktree Start with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Worktree Start AI skill free?

It is published on GitHub by StringKe. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇