git-rescue

git-rescue is an agent for Claude Code from sifxprime/kodelyth-ecc. It costs 61 tokens per session (1,453 once invoked), scanned A, original, MIT.

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 for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit Use it to inspect detached checkouts, find lost commits, resolve conflicts, recover branches, and investigate damaged or missing Git references.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/sifxprime/kodelyth-ecc/git-rescue
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/sifxprime/kodelyth-ecc

Made for: Claude Code.

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 git-rescue

README.md
[![agentmods](https://agentmods.dev/badge/agents/sifxprime/kodelyth-ecc/git-rescue/github.svg)](https://agentmods.dev/agents/sifxprime/kodelyth-ecc/git-rescue)
Your own site
<a href="https://agentmods.dev/agents/sifxprime/kodelyth-ecc/git-rescue"><img src="https://agentmods.dev/badge/agents/sifxprime/kodelyth-ecc/git-rescue/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 git-rescue

Your own site · 80×15
<a href="https://agentmods.dev/agents/sifxprime/kodelyth-ecc/git-rescue"><img src="https://agentmods.dev/badge/agents/sifxprime/kodelyth-ecc/git-rescue.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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,453 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.00061 $0.01453
Opus 5.5 $0.00024 $0.00581
Sonnet 5.5 $0.00012 $0.00291
Haiku 4.5 $0.00006 $0.00145

Measured 2mo ago against content hash da1e24e5eae0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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 · 143 lines

How it starts

The opening of the file, as written. The whole thing — 143 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
STAMP=$(date +%Y%m%d-%H%M%S)
git branch "backup/rescue-$STAMP"

# Capture the full reflog — your map back home.
# Write it INSIDE the repo, not a temp dir: a rescue snapshot that a reboot
# can delete is not a snapshot. Add the file to .git/info/exclude if the
# working tree must stay clean.
SNAPSHOT="git-rescue-$STAMP.txt"
{
  echo "=== reflog --all ==="; git reflog --all
  echo; echo "=== stash list ==="; git stash list
  echo; echo "=== branches ==="; git branch -avv
} > "$SNAPSHOT"
echo "snapshot: $SNAPSHOT"

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 · 143 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. 2mo ago Changed · +9 lines da1e24e5eae0
  2. 3mo 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 (12 stars, last pushed today), licensed MIT. It adds 61 tokens to every session and 1,453 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.

Related

git-rescue compared with agents from other repositories

git-rescue next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
git-rescuesifxprime/kodelyth-eccAgent12todayMITA61Claude Code
alex-devops-engineermagic5644/Graph-It-LiveAgent63yesterdayMITA59Claude Code
implementerroundpilot/superpowers-antigravityAgent1023d agoMITA44Claude Code
git-managernth5693/gemini-kitAgent3708mo agoMITA10Claude Code
release-summarizerorin-dx/agent-pluginsAgent12mo agoMITA191Claude Code
public-metadata-reviewerrogue-dev-studio/ai-agents-rogueAgent22d agononeA51Claude Code
release_chefPJuniszewski/cookAgent139mo agoMITA0Claude Code