git-advanced-operations

git-advanced-operations is a skill for Claude Code, Codex from justanesta/claude-code-resources. It costs 70 tokens per session (1,837 once invoked), scanned A, original, MIT.

Guidance for advanced Git tasks, including editing commit history, recovering changes, automating checks, using worktrees, and managing large files.

In plain words
What is it for?
Use it to rebase or combine commits, recover lost commits with the reflog, configure hooks, manage stashes and worktrees, or set up Git LFS.
Why use it?
It helps solve difficult repository problems safely and supports parallel development without losing work.

Skill for Claude CodeCodex

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 skills/justanesta/claude-code-resources/git-advanced-operations
Any agent
npx skills add justanesta/claude-code-resources --skill git-advanced-operations
Clone the repo
git clone --depth 1 https://github.com/justanesta/claude-code-resources

Made for: Claude Code, Codex.

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-advanced-operations

README.md
[![agentmods](https://agentmods.dev/badge/skills/justanesta/claude-code-resources/git-advanced-operations.svg)](https://agentmods.dev/skills/justanesta/claude-code-resources/git-advanced-operations)
Your own site
<a href="https://agentmods.dev/skills/justanesta/claude-code-resources/git-advanced-operations"><img src="https://agentmods.dev/badge/skills/justanesta/claude-code-resources/git-advanced-operations.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,837 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.00070 $0.01837
Opus 5 $0.00035 $0.00919
Sonnet 5 $0.00014 $0.00367
Haiku 4.5 $0.00007 $0.00184

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

Security

Grade A, and why

git-advanced-operations 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 4d 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.

skills/git/git-advanced-operations/SKILL.md · 241 lines

How it starts

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

Git Advanced Operations

Power-user Git workflows for rewriting history, recovery, automation, and large repo management.

Core Principles

  1. Understand the object model - Commits are immutable snapshots; branches are movable pointers; HEAD tracks your current position
  2. Reflog is your safety net - Every HEAD movement is recorded for 90 days; almost nothing in Git is truly lost
  3. Non-destructive by default - Prefer operations that create new commits over those that destroy history
  4. Never rewrite shared history - Only rebase or amend commits that have not been pushed to a shared branch
  5. Automate repetitive checks - Use hooks to enforce standards before code leaves your machine

Interactive Rebase

Rewrite, reorder, squash, and clean up commit history before sharing

# Rebase last 5 commits interactively
git rebase -i HEAD~5

# In the editor, change pick to the desired action:
# pick   abc1234 Add user model
# squash abc1235 Fix typo in user model
# reword abc1236 Add auth middleware
# edit   abc1237 Add login endpoint
# drop   abc1238 WIP debugging

# Autosquash: auto-arrange fixup/squash commits
git commit --fixup=abc1234
git rebase -i --autosquash HEAD~5

# Rebase onto a different base branch
git rebase --onto main feature-base feature-branch

See interactive-rebase.md for:

  • Squash vs fixup vs reword workflows
  • Edit mode for splitting commits
  • Autosquash with --fixup and --squash commits
  • Rebase onto for transplanting branches
  • Handling rebase conflicts

Reflog and Recovery

Recover lost commits and undo destructive operations

# View recent HEAD movements
git reflog --date=relative

# Recover a commit after accidental reset
git reflog
# abc1234 HEAD@{2}: commit: important work
git checkout -b recovery-branch abc1234

# Undo a rebase by resetting to pre-rebase state
git reflog
# abc1234 HEAD@{5}: rebase (start): checkout main
git reset --hard HEAD@{5}

# Recover a deleted branch
git reflog | grep "checkout: moving from deleted-branch"
git checkout -b restored-branch abc1234

Read the full file on GitHub · 241 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 241 lines · 70 tokens per session scan A aa3918658319

Subscribe to this mod's changes

git-advanced-operations is a skill published in the GitHub repository justanesta/claude-code-resources (2 stars, last pushed 4mo ago), licensed MIT. It adds 70 tokens to every session and 1,837 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-31.