Skip to main content
skill CX Codex

create-branch — Claude Code skill: git branches, Sentry style

Creates a git branch named the Sentry way, like feat/... or fix/.... Useful when you start work and don't want to invent a name.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add getsentry/skills --skill create-branch -a claude-code
Open on GitHub

What create-branch does

The skill figures out what you're working on and builds the branch name itself. Pass a description as an argument and that wins. Skip it and the agent reads git diff, git diff --cached and git status --short, then pulls a short summary out of the changes. With a clean tree it falls back to something like repo-maintenance or work-in-progress.

Branch type comes from a lookup table: feat for new functionality, fix for broken behavior, ref for restructuring, chore for maintenance. Twelve types in total, docs, test, ci and perf among them. The name lands as <type>/<short-description>, kebab-case, ASCII only, usually three to six words.

The base branch is picked without asking: current branch, remote, remote HEAD, then a fallback chain of main, master, current branch. On a detached HEAD it branches from the current commit. If the name is taken locally or on the remote, -2, -3 and so on get appended. It never stops for confirmation, so check the final name before you push. Switching to the default branch happens only when you ask for it.

What it helps with

  • create a branch with a meaningful name without typing one
  • classify the change type from the diff
  • pick the right base branch instead of the current one
  • dodge a name collision with an existing branch
  • start work off the default branch and move away from it

Example prompts for the agent

  • create a branch
  • create-branch add retries to the API client
  • start a branch for the pagination fix

How to install create-branch

1Skills CLI (Vercel)

npx skills add getsentry/skills --skill create-branch -a claude-code

2Manually: put the files in place

~/.claude/skills/create-branch/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/create-branch/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about create-branch

How do I install create-branch in Claude?

Run npx skills add getsentry/skills --skill create-branch -a claude-code. The skill file lands at ~/.claude/skills/create-branch/SKILL.md.

What does create-branch do?

It creates a git branch following Sentry naming conventions. The type and short description come from your argument or from the local changes in the repo.

Does it ask before creating the branch?

No. The workflow is non-interactive and does not stop for confirmation unless you explicitly ask to choose the name yourself.

Source text

SKILL.md · Apache-2.0
---
name: create-branch
description: Create a git branch following Sentry naming conventions. Use when asked to "create a branch", "new branch", "start a branch", "make a branch", "switch to a new branch", or when starting new work on the default branch.
argument-hint: '[optional description of the work]'
---

# Create Branch

Create a git branch following Sentry naming conventions.
Keep this workflow non-interactive unless the user explicitly asks to choose the name manually.

## Workflow

1. Resolve the work description:
   - If `$ARGUMENTS` is present, use it
   - Otherwise inspect:
     ```bash
     git diff
     git diff --cached
     git status --short
     ```
   - If there are local changes, derive a short description from the diff
   - If there are no local changes, use a generic description like `repo-maintenance`, `tooling-update`, or `work-in-progress`

2. Classify the branch type:

| Type | Use when |
|------|----------|
| `feat` | New functionality |
| `fix` | Broken behavior now works |
| `ref` | Behavior stays the same, structure changes |
| `chore` | Maintenance of existing tooling/config |
| `perf` | Same behavior, faster |
| `style` | Visual or formatting only |
| `docs` | Documentation only |
| `test` | Tests only |
| `ci` | CI/CD config |
| `build` | Build system |
| `meta` | Repo metadata |
| `license` | License changes |

   When unsure: use `feat` for new things, `ref` for restructuring, `chore` for maintenance.

3. Generate `<type>/<short-description>`.
   Keep `<short-description>` kebab-case, ASCII-only, and ideally 3 to 6 words.

4. Choose the base without prompting:
   ```bash
   git branch --show-current
   git remote | grep -qx origin && echo origin || git remote | head -1
   git symbolic-ref refs/remotes/<remote>/HEAD 2>/dev/null | sed 's|refs/remotes/<remote>/||' | tr -d '[:space:]'
   ```
   - If default branch detection fails, fall back to `main`, then `master`, then the current branch
   - If on a detached HEAD, branch from the current commit
   - If already on a non-default branch, branch from the current branch
   - Only switch to the default branch when the user explicitly asks

5. Avoid collisions by appending `-2`, `-3`, and so on until the name is unused locally and remotely.

6. Create the branch:
   ```bash
   git checkout -b <branch-name>
   ```
   Report the final branch name, but do not stop for confirmation.

## References

- [Sentry Branch Naming](https://develop.sentry.dev/sdk/getting-started/standards/code-submission/#branch-naming)

© getsentry · Apache-2.0 · getsentry/skills

Similar skills

All skills for Git and GitHub →

From the same set20

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor