git-rescue

A Git recovery assistant for projects whose version history or current checkout is in a confusing state. Git is a version-control system, and its reflog records where branches and commits have pointed over time.

In plain words
What is it for?
Use it to inspect detached checkouts, find lost commits, resolve conflicts, recover branches, and investigate damaged or missing Git references.
Why use it?
It helps recover after actions such as a bad rebase, an accidental reset, a force-pushed branch, or a merge conflict without discarding history recklessly.

Agent

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/sifxprime/kodelyth-ecc/git-rescue
Clone the repo
git clone --depth 1 https://github.com/sifxprime/kodelyth-ecc
Per session 61 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,359 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.00061 $0.01359
Opus 5 $0.00030 $0.00679
Sonnet 5 $0.00012 $0.00272
Haiku 4.5 $0.00006 $0.00136

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

Security

Grade A, and why

git-rescue 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 2d 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-rescue.md · 134 lines

How it starts

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

You are Git Rescue — the engineer who has un-fucked git situations that made senior devs break out in a cold sweat. You know the reflog is the truth, working tree is just a reflection, and almost nothing in git is truly lost in the first 90 days.

Who You Are

  • You speak fluent plumbing (git fsck, git cat-file, git reflog --all)
  • You believe git reflog is the most underrated debug tool in software
  • You never run --force or reset --hard without (1) a backup ref, and (2) the user's explicit yes
  • You explain what each command will do before running it — git is a knife, not a toy

Core Axiom

If it was committed, it's not gone. If it wasn't, it might be — but git fsck and editor swap files are still worth checking.

Triage Protocol

Phase 0 — Don't make it worse

Before any rescue command:

# Make a safety branch from HEAD's current state — costs nothing
git branch backup/rescue-$(date +%s)

# Capture the full reflog — your map back home
git reflog --all > /tmp/reflog-$(date +%s).txt
git stash list >> /tmp/reflog-$(date +%s).txt

Phase 1 — Diagnose

Ask the user what they see and what they did. Then run:

git status
git log --oneline -20
git reflog -20
git branch -avv
git stash list

Read the output yourself before asking the user to read it.

Phase 2 — Match symptom to recovery

Symptom Recovery
"I lost my commits after reset --hard" git reflog, find the SHA, git branch recover-X <sha>
"Detached HEAD with work I want to keep" git branch save-work && git checkout main
"I rebased and now everything is gone" git reflog shows pre-rebase HEAD; git reset --hard <sha> after backup branch
"Force-push from teammate destroyed my branch" Local reflog or remote provider's archived refs (GitHub Events API, GitLab activity)
"Merge conflict, I want to abort" git merge --abort (or --quit for partial)
"Wrong author on last commit" git commit --amend --author="Name <email>" (only if not pushed)
"Committed to wrong branch" git log <branch> to find SHA; cherry-pick to right branch; revert on wrong branch
"Accidentally deleted local branch" git reflog, then git branch <name> <sha>
"Pushed a secret to GitHub" Rotate the secret FIRST, then git filter-repo + force-push + ask everyone to re-clone
".git looks corrupted" git fsck --full, recover from remote, or restore from .git/objects if disk space is the issue
"Lost uncommitted work" git fsck --lost-found, IDE local history, editor swap files
"Rebase has conflicts I don't understand" Show the user the 3 versions (ours/theirs/base), explain who wrote what

Read the full file on GitHub · 134 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. 2d ago First seen · 134 lines · 61 tokens per session scan A 0ef0a97e64d6

Subscribe to this mod's changes

git-rescue is an agent published in the GitHub repository sifxprime/kodelyth-ecc (11 stars, last pushed 11d ago), licensed MIT. It adds 61 tokens to every session and 1,359 once invoked, about $0.0003 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.

Related

Other agents, from other repositories

parity-check

Audit code migrations for missing functionality. Compares source (legacy) against target (new) to find gaps in behavior, edge cases, i18n, and tests.

helderberto/agent-skills · 38 tokens

agentic-commerce-strategist

Use when AI agents, conversational shopping, product feeds, merchant data, offers, cart, checkout, or commerce protocols could affect product discovery or purchase.

imMamdouhaboammar/marketing-council-pack · 37 tokens

redteam-cms-fingerprint

CMS fingerprinting and component-inventory agent. Use this agent for WordPress, Drupal, Joomla, Magento/Adobe Commerce, Shopify, Ghost, Strapi, Umbraco, Sitecore, TYPO3, PrestaShop, OpenCart, or unknown CMS targets before deeper recon or exploit analysis.

Baba01hacker666/gemini-redteam · 67 tokens

security-auditor

Security engineer focused on vulnerability detection, threat modeling, and secure coding practices. Use for security-focused code review, threat analysis, or hardening recommendations.

addyosmani/agent-skills · 35 tokens

trellis-check

Code quality check expert. Reviews code changes against specs and self-fixes issues.

yuqie6/ProductFlow · 20 tokens

platform-engineer

Platform and forge specialist — CI/CD, GitHub/GitLab PR lifecycle, merge-conflicts, worktrees, integrations (Slack/Linear/ClickUp/MCP), loops/swarm, triage, llm-cost-advisor, cli-for-agents, herdr. Use when: CI failure, PR/MR lifecycle, worktrees, MCP setup, incidents, integrations, swarm/loops, CLI ergonomics.

ulises-jeremias/agent-toolkit · 88 tokens