Agent skill

Grit

by gitbutlerapp in gitbutlerapp/grit

Use the grit CLI for version control in Git repositories — status, diffs, commits, branches, merges, cherry-picks, fetch/pull/push and tags — with JSON output for scripts and agents.

MITAuto-check passedDevelopment

Install Grit

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

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

GitHub CLI
$ gh skill install gitbutlerapp/grit grit --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/grit-cli/src/commands .claude/skills/grit && 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
grit
GitHub stars
539
Token cost
~1.5k tokens
SKILL.md length
837 words
Files
27
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Use the grit CLI for version control in Git repositories — status, diffs, commits, branches, merges, cherry-picks, fetch/pull/push and tags — with JSON output for scripts and agents.

  • A task involves committing
  • SKILL.md covers Rules, Where am I?, Reading history and changes and Committing, plus 7 more sections
  • Runs Rust scripts from its folder; calls git
  • Syncing with a remote

What it does

Grit is an agent skill from gitbutlerapp/grit. Use the grit CLI for version control in Git repositories — status, diffs, commits, branches, merges, cherry-picks, fetch/pull/push and tags — with JSON output for scripts and agents. Use when a task involves committing, branching, syncing with a remote or reading history and grit is installed.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 26 other files.

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

  • A task involves committing
  • Syncing with a remote
  • Reading history and grit is installed

Example prompts

  • “/grit”

What it can do on your machine

Read from SKILL.md and the folder at commit 5429f7c. 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

    Ships script files (Rust, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • git

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

  • Network

    Links to these hosts (documentation or services it may open):

    • grit-scm.com

    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

Grit loads about 1.5k tokens when it runs. Until then it costs about 75 tokens; SKILL.md has 837 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~75
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

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 5429f7c, republished under its MIT licence (© gitbutlerapp). 837 words, ~1,510 tokens.

Download SKILL.mdSave it as .claude/skills/grit/SKILL.md (or your agent's skills folder). This skill also uses 26 other files; get the full folder from GitHub.
name
grit
description
Use the grit CLI for version control in Git repositories — status, diffs, commits, branches, merges, cherry-picks, fetch/pull/push and tags — with JSON output for scripts and agents. Use when a task involves committing, branching, syncing with a remote or reading history and `grit` is installed.

grit

grit is a small, opinionated Git client. It reads and writes ordinary Git repositories, so git and grit can be used on the same repository. It does not mirror Git's commands or flags: there is usually one obvious way to do each thing, and every command can answer in JSON.

This skill was generated by grit {version}. Run grit <command> --help for the exact options of the installed version.

Rules

  • Pass --json whenever you will read the result. stdout then holds exactly one JSON object; progress and prompts go to stderr.
  • Use --filter '<jq-like expr>' (with --json) to keep only what you need: grit status --json --filter '{branch, clean}'.
  • On failure the exit code is 1 and stdout is {"error": "…"}. Exit code 2 is a usage error (unknown flag or command) and has no JSON.
  • Always give grit commit a message. It never opens an editor.
  • Don't translate Git habits flag-for-flag. grit commit -a, git add -p, rebase, stash, reset and --amend don't exist here; see "What grit doesn't do".

Where am I?

console
$ grit status --json

Plain grit is the same as grit status. Keys: branch, detached, head, target (the branch your work is headed for), ahead, commits (up to ten not on the target), staged, unstaged, untracked, clean.

The target branch is the first that exists of: the target.branch config value, origin/master, origin/main, master, main. Change it with grit config target.branch origin/develop.

Reading history and changes

TaskCommand
Uncommitted changes as a diffgrit diff
The change one commit madegrit diff <commit>
A commit's message and file summarygrit show [<commit-or-branch-or-tag>]
Recent history, ten at a timegrit log, then grit log --before <next> using the next value
Commits on this branch not on the targetgrit shortlog

Revisions can be full or short ids, branch or tag names, or expressions like HEAD~2.

Committing

console
$ grit commit -m "Explain what changed and why"

grit commit stages every change first (modified, deleted and untracked files) and then commits. There is no way to commit only some files: if only part of the work belongs in this commit, finish or move the rest aside first. grit add [<path>…] stages files so you can review them in grit status, but it doesn't limit what grit commit records.

grit commit fails with "nothing to commit" on a clean tree and refuses a detached HEAD.

Branches

TaskCommand
List branchesgrit branch
Create a branch at the current commit (no switch)grit branch <name>
Create and switchgrit switch -c <name>
Switchgrit switch <name> (also grit checkout, grit co)
Delete a merged branchgrit branch -d <name>
Delete regardlessgrit branch -D <name>

grit switch, grit merge, grit pick and grit pull refuse to run with uncommitted changes. Commit first. They also refuse rather than overwrite an untracked file.

Combining work

  • grit merge <branch> fast-forwards when it can, otherwise records a merge commit. <branch> can be local or remote-tracking (origin/main).
  • grit pick <commit> applies one non-merge commit to the current branch as a new commit, keeping its author and message.
  • On a conflict both commands list the conflicting files, exit 1 and change nothing. grit can't resolve conflicts yet; to finish, run git merge <branch> (or git cherry-pick <commit>), fix the files and commit.
Show full SKILL.md (306 more words)Show less

Remotes

TaskCommand
Copy a repositorygrit clone <url> [<dir>]
List or add remotesgrit remote, grit remote add <name> <url>
Download without changing your branchgrit fetch [<remote>]
Fetch and merge the remote copy of this branchgrit pull
Publish this branch to origin under the same namegrit push
Publish all local tagsgrit push --tags

grit push never force-pushes. If the remote has commits you don't, the push is rejected (exit 1, "rejected": true); run grit pull, then push again.

URLs can be https://, ssh://, user@host:path, git://, file:// or a local path.

Tags and config

  • grit tag lists tags, grit tag <name> creates a lightweight tag at the current commit, grit tag -d <name> deletes one.
  • grit config <key> reads, grit config <key> <value> sets, grit config --unset <key> removes, grit config --list lists. Add --global for the per-user file.

Staying non-interactive

  • HTTPS GitHub: run grit auth once in an interactive session (it uses a browser device flow). After that, fetch, pull and push use the stored token. When stdin isn't a terminal, grit won't prompt to sign in; it fails with a hint instead.
  • SSH: set GIT_SSH_COMMAND='ssh -o BatchMode=yes' so a missing key or unknown host fails fast instead of waiting for input.
  • Don't run grit update in automation; it reinstalls the binary.
  • grit manager, grit upload-pack and grit receive-pack are plumbing that speaks Git protocols on stdin/stdout. Don't call them directly.

What grit doesn't do

grit has no equivalent of rebase, stash, reset, revert, commit --amend, partial staging, interactive commands, annotated or signed tags, or conflict resolution. When a task needs one of these, use git on the same repository and come back to grit afterwards.

More

© 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 26 other files in grit-cli/src/commands of gitbutlerapp/grit.

  • SKILL.md
  • add.rs
  • auth.rs
  • branch.rs
  • clone.rs
  • commit.rs
  • completions.rs
  • config.rs
  • diff.rs
  • fetch.rs
  • init.rs
  • log.rs
  • manager.rs
  • merge.rs
  • mod.rs
  • pick.rs
  • pull.rs
  • push.rs
  • remote.rs
  • serve.rs
  • shortlog.rs
  • … and 6 more

Open the folder on GitHubat commit 5429f7c

Compare with similar skills

Grit 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.

Grit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Grit this skillgitbutlerapp/grit539—~1.5kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Code Design Rationale Investigatorcursor/plugins11k9 repos~2.6kAutomated safety check: PassNone
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Migrate Internal Package into GhostTryGhost/Ghost56k—~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.

    297k 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.

    11k 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.

    56k 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

More from gitbutlerapp/grit

  • But

    gitbutlerapp/grit

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

    539 GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Grit

What does Grit do?

Use the grit CLI for version control in Git repositories — status, diffs, commits, branches, merges, cherry-picks, fetch/pull/push and tags — with JSON output for scripts and agents. Grit is an agent skill from gitbutlerapp/grit. Use the grit CLI for version control in Git repositories — status, diffs, commits, branches, merges, cherry-picks, fetch/pull/push and tags — with JSON output for scripts and agents.

When should I use Grit?

Grit fits situations like: A task involves committing; syncing with a remote; reading history and grit is installed.

How do I install Grit in Claude Code?

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

How do I install Grit in Codex?

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

Can I use Grit 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 grit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/grit, .gemini/skills/grit, .github/skills/grit and .opencode/skills/grit in your project.

What does Grit need to run?

Going by SKILL.md and its folder, Grit needs Rust for the scripts in its folder and the command-line tools its instructions call (git).

Does Grit access the network?

SKILL.md names 1 domain. As links in the text: grit-scm.com. This is read from the text; nothing was executed.

Is Grit 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 Grit use?

Grit 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 Grit use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Grit?

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

Who maintains Grit?

gitbutlerapp (a GitHub organization) maintains it in gitbutlerapp/grit, which has 539 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 10, 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.