# Diff Snapshot

> Use this skill when the user wants to snapshot files before risky edits, inspect diffs against saved snapshots, or restore a previous file state during Codex work.

- Skill: `koyonx/diff-snapshot` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add koyonx/diff-snapshot`
- Raw SKILL.md: https://api.skillmd.com/api/skills/koyonx/diff-snapshot/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: koyonx (https://skillmd.com/u/koyonx)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/koyonx/diff-snapshot

---


# Diff Snapshot

## Overview

Use this skill for manual safety checkpoints before risky edits.
It creates restorable file snapshots under `~/.codex/diff-snapshots`.

## Workflow

1. Run `scripts/snapshot.sh <file...>` before making a risky edit.
2. After the edit, run `scripts/restore.sh diff <snapshot-file>` if you need to compare.
3. Run `scripts/restore.sh restore <snapshot-file>` only when the user explicitly wants rollback.
4. Prefer snapshotting specific files or `--changed` files in a git repo instead of the whole tree.

## Resources

- Script: `scripts/snapshot.sh`
- Script: `scripts/restore.sh`

