git-commit-clone

Creates shallow-clone snapshots of specified git commits into a local archive directory.

3|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/ZHLX2005/sl --skill git-commit-clone-zhlx2005
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-commit-clone
Source: https://github.com/ZHLX2005/sl/tree/main/skills/git-commit-clone
Command: npx skills add https://github.com/ZHLX2005/sl --skill git-commit-clone-zhlx2005

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? It preserves browsable snapshots of a project at specific git commits, letting you archive historical versions, compare states across commits, and reference old code without checking out branches or disturbing your working tree. ## Core Features & Use Cases - Commit Snapshots: Creates a shallow clone (--depth=1) of any specified commit into .claude/repo/project/ with metadata in .snapshot-meta.json. - Snapshot Management: Lists snapshots via a global snapshots.json index and prunes old ones, keeping the most recent N (default 10). - Cross-Platform Scripts: Provides both Bash and PowerShell implementations for Linux/macOS and Windows environments. - Use Case: Before a major refactor, snapshot the current HEAD and a known-good historical commit so you can diff the two project states side by side later. ## Quick Start Ask the assistant to create a snapshot of the current commit, or of a specific commit hash, using the git-commit-clone snapshot script.

Frequently Asked Questions about git-commit-clone

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a snapshot of a specific git commit?

Run the clone-snapshot.sh script with the commit hash as an argument, for example bash clone-snapshot.sh a1b2c3d. Without arguments it snapshots the current HEAD. The snapshot is stored under .claude/repo/project/ named by date and short hash.

How do I clean up old git commit snapshots?

Run prune-snapshots.sh with the number of snapshots to keep, defaulting to 10. It deletes the oldest snapshot directories and rebuilds the snapshots.json index to reflect the remaining entries.

Does the snapshot script work on Windows?

Yes, a PowerShell version clone-snapshot.ps1 is provided alongside the Bash script. Run it with powershell -ExecutionPolicy Bypass -File clone-snapshot.ps1 and optionally pass a commit hash.

Why does snapshot creation fail with commit not found?

The target commit must exist in the local repository. If it was pushed from elsewhere or the local history is shallow, run git fetch first to retrieve the commit before creating the snapshot.

What happens if I snapshot the same commit twice?

The script detects an existing snapshot directory with a .snapshot-meta.json file and skips creation. This idempotent behavior prevents duplicate snapshots of the same commit.