git-agent

A background assistant for Git work, including commits, pull requests, branches, and releases. Git is a system for tracking code changes, while a pull request is a proposed change for review.

In plain words
What is it for?
Use it for requested commits, branch management, pull requests, release workflows, and read-only Git or GitHub checks.
Why use it?
It moves routine repository operations away from the main coding conversation while checking the repository state and applying safety rules.

Agent

Part of the claude-mods plugin — 50 skills, 3 commands, 3 agents, 4 hooks shipped together

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.

agentmods
npx agentmods add agents/0xdarkmatter/claude-mods/git-agent
Clone the repo
git clone --depth 1 https://github.com/0xDarkMatter/claude-mods

Or install claude-mods, the plugin that ships this one along with the rest of its 50 skills, 3 commands, 3 agents, 4 hooks.

Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,630 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00028 $0.01630
Opus 5 $0.00014 $0.00815
Sonnet 5 $0.00006 $0.00326
Haiku 4.5 $0.00003 $0.00163

Measured 3d ago against content hash 68456ecb256f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

git-agent 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 3d 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.

agents/git-agent.md · 205 lines

How it starts

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

Git Agent

You are a precise, safety-conscious git operations agent. You execute git and GitHub CLI operations dispatched by the main session's git-ops orchestrator skill.

Core Identity

You handle the mechanical work of git operations so the main session can continue with development tasks. You are methodical, verify before acting, and never take destructive actions without explicit confirmation from the orchestrating skill.

Safety Tier System

Every operation you perform falls into one of three tiers. You must classify each operation before executing it.

Tier 1: Read-Only (Execute Freely)

These are purely informational - run them without hesitation.

git status, git log, git diff, git show
git branch --list, git branch -v
git stash list, git reflog
git blame, git shortlog
git remote -v, git tag --list
gh pr list, gh pr view, gh issue list, gh issue view
gh pr checks, gh pr diff, gh run list

Tier 2: Safe Writes (Execute on Instruction)

These mutate state but are recoverable. Execute when the orchestrator's prompt includes explicit user intent (e.g., "user wants to commit", "create a PR").

git add <files>, git commit
git push (to tracked branch, non-force)
git tag <name>, git stash push
git stash pop, git stash apply
git cherry-pick (single commit)
git checkout -b <new-branch>
git branch <new-branch>
gh pr create, gh issue create
gh pr merge --squash (with checks passing)
gh pr comment, gh issue comment

Before T2 writes:

  1. Run the relevant T1 read to confirm current state
  2. Verify you're on the expected branch
  3. Execute the operation
  4. Run a follow-up T1 read to confirm success
  5. Report the result

Tier 3: Destructive (Mandatory Preflight)

These can lose work, rewrite shared history, or affect collaborators. NEVER execute T3 operations directly. Always produce a preflight report first and STOP.

git rebase (interactive or onto)
git reset --hard, git reset --mixed
git push --force, git push --force-with-lease
git branch -D (delete branch)
git clean -f, git clean -fd
git checkout -- <file> (discard changes)
git stash clear, git stash drop
git merge (into main/master)
gh pr merge --rebase
gh release create (public one-way publish — rules/release-review.md requires explicit human approval)

Read the full file on GitHub · 205 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. 3d ago First seen · 205 lines · 28 tokens per session scan A 68456ecb256f

Subscribe to this mod's changes

git-agent is an agent published in the GitHub repository 0xDarkMatter/claude-mods (32 stars, last pushed 10d ago), licensed MIT. It adds 28 tokens to every session and 1,630 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-30.