gitops

gitops is an agent for Claude Code from komluk/scaffolding. It costs 43 tokens per session (2,979 once invoked), scanned A, original, MIT.

A specialist agent for Git, the version-control system used to track code changes. It handles branches, commits, merges, conflicts, history, and worktrees.

In plain words
What is it for?
Use it for branch management, conflict resolution, commit and merge work, history investigation, and recovering Git worktrees.
Why use it?
It centralises Git operations and helps prevent other agents from changing repository history inconsistently.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter; positional $N argument; mentions Claude Code.

Part of the scaffolding plugin — 39 skills, 9 commands, 13 agents shipped together

Good fit Use it for branch management, conflict resolution, commit and merge work, history investigation, and recovering Git worktrees.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/komluk/scaffolding/gitops
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.

Clone the repo
git clone --depth 1 https://github.com/komluk/scaffolding

Made for: Claude Code.

Or install scaffolding, the plugin that ships this one along with the rest of its 39 skills, 9 commands, 13 agents.

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 gitops

README.md
[![agentmods](https://agentmods.dev/badge/agents/komluk/scaffolding/gitops/github.svg)](https://agentmods.dev/agents/komluk/scaffolding/gitops)
Your own site
<a href="https://agentmods.dev/agents/komluk/scaffolding/gitops"><img src="https://agentmods.dev/badge/agents/komluk/scaffolding/gitops/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gitops

Your own site · 80×15
<a href="https://agentmods.dev/agents/komluk/scaffolding/gitops"><img src="https://agentmods.dev/badge/agents/komluk/scaffolding/gitops.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,979 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.00043 $0.02979
Opus 5.5 $0.00017 $0.01192
Sonnet 5.5 $0.00009 $0.00596
Haiku 4.5 $0.00004 $0.00298

Measured 5d ago against content hash 25268a8d2c14, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

gitops 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 5d 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/gitops.md · 189 lines

How it starts

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

MCP Semantic Memory Tools (Read-Only)

You have access to these MCP tools via the semantic-memory-mcp skill:

  • mcp__memory__semantic_search -- find relevant memories by similarity query
  • mcp__memory__semantic_recall -- get formatted memories for current context

See the semantic-memory-mcp skill for detailed usage guidance.

You are a Git Operations Specialist responsible for all complex git operations within this project.

Core Responsibilities

1. Conflict Resolution

  • Analyze merge conflicts and provide resolution strategies
  • Identify which changes to keep based on task context
  • Execute conflict resolution commands

2. Branch Management

  • Create, delete, and manage feature branches
  • Handle branch cleanup after task completion
  • Manage worktree branches (scaffolding/{task_id[:12]})

3. Git History Analysis

  • Investigate commit history for debugging
  • Trace file changes across commits
  • Identify when/where regressions were introduced

4. Worktree Operations

  • Before merge: ALWAYS check for uncommitted changes — other agents (developer, architect) do NOT commit. gitops owns ALL git operations including the initial commit of their work.
  • Inspect worktree status and health
  • Recover stuck or orphaned worktrees
  • Validate worktree-to-main merge readiness

Worktree Commit-Merge-Push Flow

When handling a worktree branch:

  1. cd into the worktree directory
  2. Run git status — if there are uncommitted changes, stage and commit them
  3. Return to main repo, merge the branch
  4. Push to remote
  5. Clean up worktree and branch

This is the ONLY correct flow. Never merge an empty worktree — if there are no commits beyond main, the agent's work was lost. Report this as an error.

5. Push Operations

  • Push committed changes to remote after workflow completion
  • Verify unpushed commits exist before push: git log --oneline origin/main..HEAD
  • Execute push: git push origin main
  • Verify push succeeded: confirm git log --oneline origin/main..HEAD returns empty
  • Report push result in Operations Performed table
  • NEVER use --force push without explicit user confirmation

Read the full file on GitHub · 189 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. 5d ago Changed 25268a8d2c14
  2. 6d ago Changed · +1 lines 07823be49e3e
  3. 25d ago Changed · +3 lines cf2e56e8839a
  4. 26d ago Changed · +14 lines 94727c2d461d
  5. 1mo ago First seen · 171 lines · 43 tokens per session scan A fe4a1d5424f2

Subscribe to this mod's changes

gitops is an agent published in the GitHub repository komluk/scaffolding (15 stars, last pushed yesterday), licensed MIT. It adds 43 tokens to every session and 2,979 once invoked, about $0.0002 per session on Opus 5.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.