git-branch

git-branch is a skill for Claude Code, Codex from mir-am/skills-agents-ai-coding. It costs 21 tokens per session (1,236 once invoked), scanned A, original, MIT.

A workflow for creating and switching to a Git feature branch with a descriptive name based on the current work. A feature branch is a separate line of development used to make changes before merging them into the main codebase.

In plain words
What is it for?
Use it to detect the repository’s default branch, infer a short branch name from the session and current changes, and create the branch while keeping those changes.
Why use it?
It avoids inventing branch names by hand and helps preserve local changes when creating the branch is safe.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions OpenCode.

Good fit Use it to detect the repository’s default branch, infer a short branch name from the session and current changes, and create the branch while keeping those changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mir-am/skills-agents-ai-coding/git-branch
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mir-am/skills-agents-ai-coding --skill git-branch
Clone the repo
git clone --depth 1 https://github.com/mir-am/skills-agents-ai-coding

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-branch

README.md
[![agentmods](https://agentmods.dev/badge/skills/mir-am/skills-agents-ai-coding/git-branch.svg)](https://agentmods.dev/skills/mir-am/skills-agents-ai-coding/git-branch)
Your own site
<a href="https://agentmods.dev/skills/mir-am/skills-agents-ai-coding/git-branch"><img src="https://agentmods.dev/badge/skills/mir-am/skills-agents-ai-coding/git-branch.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,236 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.01236
Opus 5 $0.00010 $0.00618
Sonnet 5 $0.00004 $0.00247
Haiku 4.5 $0.00002 $0.00124

Measured 7d ago against content hash 02030d11297c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

git-branch scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/git-branch/SKILL.md · 137 lines

How it starts

The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.

What I do

  • Detect the repository default branch from origin/HEAD, then fall back to local main, master, or develop
  • Review the current session context plus staged and unstaged git changes to infer the branch purpose
  • Generate a short branch name in <type>/<brief-description> format
  • Create and switch to the new branch while preserving local changes when safe
  • Ask the user instead of guessing when the intent or safe branching base is ambiguous

When to use me

Use this skill when the user asks to create a new git branch for the current work and wants the branch name derived from the session context and current git changes.

Prerequisites

  • git must be installed
  • Use git switch when available; if the installed Git is too old to support it, use git checkout / git checkout -b instead
  • The repository should have a detectable default branch from origin/HEAD or local main, master, or develop
  • If the current branch is not the detected default branch and the worktree is dirty, ask the user before switching branches

Default Branch Detection

  1. Check the current branch:

    git branch --show-current
    
  2. Detect the remote default branch first:

    default_branch="$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null)"
    default_branch="${default_branch#origin/}"
    
  3. If the remote default branch is unavailable, fall back in this order:

    for candidate in main master develop; do
      if git show-ref --verify --quiet "refs/heads/$candidate"; then
        default_branch="$candidate"
        break
      fi
    done
    
  4. If no default branch can be determined, stop and ask the user which branch should be used as the base.

Change Analysis

  1. Review the current agent session context and the user's latest request.
  2. Inspect the current git-visible work:
    git status --short
    git diff --cached --stat
    git diff --stat
    
  3. Prefer the user request and session goal over raw filenames when naming the branch.
  4. Use changed files and diff summaries as supporting context to infer the branch type and slug.
  5. If there are no local changes yet, derive the branch name from the session goal alone.

Read the full file on GitHub · 137 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 137 lines · 21 tokens per session scan A 02030d11297c

Subscribe to this mod's changes

git-branch is a skill published in the GitHub repository mir-am/skills-agents-ai-coding (2 stars, last pushed 4mo ago), licensed MIT. It adds 21 tokens to every session and 1,236 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.