# Branch

> Branch is an open-source agent skill for developer tools. Create, switch, list and clean up git branches with standard naming and stash support. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/tjmonsi/assist-marketplace-plugin/tree/main/plugins/assist-plugin/skills/branch
- **Repository:** https://github.com/tjmonsi/assist-marketplace-plugin
- **GitHub stars:** 11
- **License:** AGPL-3.0
- **Skill name:** branch
- **Collection:** https://github.com/tjmonsi/assist-marketplace-plugin
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill lets an agent handle everyday git branch work inside a repository. It creates feature, bugfix, release and hotfix branches that follow a fixed naming pattern, switches branches and stashes uncommitted changes when needed, and lists local and remote branches.

The most involved command is cleanup. It walks every linked worktree, including detached-HEAD ones, and removes only those whose branch or commit is already an ancestor of the default branch, whose status is clean, and which are unlocked. It then deletes the merged branches and clears the Go build cache. A dry-run mode reports what would happen without changing anything. Squash-merged and rebase-merged branches are kept, and the main worktree and protected branches such as main, master and develop are never touched.

The skill is written for git commands run through the agent's shell and uses Bash permissions for git, df, realpath and go clean. Cleanup also reports, but does not run, Rust and Gradle clean commands. The full cleanup procedure is documented in a separate reference file.

## When your agent uses it

> Manage git branches. Create feature/bugfix/release branches with standard naming, switch branches with stash support, list all branches, clean up merged worktrees and their branches, and clear the Go build cache.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/tjmonsi/assist-marketplace-plugin/tree/HEAD/plugins/assist-plugin/skills/branch)
- [Asks for: Bash(git:*), Bash(df:*), Bash(go clean:*), Bash(realpath:*)](https://github.com/tjmonsi/assist-marketplace-plugin/blob/HEAD/plugins/assist-plugin/skills/branch/SKILL.md)
- [License: AGPL-3.0](https://github.com/tjmonsi/assist-marketplace-plugin/tree/HEAD/plugins/assist-plugin/skills/branch)

## Features

- **Standard branch creation:** Creates feature, bugfix, release and hotfix branches using a consistent name pattern.
- **Switching with stash:** Switches branches and stashes uncommitted changes when the switch requires it.
- **Branch listing:** Shows all local and remote branches in the repository.
- **Worktree cleanup:** Removes finished linked worktrees that are clean, unlocked and merged into the default branch.
- **Merged branch deletion:** Deletes branches that are ancestors of the default branch after their worktrees are removed.
- **Dry-run preview:** Lists the cleanup actions and ignored files without changing the repository.
- **Go cache clearing:** Clears the Go build cache as part of the cleanup command.

## Good for

- Create a feature branch for a new login flow
- Switch to main and stash my uncommitted edits
- List all local and remote branches in this repo
- Preview which worktrees would be removed before cleaning up
- Delete branches and worktrees that were already merged
- Start a release branch for version 1.0.0

## Install

### Claude Code

This skill ships in the `assist-plugin` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add tjmonsi/assist-marketplace-plugin
/plugin install assist-plugin@assist-plugin-marketplace
```

Or copy only this skill to `~/.claude/skills/branch`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tjmonsi/assist-marketplace-plugin.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/branch &&
cp -R "$tmp/plugins/assist-plugin/skills/branch" ~/.claude/skills/branch &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/branch` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/branch` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tjmonsi/assist-marketplace-plugin.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/branch &&
cp -R "$tmp/plugins/assist-plugin/skills/branch" ~/.agents/skills/branch &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/branch` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/branch` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tjmonsi/assist-marketplace-plugin.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/branch &&
cp -R "$tmp/plugins/assist-plugin/skills/branch" ~/.cursor/skills/branch &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/branch` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/tjmonsi/assist-marketplace-plugin.git --path plugins/assist-plugin/skills/branch
```

Or copy the folder to `~/.gemini/skills/branch` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/branch`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tjmonsi/assist-marketplace-plugin.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/branch &&
cp -R "$tmp/plugins/assist-plugin/skills/branch" ~/.copilot/skills/branch &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/branch` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/tjmonsi/assist-marketplace-plugin.git
```

Then copy `assist-marketplace-plugin/plugins/assist-plugin/skills/branch` into your agent's skills folder as `branch`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does cleanup force-remove anything?

No. The skill states that cleanup never uses git worktree remove --force, git branch -D, git clean or rm -rf.

### Which branches are never deleted?

The main worktree, the current worktree, and the main, master, develop and default branches are never touched.

### Are squash-merged branches removed during cleanup?

No. Squash-merged and rebase-merged branches show as not merged and are kept.

### Can I see what cleanup would do first?

Yes. Running cleanup with --dry-run lists what would happen and changes nothing.

### How do I install Branch in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/branch to use it in all your projects, or to .claude/skills/branch in one project. Or install the assist-plugin plugin, which includes it: /plugin marketplace add tjmonsi/assist-marketplace-plugin, then /plugin install assist-plugin@assist-plugin-marketplace.

### Does Branch run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Branch?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Branch?

The closest alternatives to Branch are Git branch cleanup, Create branch, Conventional branch, Git post merge cleanup and Git workflow.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Git branch cleanup](https://ai-powered.com/skills/git-branch-cleanup): Git branch cleanup is an open-source agent skill for developer tools.
- [Create branch](https://ai-powered.com/skills/create-branch): Create branch is an open-source agent skill for developer tools.
- [Conventional branch](https://ai-powered.com/skills/conventional-branch): Conventional branch is an open-source agent skill for developer tools.
- [Git post merge cleanup](https://ai-powered.com/skills/git-post-merge-cleanup): Git post merge cleanup is an open-source agent skill for developer tools.
- [Git workflow](https://ai-powered.com/skills/git-workflow-aws-solutions): Git workflow is an open-source agent skill for developer tools.
- [Git worktree](https://ai-powered.com/skills/git-worktree): Git worktree is an open-source agent skill for developer tools.
- [Git clean worktrees](https://ai-powered.com/skills/git-clean-worktrees): Git clean worktrees is an open-source agent skill for developer tools.
- [GitHub workflow](https://ai-powered.com/skills/github-workflow): GitHub workflow is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/branch-tjmonsi
