git-snapshot

Capture git state into a structured handoff file with YAML frontmatter.

Updated Nov 30, 2025
One-click install
npx skills add https://github.com/poisontr33s/chthonic-archive --skill git-snapshot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-snapshot
Source: https://github.com/poisontr33s/chthonic-archive/tree/main/.claude/skills/git-snapshot
Command: npx skills add https://github.com/poisontr33s/chthonic-archive --skill git-snapshot

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Captures the current git state and writes a structured, portable handoff file into claude/mailbox, eliminating the need to manually explore history and burn tokens during sessions.

Core Features & Use Cases

  • Captures recent commits, branch, diff stats, and changed files in a single snapshot.
  • Writes a YAML-frontmattered summary to claude/mailbox/GIT_SNAPSHOT_LATEST.md for easy loading by agents.
  • Supports a default quick snapshot, a full snapshot with author details, and a diff-only view, with options to output JSON or emit to a custom path.
  • Enables session resumption by providing a deterministic state to continue work without re-deriving history.

Quick Start

Run uv run scripts/git_snapshot.py to create the latest snapshot and write it to claude/mailbox/GIT_SNAPSHOT_LATEST.md.

Frequently Asked Questions about git-snapshot

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

FAQPage Schema
How do I capture git state for session handoff?

To capture git state for session handoff, run the git snapshot script. It automatically extracts recent commits, branch info, diff stats, and changed files, then writes a structured summary to a markdown file for easy agent loading.

What is the best way to save git history to avoid burning tokens?

Saving git history to a structured markdown file avoids burning tokens by providing a concise, readable snapshot. This eliminates the need for agents to manually explore git history during active sessions.

Can I output git diff stats and changed files as JSON?

Yes, you can output git diff stats and changed files as JSON. The snapshot script supports a --json option to format the captured git state output directly as JSON instead of markdown.

Does the git snapshot script require any dependencies?

The git snapshot script requires no external dependencies. It runs directly via the uv run command and only needs an existing git repository to extract branch, commit, and diff information.

How do I write a git summary to a custom file path?

To write a git summary to a custom file path, use the --emit PATH option. This overrides the default behavior of writing the snapshot to the claude/mailbox directory.

When do I need a full git snapshot with author details?

You need a full git snapshot with author details when resuming complex sessions that require accountability. This mode captures comprehensive commit metadata beyond the default quick snapshot view.