Agent skill

But

by gitbutlerapp in gitbutlerapp/grit

Commit, push, branch, and manage version control with GitButler.

MITAuto-check passedDevelopment

Install But

skills CLI
$ npx skills add gitbutlerapp/grit --skill but -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install gitbutlerapp/grit but --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/gitbutlerapp/grit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/gitbutler .claude/skills/but && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
but
GitHub stars
538
Token cost
~1.9k tokens
SKILL.md length
961 words
Files
4 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Commit, push, branch, and manage version control with GitButler.

  • Works in 5 steps: Use but for all write operations. Never… → Always add --status-after to mutation… → Use CLI IDs from but status -fv / but… → …
  • : commit my changes
  • SKILL.md covers Non-Negotiable Rules, Core Flow, Command Patterns and Task Recipes, plus 2 more sections
  • Calls git

What it does

But is an agent skill from gitbutlerapp/grit. Commit, push, branch, and manage version control with GitButler. Use for: commit my changes, check what changed, create a PR, push my branch, view diff, create branches, stage files, edit commit history, squash commits, amend commits, undo commits, pull requests, merge, stash work. Replaces git - use 'but' instead of git commit, git status, git push, git checkout, git add, git diff, git branch, git rebase, git stash, git merge. Covers all git, version control, and source control operations.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/concepts.md`, `references/examples.md` and `references/reference.md`).

It sits in Development, covering Git workflow. It works with Git. The repository describes itself as: Reimplementing Git in Rust. Like a boss. The licence is MIT.

When your agent uses it

  • : commit my changes
  • Check what changed
  • Create branches
  • Edit commit history

Example prompts

  • “/but”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Use but for all write operations. Never run git add, git commit, git push, git checkout, git merge, git rebase, git stash, or git…
  2. Always add --status-after to mutation commands.
  3. Use CLI IDs from but status -fv / but diff / but show; never hardcode IDs.
  4. Start with but status -fv before mutations so IDs and stack state are current.
  5. Create a branch for new work with but branch new when needed.

What it can do on your machine

Read from SKILL.md and the folder at commit cb1d966. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

But loads about 1.9k tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 125 tokens; SKILL.md has 961 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~125
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~13k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from gitbutlerapp/grit at commit cb1d966, republished under its MIT licence (© gitbutlerapp). 961 words, ~1,910 tokens.

Download SKILL.mdSave it as .claude/skills/but/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
but
description
Commit, push, branch, and manage version control with GitButler. Use for: commit my changes, check what changed, create a PR, push my branch, view diff, create branches, stage files, edit commit history, squash commits, amend commits, undo commits, pull requests, merge, stash work. Replaces git - use 'but' instead of git commit, git status, git push, git checkout, git add, git diff, git branch, git rebase, git stash, git merge. Covers all git, version control, and source control operations.
version
0.5.2000
author
GitButler Team

GitButler CLI Skill

Use GitButler CLI (but) as the default version-control interface.

Non-Negotiable Rules

  1. Use but for all write operations. Never run git add, git commit, git push, git checkout, git merge, git rebase, git stash, or git cherry-pick. If the user says a git write command, translate it to but and run that.
  2. Always add --status-after to mutation commands.
  3. Use CLI IDs from but status -fv / but diff / but show; never hardcode IDs.
  4. Start with but status -fv before mutations so IDs and stack state are current.
  5. Create a branch for new work with but branch new <name> when needed.

Core Flow

Every write task should follow this sequence.

bash
# 1. Inspect state and gather IDs
but status -fv

# 2. If new branch needed:
but branch new <name>

# 3. Edit files (Edit/Write tools)

# 4. Refresh IDs if needed
but status -fv

# 5. Perform mutation with IDs from status/diff/show
but <mutation> ... --status-after

Command Patterns

  • Commit: but commit <branch> -m "<msg>" --changes <id>,<id> --status-after
  • Commit + create branch: but commit <branch> -c -m "<msg>" --changes <id> --status-after
  • Amend: but amend <file-id> <commit-id> --status-after
  • Reorder commits: but move <source-commit-id> <target-commit-id> --status-after (commit IDs, not branch names)
  • Stack branches: but move <branch-name-or-id> <target-branch-name-or-id> --status-after (branch names or branch CLI IDs)
  • Tear off a branch: but move <branch-name-or-id> zz --status-after (zz = unassigned; branch name or branch CLI ID)
  • Push: but push or but push <branch-id>
  • Pull: but pull --check then but pull --status-after

Task Recipes

Commit files
  1. but status -fv
  2. Find the CLI ID for each file you want to commit.
  3. but commit <branch> -m "<msg>" --changes <id1>,<id2> --status-after Use -c to create the branch if it doesn't exist. Omit IDs you don't want committed.
  4. Check the --status-after output for remaining uncommitted changes. If the file still appears as unassigned or assigned to another branch after commit, it may be dependency-locked. See "Stacked dependency / commit-lock recovery" below.
Amend into existing commit
  1. but status -fv (or but show <branch-id>)
  2. Locate file ID and target commit ID.
  3. but amend <file-id> <commit-id> --status-after
Reorder commits

but move supports both commit reordering and branch stack operations. Use commit IDs when reordering commits.

  1. but status -fv
  2. but move <commit-a> <commit-b> --status-after — uses commit IDs like c3, c5
  3. Refresh IDs from the returned status, then run the inverse: but move <commit-b> <commit-a> --status-after
Stack existing branches

To make one existing branch depend on (stack on top of) another, use top-level move:

bash
but move feature/frontend feature/backend

This moves the frontend branch on top of the backend branch in one step.

DO NOT use uncommit + branch delete + branch new -a to stack existing branches. That approach fails because git branch names persist even after but branch delete. Always use but move <branch> <target-branch>.

To unstack (make a stacked branch independent again):

bash
but move feature/logging zz

Note: branch stack/tear-off operations use branch names (like feature/frontend) or branch CLI IDs, while commit reordering uses commit IDs (like c3). Do NOT use but undo to unstack — it may revert more than intended and lose commits.

Stacked dependency / commit-lock recovery

A dependency lock occurs when a file was originally committed on branch A, but you're trying to commit changes to it on branch B. Symptoms:

  • but commit succeeds but the file still appears in unassignedChanges in the --status-after output
  • The file shows as "unassigned" instead of being staged to any branch

Recovery: Stack your branch on the dependency branch, then commit:

  1. but status -fv — identify which branch originally owns the file (check commit history).
  2. but move <your-branch-name> <dependency-branch-name> — stack your branch on the dependency. Uses full branch names, not CLI IDs.
  3. but status -fv — the file should now be assignable. Commit it.
  4. but commit <branch> -m "<msg>" --changes <id> --status-after

If but move <branch> <target-branch> fails: Do NOT try uncommit, squash, or undo to work around it — these will leave the workspace in a worse state. Instead, re-run but status -fv to confirm both branches still exist and are applied, then retry with exact branch names from the status output.

Show full SKILL.md (329 more words)Show less
Resolve conflicts after reorder/move

NEVER use git add, git commit, git checkout --theirs, git checkout --ours, or any git write commands during resolution. Only use but resolve commands and edit files directly with the Edit tool.

If but move causes conflicts (conflicted commits in status):

  1. but status -fv — find commits marked as conflicted.
  2. but resolve <commit-id> — enter resolution mode. This puts conflict markers in the files.
  3. Read the conflicted files to see the <<<<<<< / ======= / >>>>>>> markers.
  4. Edit the files to resolve conflicts by choosing the correct content and removing markers.
  5. but resolve finish — finalize. Do NOT run this without editing the files first.
  6. Repeat for any remaining conflicted commits.

Common mistakes: Do NOT use but amend on conflicted commits (it won't work). Do NOT skip step 4 — you must actually edit the files to remove conflict markers before finishing.

Git-to-But Map

gitbut
git statusbut status -fv
git add + git commitbut commit ... --changes ...
git checkout -bbut branch new <name>
git pushbut push
git rebase -ibut move, but squash, but reword
git rebase --ontobut move <branch> <new-base>
git cherry-pickbut pick

Notes

  • Prefer explicit IDs over file paths for mutations.
  • --changes accepts comma-separated values (--changes a1,b2) or repeated flags (--changes a1 --changes b2), not space-separated.
  • Read-only git inspection (git log, git blame, git show --stat) is allowed.
  • After a successful --status-after, don't run a redundant but status -fv unless you need new IDs.
  • Use but show <branch-id> to see commit details for a branch, including per-commit file changes and line counts.
  • Per-commit file counts: but status does NOT include per-commit file counts. Use but show <branch-id> or git show --stat <commit-hash> to get them.
  • Avoid --help probes; use this skill and references/reference.md first. Only use --help after a failed attempt.
  • Run but skill check only when command behavior diverges from this skill, not as routine preflight.
  • For command syntax and flags: references/reference.md
  • For workspace model: references/concepts.md
  • For workflow examples: references/examples.md

© gitbutlerapp, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in .cursor/skills/gitbutler of gitbutlerapp/grit.

  • SKILL.md
  • references/concepts.md
  • references/examples.md
  • references/reference.md

Open the folder on GitHubat commit cb1d966

Compare with similar skills

But next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

But compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
But this skillgitbutlerapp/grit538—~1.9kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Code Design Rationale Investigatorcursor/plugins10k9 repos~2.6kAutomated safety check: PassNone
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Migrate Internal Package into GhostTryGhost/Ghost55k—~3.8kAutomated safety check: PassMIT
Create Pull Requestcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Official

    Digs into why code is shaped the way it is by checking git history, pull requests and connected tools in parallel, then reporting a cited read on the tradeoffs.

    10k GitHub starsUsed in 9 repos~2.6k tokens
    DevelopmentAuto-check passed
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    55k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

    70k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Git Merge Conflict Resolver

    tailcallhq/forgecode

    Resolves Git merge conflicts with a plan-first workflow that keeps both sides' intent, regenerates lock files and backs up deleted-but-modified files.

    7.6k GitHub starsUsed in 1 repo~4.5k tokens
    DevelopmentAuto-check passed

Works with

Categories

Questions about But

What does But do?

Commit, push, branch, and manage version control with GitButler. But is an agent skill from gitbutlerapp/grit. Commit, push, branch, and manage version control with GitButler.

When should I use But?

But fits situations like: : commit my changes; check what changed; create branches; edit commit history.

How do I install But in Claude Code?

Run `npx skills add gitbutlerapp/grit --skill but -a claude-code`. Or copy the skill folder (.cursor/skills/gitbutler in gitbutlerapp/grit) into .claude/skills/but in your project. Claude Code loads it when a task matches its description.

How do I install But in Codex?

Run `npx skills add gitbutlerapp/grit --skill but -a codex`. Or copy the skill folder (.cursor/skills/gitbutler in gitbutlerapp/grit) into .agents/skills/but in your project. Codex loads it when a task matches its description.

Can I use But in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add gitbutlerapp/grit --skill but -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/but, .gemini/skills/but, .github/skills/but and .opencode/skills/but in your project.

What does But need to run?

Going by SKILL.md and its folder, But needs the command-line tools its instructions call (git).

Does But access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is But safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does But use?

But is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does But use?

About 1.9k tokens (SKILL.md is roughly 7.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 11k tokens, read only when the agent opens those files.

What are the alternatives to But?

Skills that share tags, products or a category with But: Finishing a Development Branch (obra/superpowers, 296k stars), Code Design Rationale Investigator (cursor/plugins, 10k stars), Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars) and Migrate Internal Package into Ghost (TryGhost/Ghost, 55k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains But?

gitbutlerapp (a GitHub organization) maintains it in gitbutlerapp/grit, which has 538 GitHub stars. The repository was last updated on October 8, 2026.

Source: gitbutlerapp/grit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.