context-restorelisted
Install: claude install-skill manastalukdar/ai-devstudio
# Context Restore
I'll find the most recent WIP commit on this branch and unpack it back to your working tree so you can resume right where you left off. Inspired by gstack's context-restore skill.
## Token Optimization
**Expected range**: 100–250 tokens
**Patterns used**: Bash git commands, early exit (no WIP commit found)
**Early exit**: If no WIP commit exists on the current branch, report clearly and stop.
## Usage
```bash
/context-restore # restore most recent WIP on current branch
/context-restore --list # show all WIP commits across all branches
/context-restore --pick # choose from a list of WIP commits
```
## Step 1 — Find WIP Commits
```bash
BRANCH=$(git rev-parse --abbrev-ref HEAD)
# Find the most recent WIP commit on this branch
WIP_SHA=$(git log --oneline | grep "^[a-f0-9]* wip:" | head -1 | cut -d' ' -f1)
if [ -z "$WIP_SHA" ]; then
echo "No WIP commits found on branch: $BRANCH"
echo ""
echo "All WIP commits across all branches:"
git log --all --oneline | grep "wip:" | head -10
exit 0
fi
# Show what will be restored
WIP_MSG=$(git log --oneline -1 "$WIP_SHA")
echo "Found WIP commit: $WIP_MSG"
```
## Step 2 — Check Working Tree Safety
```bash
# Warn if current working tree has unsaved changes
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "⚠ Warning: You have uncommitted changes that will be overwritten."
echo ""
git status --short
echo ""
echo "Save them fir