Skip to content
claudemods

Claude Code Git Mods for Branches, Commits and GitHub

Claude Code git mods show your branch and changes, guard risky git commands, shape commit and PR text and surface GitHub state without leaving the session.

Block Dangerous Commands running in Claude Code

Block Dangerous Commands

Refuses rm -rf /, force-push to main, DROP TABLE, curl | sh and other destructive Bash commands before they run.

  • toast
  • Intercepts tool calls
  • Changes the UI

tested with v2.1.291

Git Branch Above Prompt running in Claude Code

Git Branch Above Prompt

Shows your git branch, changed-file count and ahead/behind status in a one-line band above the Claude Code prompt.

  • above-prompt
  • Runs commands
  • Intercepts tool calls
  • Changes the UI

tested with v2.1.291

Claude Code git mods keep version control visible and a bit safer while Claude edits your code. They show the current branch and how many files changed, warn before a force-push to main, rewrite commit attribution text, or surface pull request and CI state from GitHub.

What do Claude Code git mods hook into?

Display mods read the repository with $.process.run(['git', 'status', '--porcelain=v1', '-b'], { cwd }), using $.session.cwd() to find the folder, then draw the result in the AbovePrompt band or the status line. They refresh on session.start, on turn.complete, and right after a tool.call for Bash whose command mentions git, so a checkout Claude makes shows up at once. A slow $.clock.every timer catches changes you make in another terminal.

Guard mods use the same tool.call hook to refuse commands like git push --force origin main or git clean -fdx. Mods that change how commits and PRs are signed handle attribution.text. GitHub-aware mods run gh or call the GitHub API with $.http.fetch. The mods reference has the full event list.

What should you check before installing one?

Expect Runs commands on nearly every git mod. The question is which commands. A display mod should only run read-only ones such as git status, git rev-parse or git log, with a timeout and no shell string. If a mod shows Network, find out which host it calls and whether it needs a token; a GitHub token in userConfig should be marked sensitive.

On a very large repository, git status can take a noticeable moment. Prefer mods that refresh on events and let you lengthen the timer in /config.

Git mods versus Claude's own git use

Claude already runs git for you through the Bash tool. Git mods do not replace that; they show you the result without asking, and they put limits on what Claude may run. A branch band plus a force-push guard covers the two most common surprises: committing on the wrong branch and rewriting shared history.

FAQ

Do Claude Code git mods need the GitHub CLI?
Only if they talk to GitHub. A branch indicator needs just git. Mods that read pull requests or CI status usually run gh through $.process.run or call the GitHub API with $.http.fetch, and the page should say which.
Can a git mod change my repository?
Only if it runs commands that write, such as git commit or git checkout. Read the How it works section. A display-only mod should run read-only commands like git status.
Why does a git mod show nothing in some folders?
Outside a git repository, a well-behaved git mod hides itself instead of printing an error. Start Claude Code inside the repository, or cd into it before starting.