/cc-skills-utils:recoverfrom cc-skills-utils
Recover deleted, overwritten, or missing files using git, file-history, transcripts, and checkpoints. Use when file is missing, accidentally deleted, overwritten by mistake, or user says "recover X" or "file was deleted" or "restore X".
Ships in cc-skills-utils. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Recover deleted, overwritten, or missing files using multiple fallback sources: git, file-history, transcript parsing, and checkpoints.
git -C "P:/" log --all --full-history -- <file_path> # Find commits touching file
git -C "P:/" show <commit>:<file_path> # Preview content at commit
git -C "P:/" restore --source=<commit> <file_path> # Restore
When: File was ever committed to git. Works for deleted AND modified files.
Search C:/Users/brsth/.claude/file-history/ — Claude maintains file revision history:
# Find file by hash/path pattern
ls "C:/Users/brsth/.claude/file-history/" # List all tracked file histories
# File history structure:
# file-history/{uuid}/{version_hash}@v{version}
# e.g., file-history/4640cb47/020b57d9ba84affb@v1
# Read most recent version
Read("C:/Users/brsth/.claude/file-history/{uuid}/{hash}@v{max}")
Parse session transcripts from ~/.claude/projects/:
# Transcript location pattern:
# C:/Users/brsth/.claude/projects/P--/{session_id}.jsonl
# Look for Write/Edit tool calls with matching file_path
# Tool input: {"file_path": "X", "content": "..."}
When: File content was written by Claude in a prior session.
Use /rewind command — but note: checkpoints only capture Write/Edit operations, NOT Bash commands.
# Get file path from user or last context
# Normalize path for cross-platform compatibility
# Step A: Check if file exists in git history
git -C "P:/" log --all --oneline -- <file_path>
# Step B: If found, show recent commits
git -C "P:/" log --all --oneline -10 -- <file_path>
# Step C: Get content from HEAD~N
git -C "P:/" show HEAD~1:<relative_path>
# Search file-history by filename pattern
find "C:/Users/brsth/.claude/file-history/" -name "*<filename>*" 2>/dev/null
# List all history for specific file
ls -la "C:/Users/brsth/.claude/file-history/{uuid}/" | grep <filename>
# Get recent session transcripts
ls -lt "C:/Users/brsth/.claude/projects/P--/"*.jsonl | head -5
# Search for file_path in transcripts
python - <<'PY'
import json
import sys
path = "TARGET_FILE_PATH"
transcripts = [
r"C:\Users\brsth\.claude\projects\P--\RECENT_SESSION.jsonl",
]
for t in transcripts:
try:
with open(t, 'r', encoding='utf-8', errors='replace') as f:
for line in f:
try:
e = json.loads(line.strip())
msg = e.get('message', {})
content = msg.get('content', '')
if isinstance(content, list):
content = ' '.join(c.get('text','') for c in content if isinstance(c,dict))
if path.lower() in content.lower() and 'Write' in str(e):
print(f"Found in {t}: {str(e)[:500]}")
except:
pass
except Exception as ex:
pass
PY
RECOVERY OPTIONS for {filename}:
1. Git restore from {commit} ({date})
Source: git log commit {hash}
Preview: {first 3 lines of file}
2. File history version {v3} ({date})
Source: ~/.claude/file-history/{uuid}/{hash}@v3
Age: {days_ago} days
3. Transcript from session {id} ({date})
Source: Write operation in session transcript
Content length: {N} chars
4. Transcript from session {id2} ({date})
Source: Edit operation in session transcript
Content length: {N} chars
Choose option [1-4] or skip:
# Based on user choice:
# Option 1 (git):
git -C "P:/" restore --source=<commit> <file_path>
# Option 2 (file-history):
cp "C:/Users/brsth/.claude/file-history/{uuid}/{hash}@v{max}" "<target_path>"
# Option 3-4 (transcript):
# Extract content from JSON, write to target path
| Source | What it recovers | Latency | Reliability |
|---|---|---|---|
| Git | Committed files (deleted or modified) | <1s | HIGH |
| File History | Untracked files with revisions | <2s | MEDIUM |
| Transcript | Content from Write/Edit operations | 5-30s | MEDIUM |
| Checkpoints | Write/Edit content (built-in /rewind) | interactive | HIGH |
~/.claude/file-history/ contains versioned copies most users don't know aboutrm, mv operations/recover/rewind to preserve contextWhat SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
Other plugins' skills for the same job
/mainMain Cognitive Steering Framework - system health checks and workspace validation (with optional enforcement hooks)Generated from the plugin's indexed repository (enduser123/cc-skills-utils) — no native marketplace selected
npx claudepluginhub p/enduser123-cc-skills-utils