Skip to content
Agentmart
Submit a tool

worktree

Manage Git Worktrees and Isolate Branches for parallel agent execution.

Skill by sapientcoffee

IndexedApache-2.0
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/sapientcoffee-worktree

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Manage Git Worktrees and Isolate Branches for parallel agent execution.

Use cases: agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/worktree

What's inside

Skill name
worktree
Description
Manage Git Worktrees and Isolate Branches for parallel agent execution.
License
Apache-2.0
Instructions
71 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

<!--
Copyright 2026 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Brew Worktree Skill

This skill orchestrates Git Worktrees and Isolate Branches to provide robust, concurrent workspace isolation for parallel developer agents within the barista swarm.

## 1. Objective
To prevent file collision and state leakage during parallel agent runs by creating dedicated git worktrees for separate tasks, then cleanly merging and pruning them upon completion or cleaning them up during startup reconciliation.

## 2. Workflow Steps

1. **Parse Input Parameters**:
   - Verify that `--action` is provided (`create`, `merge`, or `clean`).
   - For `create` or `merge` actions, verify that `--task <id>` is provided.
   - For `create` action, verify that `--slug <slug>` is provided.

2. **Execute Lifecycle Action**:
   - **`create` Action**:
     - Check out a new isolated git branch for the specified task.
     - Add a git worktree mapping to `.worktrees/task-<id>-<slug>/` inside the workspace.
     - Prepare files and ensure `.worktrees/` is ignored (e.g. registered in workspace `.gitignore`).
   - **`merge` Action**:
     - Pull/merge the task branch's finalized commits back into the main development branch.
     - Handle clean merging, staging, and conflict resolution gracefully.
   - **`clean` Action**:
     - Prune the corresponding worktree paths from git list.
     - Remove any orphaned/completed worktree directories to preserve storage and restore clean state.

3. **Log & Report Telemetry**:
   - Record actions and status inside JSON logs in `plans/feature/<active-feature>/worktree_telemetry.log`.
   - Output exact details on branch created/merged, mounted path, and execution times.

## 3. Parameters and Flags

The worktree lifecycle manager accepts the following parameters:
*   `--action <create|merge|clean>` (Required): The worktree lifecycle phase to trigger.
*   `--task <id>` (Required for `create` & `merge`): The identifier of the specific task or ticket.
*   `--slug <slug>` (Required for `create`): A short URL/directory-safe string description for the task branch.

## 4. Execution Examples

### Spawning a new Isolated Worktree:
```bash
agy worktree --action create --task 456 --slug implement-auth-validation
```

### Merging and Finalizing work:
```bash
agy worktree --action merge --task 456
```

### Startup Reconciliation and Cleanup:
```bash
agy worktree --action clean
```

From sapientcoffee/bean-brewer, Apache-2.0.

More from sapientcoffee/bean-brewer

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Sep 8, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from sapientcoffee

Cite this page

worktree skill. Agent Mart. https://agentmart.dev/skills/sapientcoffee-worktree (last updated 2026-10-24)