Ia Git Worktree logo

Ia Git Worktree

Community
iliaal
ia-git-worktree

Manage Git worktrees for isolated parallel development. Use when creating, listing, switching, or cleaning up git worktrees, or when needing isolated branches for concurrent reviews or feature work.

Overview

Publisheriliaal
Repositorywhetstone
Skill nameia-git-worktree
Stars
36
Forks
5
Bundled files
7
LicenseMIT
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.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Ia Git Worktree 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/iliaal/whetstone/tree/master/plugins/whetstone/skills/ia-git-worktree
  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/iliaal/whetstone.git /tmp/whetstone
mkdir -p .claude/skills
cp -r /tmp/whetstone/plugins/whetstone/skills/ia-git-worktree .claude/skills/ia-git-worktree
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ia Git Worktree 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 Ia Git Worktree 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 Ia Git Worktree 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.

Git worktree manager

GATE: If the task runs inside an existing worktree (a worktree path is given and no create/remove/switch is requested), none of the creation flow applies: work in place and skip this skill. To check: git rev-parse --show-toplevel appears as a linked entry in git worktree list.

Working rules

  • Preserve other sessions' branches, files, and staged work (see Ownership).
  • Verify dependencies resolve first-party code from the intended worktree.
  • Keep merge, push, and cleanup within user authorization; report the exact exercised checkout and resulting commit.

Always use the manager script

Never call git worktree add directly; always use the worktree-manager.sh script.

The manager handles setup:

  1. Copies .env, .env.local, .env.test, etc. from the main checkout, only when the base is the default branch or a local branch that already contains the fetched commit (a branch that exists only on origin gets none); it never overwrites or follows an existing file or symlink in the new tree
  2. Ensures .worktrees is in the main checkout's .gitignore
  3. Creates consistent directory structure
  4. After creation, install dependencies if detected: package.json → npm install, composer.json → composer install, pyproject.toml → pip install -e ., go.mod → go mod download

Untrusted bases (PR heads, fork or origin-only branches, third-party code): create with --no-env, never copy-env into the tree, and keep credentials out of its commands. Skip installs; if needed, disable lifecycle scripts and plugins (npm ci --ignore-scripts, composer install --no-scripts --no-plugins) and never pip install -e ., which runs the build backend.

All commands use: bash ${CLAUDE_PLUGIN_ROOT}/skills/ia-git-worktree/scripts/worktree-manager.sh <command>. If CLAUDE_PLUGIN_ROOT is unset (non-Claude-Code harness), resolve the script relative to this skill's own directory.

Before creating worktrees, export a unique WORKTREE_SESSION_ID and retain that same value for this session's later manager calls. Example: export WORKTREE_SESSION_ID="$(python3 -I -c 'import uuid; print(uuid.uuid4())')". The manager records ownership in each new worktree's Git metadata. Creation without a session ID works, but manager cleanup then refuses that tree; never adopt a previous session's ID to bypass ownership.

The manager script fetches <base> from origin into an invocation-private ref, resolves that commit, and creates the branch from its SHA, even when origin/<base> is absent or stale or another checkout fetches concurrently. It removes only its private ref and never checks out <base> in the caller's working tree. If the fetch fails (offline, no remote), it resolves the local <base> instead. PR review: pass the fetched PR head as <base>, then verify its SHA (workflow-examples.md). Details: troubleshooting.md.

Commands

CommandDescriptionExample
create [--no-env] <branch> [from]Create worktree + branch (default: from main)...worktree-manager.sh create feature-login
list / lsList all worktrees with status...worktree-manager.sh list
switch <name> / goPrint the registered worktree's absolute path; the caller applies it as workdirtarget=$(...worktree-manager.sh switch feature-login)
copy-env <name>Copy .env files to existing worktree...worktree-manager.sh copy-env feature-login
cleanup <name> [...] / cleanConfirm removal of named, session-owned, clean worktrees...worktree-manager.sh cleanup feature-login

Run commands with env -C "$target" <command> or the harness workdir argument. A child script cannot change the caller's working directory. Listing and name resolution work from any main or linked checkout, including subdirectories.

Cleanup refuses the current checkout, another session's tree, and tracked, untracked, or ignored files. Auto-copied .env files and installed dependencies therefore require explicit user-managed disposition before cleanup. Confirm no process uses the named trees; the manager cannot detect every external reader. Git's normal removal safeguards remain enabled, including locked-tree refusal. Do not force deletion or suppress failures to finish cleanup.

Safety Verification

With a main checkout, verify .worktrees is ignored before creation:

bash
# Verify .worktrees is ignored (should output ".worktrees")
git check-ignore .worktrees || echo "WARNING: .worktrees not in .gitignore"

If not ignored, add it to .gitignore before proceeding.

Before any baseline suite or migration, apply ia-verification-before-completion's effective-target preflight. Resolve worktree environment/configuration overlays; verify disposable database and service targets, never the dev database. Copied .env files do not prove isolation. Without verified disposable targets, stop before tests. Then run the suite or its fastest relevant subset to establish a clean baseline before implementation.

Ownership

  • One writer per worktree. Treat every git worktree list entry not created in the current session as read-only; a tree left from a previous round is not the current session's either. Reuse is most tempting exactly where it is most dangerous: an existing tree already has dependencies and env wired up, and another session may be running a suite in it.
  • Do not mutate a tree while the current session's suite runs there. Test runners load source files as they reach them, so a mid-run edit produces a mass-failure result that looks exactly like a real regression.
  • A failure burst that contradicts a claim is a harness hypothesis, not a conclusion. Do not record or report the self-inflicted attribution until a re-run on a tree just asserted clean (git status --short empty) has returned.
  • When a mutation is unavoidable, assert the restore (grep the token back to its original count, plus git status --short) rather than trusting git checkout --.
  • One checkout has one index: a bare commit includes unrelated staged entries, while git commit -- <paths> records complete working-tree files, including caller or peer hunks. Use a pathspec commit only after establishing whole-file ownership of every selected change. For mixed hunks, commit the attributable patch in a clean session-owned checkout while preserving the caller's HEAD, index, and files. Inspect the exact proposed and committed patches, not only filenames or --stat; follow commit-ownership.md.
  • Never use HEAD: in a git -C push. Resolve the SHA in the edited worktree, push it explicitly, and confirm with git ls-remote; a lease cannot catch selection of another checkout's HEAD. Details: commit-ownership.md.
  • Never git stash for red/green: linked worktrees share one stash stack. Use the patch-file cycle and stash recovery in commit-ownership.md.
  • Answer branch questions from refs (rev-parse <branch>), not a worktree's HEAD, which other sessions can move; see commit-ownership.md.

Use env -C <worktree> <cmd> for every command, never cd. A shell's cwd persists across calls, so one cd <repo-root> for an unrelated reason silently relocates every later command: probe files get written into the shared main tree and run against its bytes, and the tidy-up reflex git checkout -- <path> becomes a write aimed at the wrong tree. The git -C habit does not generalize: interpreters, test runners, linters, and a heredoc cat > all take the cwd. Have any probe print the tree it ran in.

Verify

  • git worktree list shows the new entry
  • .worktrees is ignored, or inside the bare common directory
  • Dependencies installed in the worktree (trusted bases; untrusted bases follow the rules above)
  • Baseline test suite passes in the worktree

References

Task-specific references

Read the relevant reference before implementing or reviewing the matching behavior:

  • For dependency provenance, environment adaptation, review/work workflows, branch completion, or hooks: worktree-integration.md.

Existing specialized references, when the corresponding topic applies:

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ia Git Worktree AI skill do?

Manage Git worktrees for isolated parallel development. Use when creating, listing, switching, or cleaning up git worktrees, or when needing isolated branches for concurrent reviews or feature work.

Why use Ia Git Worktree on TypingMind?

Because you install it once and use it with any model. Ia Git Worktree 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 Ia Git Worktree in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/iliaal/whetstone/tree/master/plugins/whetstone/skills/ia-git-worktree. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ia Git Worktree?

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 Ia Git Worktree?

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

Is the Ia Git Worktree AI skill free?

Yes. It is published on GitHub by iliaal under the MIT license. 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 👇