git-snapshot-rollback

git-snapshot-rollback is a skill for Claude Code, Codex from cafe3310/public-agent-skills. It costs 24 tokens per session (567 once invoked), scanned A, original, Apache-2.0.

A Git workflow for preserving a failed attempt and returning a project to an earlier commit. Git commits are saved versions of a codebase, and a branch is a separate line of work.

In plain words
What is it for?
Use it to archive current changes, roll back to a specified commit, record why the rollback happened, and verify the resulting branch and archive links.
Why use it?
It reduces the risk of losing uncommitted work or the reasoning behind a rollback. It records the change in ARCHIVE.md and can optionally push the saved branch to a remote repository.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to archive current changes, roll back to a specified commit, record why the rollback happened, and verify the resulting branch and archive links.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cafe3310/public-agent-skills/git-snapshot-rollback
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.

Any agent
npx skills add cafe3310/public-agent-skills --skill git-snapshot-rollback
Clone the repo
git clone --depth 1 https://github.com/cafe3310/public-agent-skills

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-snapshot-rollback

README.md
[![agentmods](https://agentmods.dev/badge/skills/cafe3310/public-agent-skills/git-snapshot-rollback/github.svg)](https://agentmods.dev/skills/cafe3310/public-agent-skills/git-snapshot-rollback)
Your own site
<a href="https://agentmods.dev/skills/cafe3310/public-agent-skills/git-snapshot-rollback"><img src="https://agentmods.dev/badge/skills/cafe3310/public-agent-skills/git-snapshot-rollback/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-snapshot-rollback

Your own site · 80×15
<a href="https://agentmods.dev/skills/cafe3310/public-agent-skills/git-snapshot-rollback"><img src="https://agentmods.dev/badge/skills/cafe3310/public-agent-skills/git-snapshot-rollback.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 567 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.00024 $0.00567
Opus 5.5 $0.00010 $0.00227
Sonnet 5.5 $0.00005 $0.00113
Haiku 4.5 $0.00002 $0.00057

Measured 3mo ago against content hash 1bb932947b6e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-snapshot-rollback 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 3mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/rollback.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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-snapshot-rollback/SKILL.md · 47 lines

What it actually says

Git Snapshot & Rollback

此技能通过自动化脚本确保在回退 Git 提交时,不仅保留了当前的尝试(Snapshot),还通过 ARCHIVE.md 构建了一个可追溯的决策链表。

核心工作流

1. 确认回退目标

  • 获取用户想要回退到的目标 Commit Hash。
  • 询问或总结回退的具体原因(Reason)。

2. 执行自动化回退脚本

  • 在执行前,必须询问用户是否需要将存档分支推送到远端仓库。
  • 使用 run_shell_command 调用技能内置脚本:
    • 如果用户同意推送:python3 <path_to_skill>/scripts/rollback.py <Target_Commit> "<Reason>" --push
    • 如果用户不同意推送(默认):python3 <path_to_skill>/scripts/rollback.py <Target_Commit> "<Reason>"
  • 脚本将自动完成:
    1. Commit 当前所有未提交的变更。
    2. 创建 archive/{current_branch}/YYYY-MM-DD-HH-mm 分支。
    3. 更新存档分支的 ARCHIVE.md 记录。
    4. (可选) 将存档分支推送到远端。
    5. 回到原分支并执行 git reset --hard。
    6. 在原分支更新 ARCHIVE.md 并提交回退记录。
    7. 列出当前所有领先于远程(未推送)的分支。

3. 结果验证

  • 检查 ARCHIVE.md 是否已正确记录了本次回退的双向链接。
  • 确认当前分支已处于目标 Commit 状态。

记录规范

  • 关于 ARCHIVE.md 的具体格式,请参考 references/log-format.md。
  • 每次回退的 Commit Message 必须包含来源存档分支的信息。

使用禁令

  • 严禁在没有使用此技能的情况下直接执行 git reset --hard 来放弃大量工作。
  • 不得修改或删除 ARCHIVE.md 中的历史记录。
Files

What ships with it

2 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. 3mo ago First seen · 47 lines · 24 tokens per session scan A 1bb932947b6e

Subscribe to this mod's changes

git-snapshot-rollback is a skill published in the GitHub repository cafe3310/public-agent-skills (260 stars, last pushed 14d ago), licensed Apache-2.0. It adds 24 tokens to every session and 567 once invoked, about $0.0001 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-snapshot-rollback compared with skills from other repositories

git-snapshot-rollback next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
git-snapshot-rollbackcafe3310/public-agent-skillsSkill26014d agoApache-2.0A24Claude Code, Codex
git-workflow-and-versioningGuillemRoca/agent-skills-androidSkill71mo agoMITA77Claude Code
secret-scanningfirstsun-dev/skillsSkill55d agononeA96Claude Code, Codex
git-workflow-and-versioningaddyosmani/agent-skillsSkill121k6d agoMITA131Claude Code
antfu-create-prantfu/skillsSkill6.1k3d agoMITA54Claude Code, Codex
chinese-commit-conventionsjnMetaCode/superpowers-zhSkill8.6k14d agoMITA65Claude Code
skill-changelogluongnv89/asmSkill976todayMITA53Claude Code