[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71GP53NSJMDW2P8DAN8JSRA":3,"skill-same:01M71GP53NSJMDW2P8DAN8JSRA":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":6,"ownerHtmlUrl":53,"ownerBlogUrl":54,"ownerDescription":55,"updatedAt":56,"install":57,"resources":70},"01M71GP53NSJMDW2P8DAN8JSRA","context-restore",null,"Restore working context saved by \u002Fcontext-save so you can pick up where you left off.","timurgaleev\u002Fvibestack","timurgaleev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F32696429?v=4","01M71GMS53Z9B4JQTCQEFXAE9E","Timur Galeev","01M71GMS5S1Q7BEYB3Z7GY3E85",8,"MIT","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-restore\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31],"restore","context restore","context","pick","up","you","Bash","can","saved","resume","read","grep","save","2026-11-10 10:12:30",false,"---\nname: context-restore\ndescription: |\n  Restore working context saved by \u002Fcontext-save so you can pick up where you left off.\nallowed-tools:\n  - Bash\n  - Read\n  - Glob\n  - Grep\n  - AskUserQuestion\ntriggers:\n  - resume where i left off\n  - restore context\n  - where was i\n  - pick up where i left off\n  - context restore\n---\n\nIf this session was compacted, the copy of this skill in context may be cut off.\nRead `${CLAUDE_SKILL_DIR}\u002FSKILL.md` from disk and resume at the step you are on.\n\n## When to invoke\n\nUse when asked to \"resume\", \"restore context\", \"where was I\", or \"pick up where I left off\". Pair with \u002Fcontext-save. Formerly \u002Fcheckpoint resume — renamed because Claude Code treats \u002Fcheckpoint as a native rewind alias in current environments.\n\n## Preamble\n\n```bash\neval \"$(\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" 2>\u002Fdev\u002Fnull)\" 2>\u002Fdev\u002Fnull || SLUG=\"unknown\"\n_LEARN_FILE=\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F${SLUG:-unknown}\u002Flearnings.jsonl\"\nif [ -f \"$_LEARN_FILE\" ]; then\n  _LEARN_COUNT=$(wc -l \u003C \"$_LEARN_FILE\" 2>\u002Fdev\u002Fnull | tr -d ' ')\n  echo \"LEARNINGS: $_LEARN_COUNT entries loaded\"\n  if [ \"$_LEARN_COUNT\" -gt 5 ] 2>\u002Fdev\u002Fnull; then\n    \"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-learnings-search\" --limit 5 2>\u002Fdev\u002Fnull || true\n  fi\nelse\n  echo \"LEARNINGS: none yet\"\nfi\n```\n\n{{include lib\u002Fsnippets\u002Fsession-host.md}}\n\n{{include lib\u002Fsnippets\u002Fdecision-brief.md}}\n\n{{include lib\u002Fsnippets\u002Fworking-protocols.md}}\n\n{{include lib\u002Fsnippets\u002Fstate-protocols.md}}\n\n# \u002Fcontext-restore — Restore Saved Working Context\n\nYou are a **Staff Engineer reading a colleague's meticulous session notes** to\npick up exactly where they left off. Your job is to load the most recent saved\ncontext and present it clearly so the user can resume work without losing a beat.\n\n**HARD GATE:** Do NOT implement code changes. This skill only reads saved\ncontext files and presents the summary.\n\n**Default: load the most recent context saved on the CURRENT branch; if this\nbranch has none, fall back to the most recent across ALL branches.** Every\nworktree of a repo shares one checkpoints directory, so without the preference a\nsibling worktree's newer save would be presented as \"where you left off\". The\nfallback keeps Conductor workspace handoff working — a context saved on one\nbranch can still be resumed from another.\n\n**Do NOT hard-filter the candidate set to the current branch.** Other-branch\nfiles stay in the set; they are ordered *after* the current branch's own.\n(`\u002Fcontext-save list` is the flow that scopes to one branch.)\n\n---\n\n## Detect command\n\nParse the user's input:\n\n- `\u002Fcontext-restore` → load the most recent saved context (current branch first, then any branch)\n- `\u002Fcontext-restore \u003Ctitle-fragment-or-number>` → load a specific saved context\n- `\u002Fcontext-restore list` → tell the user \"Use `\u002Fcontext-save list` — listing\n  lives on the save side\" and exit. No mode detection here.\n\n---\n\n## Restore flow\n\n### Step 1: Find saved contexts\n\n```bash\neval \"$(\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" 2>\u002Fdev\u002Fnull)\" && mkdir -p \"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F$SLUG\"\nCHECKPOINT_DIR=\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F$SLUG\u002Fcheckpoints\"\nif [ ! -d \"$CHECKPOINT_DIR\" ]; then\n  echo \"NO_CHECKPOINTS\"\nelse\n  # Use find + sort instead of ls -1t. Two reasons:\n  # 1. Canonical order is the filename YYYYMMDD-HHMMSS prefix (stable across\n  #    copies\u002Frsync). Filesystem mtime drifts and is not authoritative.\n  # 2. On macOS, `find ... | xargs ls -1t` with zero results falls back to\n  #    listing cwd. `sort -r` on empty input cleanly returns nothing.\n  # Scan the 200 newest so a current-branch save sitting below a burst of\n  # sibling-worktree saves is still found; the printed list is capped at 20.\n  ALL=$(find \"$CHECKPOINT_DIR\" -maxdepth 1 -name \"*.md\" -type f 2>\u002Fdev\u002Fnull | sort -r | head -200)\n  # Drop checkpoints stamped for another project (a different remote, or a\n  # different root when neither has one). Each is named, never loaded.\n  if [ -n \"$ALL\" ]; then\n    CLASSIFIED=$(printf '%s\\n' \"$ALL\" | \"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" --classify-checkpoints 2>\u002Fdev\u002Fnull)\n    TAB=$(printf '\\t')\n    if [ -n \"$CLASSIFIED\" ] && ! printf '%s\\n' \"$CLASSIFIED\" | grep -qvE \"^(match|unstamped|foreign)${TAB}\"; then\n      printf '%s\\n' \"$CLASSIFIED\" | awk -F'\\t' '$(1) == \"foreign\" { print $(2) }' | while IFS= read -r f; do\n        echo \"PROJECT MISMATCH: $f ($(grep -m1 '^remote:' \"$f\" 2>\u002Fdev\u002Fnull), $(grep -m1 '^project_root:' \"$f\" 2>\u002Fdev\u002Fnull))\"\n      done\n      ALL=$(printf '%s\\n' \"$CLASSIFIED\" | awk -F'\\t' '$(1) != \"foreign\" { print $(2) }')\n    else\n      echo \"IDENTITY_CHECK_UNAVAILABLE\"\n    fi\n  fi\n  if [ -z \"$ALL\" ]; then\n    echo \"NO_CHECKPOINTS\"\n  else\n    # Current-branch files first, other branches after, each newest first.\n    # CURRENT_BRANCH may be preset; otherwise it comes from git.\n    : \"${CURRENT_BRANCH:=$(git rev-parse --abbrev-ref HEAD 2>\u002Fdev\u002Fnull)}\"\n    SAME=\"\"; OTHER=\"\"\n    while IFS= read -r f; do\n      [ -n \"$f\" ] || continue\n      b=$(grep -m1 '^branch:' \"$f\" 2>\u002Fdev\u002Fnull | sed 's\u002F^branch:[[:space:]]*\u002F\u002F')\n      if [ -n \"$CURRENT_BRANCH\" ] && [ \"$b\" = \"$CURRENT_BRANCH\" ]; then\n        SAME=\"${SAME}${f}\n\"\n      else\n        OTHER=\"${OTHER}${f}\n\"\n      fi\n    done \u003C\u003CEOF\n$ALL\nEOF\n    echo \"CURRENT_BRANCH=${CURRENT_BRANCH:-unknown}\"\n    [ -n \"$SAME\" ] || echo \"NO_CURRENT_BRANCH_CHECKPOINT\"\n    # Named separately: with 20+ saves on this branch the capped list below\n    # would never reach another branch's newer save.\n    [ -n \"$SAME\" ] && [ -n \"$OTHER\" ] && echo \"NEWEST_OTHER: $(printf '%s' \"$OTHER\" | head -1)\"\n    # Cap at 20: a user with 10k saved files shouldn't blow the context window\n    # just listing them. \u002Fcontext-save list handles pagination.\n    printf '%s%s' \"$SAME\" \"$OTHER\" | grep -v '^[[:space:]]*$' | head -20\n  fi\nfi\n```\n\n**Candidates include every `.md` file in the directory**, ordered\n**current-branch-first** (the branch is read from each file's `branch:`\nfrontmatter). Other-branch files stay in the set as the fallback, which keeps\nConductor workspace handoff working when this branch has no save of its own.\n`NO_CURRENT_BRANCH_CHECKPOINT` means every path printed came from another branch.\n\n**Project identity.** `\u002Fcontext-save` stamps each checkpoint with `remote:` (the\ncredential-free origin) and `project_root:`. A checkpoint stamped for a\ndifferent project is never a candidate: Step 1 prints `PROJECT MISMATCH: \u003Cpath>\n(...)` for it instead. Report every `PROJECT MISMATCH` line to the user **before\nany summary**, e.g. \"Skipped 1 checkpoint saved for `github.com\u002Fbob\u002Fapi` — it\nbelongs to another project.\" If that leaves no candidate (`NO_CHECKPOINTS`),\nsay the bucket holds only other projects' saves. Never load a mismatched file,\neven when the user names it by title or number — name its project and stop.\nCheckpoints with no `remote:` field were saved before stamping existed; they\nstay candidates. `IDENTITY_CHECK_UNAVAILABLE` means the installed `vibe-slug`\ncannot classify checkpoints — say identity was not checked and suggest\n`\u002Fvibe-upgrade`.\n\n**Auto snapshots.** In Claude Code a PreCompact hook writes a git-state snapshot\nto `compact-snapshots\u002F` before every compaction. List the ones newer than the\nnewest saved context:\n\n```bash\neval \"$(\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" 2>\u002Fdev\u002Fnull)\"\nSNAP_DIR=\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F${SLUG:-unknown}\u002Fcompact-snapshots\"\nNEWEST=$(find \"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F${SLUG:-unknown}\u002Fcheckpoints\" -maxdepth 1 -name \"*.md\" -type f 2>\u002Fdev\u002Fnull | sort -r | head -1)\nif [ -d \"$SNAP_DIR\" ]; then\n  if [ -n \"$NEWEST\" ]; then\n    find \"$SNAP_DIR\" -maxdepth 1 -name \"*.md\" -type f -newer \"$NEWEST\" 2>\u002Fdev\u002Fnull | sort -r | head -10 | sed 's\u002F^\u002FAUTO_SNAPSHOT: \u002F'\n  else\n    find \"$SNAP_DIR\" -maxdepth 1 -name \"*.md\" -type f 2>\u002Fdev\u002Fnull | sort -r | head -10 | sed 's\u002F^\u002FAUTO_SNAPSHOT: \u002F'\n  fi\nfi\n```\n\nShow each `AUTO_SNAPSHOT:` path as \"auto snapshot (git state only)\" — it is\nnever a candidate for Step 2. A snapshot holds branch, status, recent log and\nthe transcript path — no decisions and no remaining work — so it never replaces\na saved context; it only tells the user that work continued after the last\nsave. When no saved context exists, offer the newest\nsnapshot's git state as the only record.\n\n### Step 2: Load the right file\n\n- If the user specified a title fragment or number: find the matching file among\n  the candidates.\n- Otherwise: load the **first path printed by Step 1** — the newest\n  `YYYYMMDD-HHMMSS` save on the current branch or, when Step 1 printed\n  `NO_CURRENT_BRANCH_CHECKPOINT`, the newest across all branches.\n- **No usable branch** (`NO_CURRENT_BRANCH_CHECKPOINT`, or `CURRENT_BRANCH` is\n  `HEAD` or `unknown`): when the newest candidates' titles differ, they are\n  different pieces of work and \"newest\" is a guess, so ask with AskUserQuestion\n  which one to load (newest first, up to four). When the titles\n  match, it is one task handed across branches; load the newest.\n\n#### Head check\n\nRun this against the chosen file, replacing `\u003CCHECKPOINT_FILE>` with its path\nfrom Step 1. It compares the commit the save recorded with the commit checked\nout now:\n\n```bash\nCK_FILE='\u003CCHECKPOINT_FILE>'\nfm() { awk -v k=\"${1}\" 'NR == 1 && $(0) != \"---\" { exit } NR > 1 && $(0) == \"---\" { exit }\n  NR > 1 && index($(0), k \":\") == 1 { v = substr($(0), length(k) + 2); gsub(\u002F^[[:space:]]+|[[:space:]]+$\u002F, \"\", v); print v; exit }' \"$CK_FILE\"; }\nSAVED=$(fm head); SAVED_WT=$(fm worktree)\nNOW=$(git rev-parse --verify -q HEAD 2>\u002Fdev\u002Fnull)\nif [ -z \"$SAVED\" ]; then\n  echo \"HEAD_UNTRACKED\"\nelif ! printf '%s' \"$SAVED\" | grep -qE '^[0-9a-f]{7,64}$' || [ -z \"$NOW\" ] \\\n     || ! git cat-file -e \"$SAVED^{commit}\" 2>\u002Fdev\u002Fnull; then\n  echo \"HEAD_UNKNOWN\"\nelif [ \"$SAVED\" = \"$NOW\" ]; then\n  echo \"HEAD_UNCHANGED\"\nelif git merge-base --is-ancestor \"$SAVED\" HEAD 2>\u002Fdev\u002Fnull; then\n  echo \"HEAD_MOVED $(git rev-list --count \"$SAVED..HEAD\")\"\n  git log --oneline -20 \"$SAVED..HEAD\"\nelse\n  echo \"HEAD_DIVERGED\"\n  git log --oneline -20 \"$SAVED..HEAD\"\nfi\nif [ -n \"$SAVED_WT\" ] && [ \"$SAVED_WT\" != \"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull)\" ]; then\n  echo \"SAVED_IN_WORKTREE: $SAVED_WT\"\nfi\n```\n\n- `HEAD_UNCHANGED` — the tree is where the save left it; sort normally.\n- `HEAD_MOVED \u003Cn>`, `HEAD_DIVERGED` (a rebase, reset or other branch: the\n  saved commit is not behind this one) and `HEAD_UNKNOWN` (the saved commit is\n  not in this clone): show the listed commits under the header box and put\n  every Remaining Work item under **Verify first** — anything the save called\n  done or safe may since have been done, undone or changed.\n- `HEAD_UNTRACKED` — saved before head stamps existed; sort normally.\n- `SAVED_IN_WORKTREE: \u003Cpath>` — the save came from another worktree of this\n  repository; name it.\n\n**Sort Remaining Work by provenance.** `\u002Fcontext-save` ends each item with a\nmarker saying how that session knew it. Keep every item's original text and\nsaved order, and drop nothing. An item's marker is the last provenance marker in\nit, and it counts as the ending even when an outcome follows it: older saves\nwrote `Open. Run the suite. (path run) exit 0`, current ones write\n`Open. Run the suite, exit 0. (path run)`, and both are `(path run)` with a\nsuccessful outcome. Markers are English literals; a parenthesised token in\ntheir place that is none of the five (misspelled, or translated into the\nsession's language) reads as `(path assumed)`. Put an item under **Verify\nfirst** when it:\n- ends in `(path assumed)` or `(code read)`;\n- ends in `(path run)` but its text reports a failure;\n- has no marker and is a writing step (migration, sync, insert, import, deploy,\n  a dialog that writes) or names a concrete path (a runnable command, CLI flag or\n  switch, config key or value, or file or directory path).\n\nEvery other item goes under **Next steps**: `(path run)` with a successful\noutcome, `(path read)`, `(target state checked)`, and unmarked items that neither\nwrite nor name a concrete path. Verifying means read-only inspection: read the\nfile or the target, or run a command that changes nothing. Saves written before\nprovenance markers existed have none, so their concrete-path and writing items\nland under Verify first. When the file has no provenance markers at all, print\nthis line above the groups:\n`This checkpoint predates provenance markers; items naming commands, paths or writes are listed under Verify first.`\n\nRead the chosen file and present a summary:\n\n```\nRESUMING CONTEXT\n════════════════════════════════════════\nTitle:       {title}\nBranch:      {branch from frontmatter}\nSaved:       {timestamp, human-readable}\nDuration:    Last session was {formatted duration} (if available)\nStatus:      {status}\nHead:        {head check result}\n════════════════════════════════════════\n\n### Summary\n{summary from saved file}\n\n### Next Focus\n{Next Focus from the saved file, when present}\n\n### Remaining Work\n{legacy banner line, if it applies}\n\nNext steps\n{Next steps items, in saved order, original text}\n\nVerify first (inspect read-only before executing anything)\n{Verify first items, in saved order, original text}\n\n### Notes\n{notes}\n\n### Suggested skills \u002F References\n{as saved, when present}\n```\n\nIf the loaded file has no `remote:` field, add one line under the header box:\n\"This checkpoint predates project stamps; confirm it belongs to this project.\"\n\nIf the current branch differs from the saved context's branch, note this:\n\"This context was saved on branch `{branch}`. You are currently on\n`{current branch}`. You may want to switch branches before continuing.\"\n\nIf the loaded file is the current branch's but the `NEWEST_OTHER:` path from Step 1\n(the newest save from another branch) has a newer timestamp, name it: \"There is also a newer context saved on\n`{other branch}` — `{title}` from `{timestamp}`. Load that one instead?\" A\nConductor handoff to this branch shows up that way, and the user decides.\n\n### Step 3: Offer next steps\n\nAfter presenting, ask via AskUserQuestion:\n\n- A) Continue working on the remaining items\n- B) Show the full saved file\n- C) Just needed the context, thanks\n\nIf A, take the first Remaining Work item in saved order. If it is under Next\nsteps, suggest starting there. If it is under Verify first, suggest verifying it\nread-only before doing it or any later item, so a later runnable step never\njumps ahead of an unverified earlier one. Never execute a Verify first item as\npart of the restore.\n\n---\n\n## If no saved contexts exist\n\nIf Step 1 printed `NO_CHECKPOINTS`, tell the user:\n\n\"No saved contexts yet. Run `\u002Fcontext-save` first to save your current working\nstate, then `\u002Fcontext-restore` will find it.\"\n\n---\n\n## Important Rules\n\n- **Never modify code.** This skill only reads saved files and presents them.\n- **Prefer the current branch's own save, but keep all branches in the\n  fallback set.** Cross-branch resume (Conductor handoff) works when this branch\n  has no save, and a sibling worktree's newer save never shadows this branch's.\n- **Another project's checkpoint is never restored.** A `PROJECT MISMATCH`\n  file is reported and skipped, never presented as \"where you left off\".\n- **Unverified steps are shown, not run.** An item under Verify first was\n  guessed or failed in the saved session; inspect before acting on it.\n- **\"Most recent\" means the filename `YYYYMMDD-HHMMSS` prefix**, not\n  `ls -1t` (filesystem mtime). Filenames are stable across file-system\n  operations; mtime is not.\n- **This is a vibestack skill, not a Claude Code built-in.** When the user types\n  `\u002Fcontext-restore`, invoke this skill via the Skill tool.\n","If this session was compacted, the copy of this skill in context may be cut off.\nRead `${CLAUDE_SKILL_DIR}\u002FSKILL.md` from disk and resume at the step you are on.\n\n## When to invoke\n\nUse when asked to \"resume\", \"restore context\", \"where was I\", or \"pick up where I left off\". Pair with \u002Fcontext-save. Formerly \u002Fcheckpoint resume — renamed because Claude Code treats \u002Fcheckpoint as a native rewind alias in current environments.\n\n## Preamble\n\n```bash\neval \"$(\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" 2>\u002Fdev\u002Fnull)\" 2>\u002Fdev\u002Fnull || SLUG=\"unknown\"\n_LEARN_FILE=\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F${SLUG:-unknown}\u002Flearnings.jsonl\"\nif [ -f \"$_LEARN_FILE\" ]; then\n  _LEARN_COUNT=$(wc -l \u003C \"$_LEARN_FILE\" 2>\u002Fdev\u002Fnull | tr -d ' ')\n  echo \"LEARNINGS: $_LEARN_COUNT entries loaded\"\n  if [ \"$_LEARN_COUNT\" -gt 5 ] 2>\u002Fdev\u002Fnull; then\n    \"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-learnings-search\" --limit 5 2>\u002Fdev\u002Fnull || true\n  fi\nelse\n  echo \"LEARNINGS: none yet\"\nfi\n```\n\n{{include lib\u002Fsnippets\u002Fsession-host.md}}\n\n{{include lib\u002Fsnippets\u002Fdecision-brief.md}}\n\n{{include lib\u002Fsnippets\u002Fworking-protocols.md}}\n\n{{include lib\u002Fsnippets\u002Fstate-protocols.md}}\n\n# \u002Fcontext-restore — Restore Saved Working Context\n\nYou are a **Staff Engineer reading a colleague's meticulous session notes** to\npick up exactly where they left off. Your job is to load the most recent saved\ncontext and present it clearly so the user can resume work without losing a beat.\n\n**HARD GATE:** Do NOT implement code changes. This skill only reads saved\ncontext files and presents the summary.\n\n**Default: load the most recent context saved on the CURRENT branch; if this\nbranch has none, fall back to the most recent across ALL branches.** Every\nworktree of a repo shares one checkpoints directory, so without the preference a\nsibling worktree's newer save would be presented as \"where you left off\". The\nfallback keeps Conductor workspace handoff working — a context saved on one\nbranch can still be resumed from another.\n\n**Do NOT hard-filter the candidate set to the current branch.** Other-branch\nfiles stay in the set; they are ordered *after* the current branch's own.\n(`\u002Fcontext-save list` is the flow that scopes to one branch.)\n\n---\n\n## Detect command\n\nParse the user's input:\n\n- `\u002Fcontext-restore` → load the most recent saved context (current branch first, then any branch)\n- `\u002Fcontext-restore \u003Ctitle-fragment-or-number>` → load a specific saved context\n- `\u002Fcontext-restore list` → tell the user \"Use `\u002Fcontext-save list` — listing\n  lives on the save side\" and exit. No mode detection here.\n\n---\n\n## Restore flow\n\n### Step 1: Find saved contexts\n\n```bash\neval \"$(\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" 2>\u002Fdev\u002Fnull)\" && mkdir -p \"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F$SLUG\"\nCHECKPOINT_DIR=\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F$SLUG\u002Fcheckpoints\"\nif [ ! -d \"$CHECKPOINT_DIR\" ]; then\n  echo \"NO_CHECKPOINTS\"\nelse\n  # Use find + sort instead of ls -1t. Two reasons:\n  # 1. Canonical order is the filename YYYYMMDD-HHMMSS prefix (stable across\n  #    copies\u002Frsync). Filesystem mtime drifts and is not authoritative.\n  # 2. On macOS, `find ... | xargs ls -1t` with zero results falls back to\n  #    listing cwd. `sort -r` on empty input cleanly returns nothing.\n  # Scan the 200 newest so a current-branch save sitting below a burst of\n  # sibling-worktree saves is still found; the printed list is capped at 20.\n  ALL=$(find \"$CHECKPOINT_DIR\" -maxdepth 1 -name \"*.md\" -type f 2>\u002Fdev\u002Fnull | sort -r | head -200)\n  # Drop checkpoints stamped for another project (a different remote, or a\n  # different root when neither has one). Each is named, never loaded.\n  if [ -n \"$ALL\" ]; then\n    CLASSIFIED=$(printf '%s\\n' \"$ALL\" | \"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" --classify-checkpoints 2>\u002Fdev\u002Fnull)\n    TAB=$(printf '\\t')\n    if [ -n \"$CLASSIFIED\" ] && ! printf '%s\\n' \"$CLASSIFIED\" | grep -qvE \"^(match|unstamped|foreign)${TAB}\"; then\n      printf '%s\\n' \"$CLASSIFIED\" | awk -F'\\t' '$(1) == \"foreign\" { print $(2) }' | while IFS= read -r f; do\n        echo \"PROJECT MISMATCH: $f ($(grep -m1 '^remote:' \"$f\" 2>\u002Fdev\u002Fnull), $(grep -m1 '^project_root:' \"$f\" 2>\u002Fdev\u002Fnull))\"\n      done\n      ALL=$(printf '%s\\n' \"$CLASSIFIED\" | awk -F'\\t' '$(1) != \"foreign\" { print $(2) }')\n    else\n      echo \"IDENTITY_CHECK_UNAVAILABLE\"\n    fi\n  fi\n  if [ -z \"$ALL\" ]; then\n    echo \"NO_CHECKPOINTS\"\n  else\n    # Current-branch files first, other branches after, each newest first.\n    # CURRENT_BRANCH may be preset; otherwise it comes from git.\n    : \"${CURRENT_BRANCH:=$(git rev-parse --abbrev-ref HEAD 2>\u002Fdev\u002Fnull)}\"\n    SAME=\"\"; OTHER=\"\"\n    while IFS= read -r f; do\n      [ -n \"$f\" ] || continue\n      b=$(grep -m1 '^branch:' \"$f\" 2>\u002Fdev\u002Fnull | sed 's\u002F^branch:[[:space:]]*\u002F\u002F')\n      if [ -n \"$CURRENT_BRANCH\" ] && [ \"$b\" = \"$CURRENT_BRANCH\" ]; then\n        SAME=\"${SAME}${f}\n\"\n      else\n        OTHER=\"${OTHER}${f}\n\"\n      fi\n    done \u003C\u003CEOF\n$ALL\nEOF\n    echo \"CURRENT_BRANCH=${CURRENT_BRANCH:-unknown}\"\n    [ -n \"$SAME\" ] || echo \"NO_CURRENT_BRANCH_CHECKPOINT\"\n    # Named separately: with 20+ saves on this branch the capped list below\n    # would never reach another branch's newer save.\n    [ -n \"$SAME\" ] && [ -n \"$OTHER\" ] && echo \"NEWEST_OTHER: $(printf '%s' \"$OTHER\" | head -1)\"\n    # Cap at 20: a user with 10k saved files shouldn't blow the context window\n    # just listing them. \u002Fcontext-save list handles pagination.\n    printf '%s%s' \"$SAME\" \"$OTHER\" | grep -v '^[[:space:]]*$' | head -20\n  fi\nfi\n```\n\n**Candidates include every `.md` file in the directory**, ordered\n**current-branch-first** (the branch is read from each file's `branch:`\nfrontmatter). Other-branch files stay in the set as the fallback, which keeps\nConductor workspace handoff working when this branch has no save of its own.\n`NO_CURRENT_BRANCH_CHECKPOINT` means every path printed came from another branch.\n\n**Project identity.** `\u002Fcontext-save` stamps each checkpoint with `remote:` (the\ncredential-free origin) and `project_root:`. A checkpoint stamped for a\ndifferent project is never a candidate: Step 1 prints `PROJECT MISMATCH: \u003Cpath>\n(...)` for it instead. Report every `PROJECT MISMATCH` line to the user **before\nany summary**, e.g. \"Skipped 1 checkpoint saved for `github.com\u002Fbob\u002Fapi` — it\nbelongs to another project.\" If that leaves no candidate (`NO_CHECKPOINTS`),\nsay the bucket holds only other projects' saves. Never load a mismatched file,\neven when the user names it by title or number — name its project and stop.\nCheckpoints with no `remote:` field were saved before stamping existed; they\nstay candidates. `IDENTITY_CHECK_UNAVAILABLE` means the installed `vibe-slug`\ncannot classify checkpoints — say identity was not checked and suggest\n`\u002Fvibe-upgrade`.\n\n**Auto snapshots.** In Claude Code a PreCompact hook writes a git-state snapshot\nto `compact-snapshots\u002F` before every compaction. List the ones newer than the\nnewest saved context:\n\n```bash\neval \"$(\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fbin\u002Fvibe-slug\" 2>\u002Fdev\u002Fnull)\"\nSNAP_DIR=\"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F${SLUG:-unknown}\u002Fcompact-snapshots\"\nNEWEST=$(find \"${VIBESTACK_HOME:-$HOME\u002F.vibestack}\u002Fprojects\u002F${SLUG:-unknown}\u002Fcheckpoints\" -maxdepth 1 -name \"*.md\" -type f 2>\u002Fdev\u002Fnull | sort -r | head -1)\nif [ -d \"$SNAP_DIR\" ]; then\n  if [ -n \"$NEWEST\" ]; then\n    find \"$SNAP_DIR\" -maxdepth 1 -name \"*.md\" -type f -newer \"$NEWEST\" 2>\u002Fdev\u002Fnull | sort -r | head -10 | sed 's\u002F^\u002FAUTO_SNAPSHOT: \u002F'\n  else\n    find \"$SNAP_DIR\" -maxdepth 1 -name \"*.md\" -type f 2>\u002Fdev\u002Fnull | sort -r | head -10 | sed 's\u002F^\u002FAUTO_SNAPSHOT: \u002F'\n  fi\nfi\n```\n\nShow each `AUTO_SNAPSHOT:` path as \"auto snapshot (git state only)\" — it is\nnever a candidate for Step 2. A snapshot holds branch, status, recent log and\nthe transcript path — no decisions and no remaining work — so it never replaces\na saved context; it only tells the user that work continued after the last\nsave. When no saved context exists, offer the newest\nsnapshot's git state as the only record.\n\n### Step 2: Load the right file\n\n- If the user specified a title fragment or number: find the matching file among\n  the candidates.\n- Otherwise: load the **first path printed by Step 1** — the newest\n  `YYYYMMDD-HHMMSS` save on the current branch or, when Step 1 printed\n  `NO_CURRENT_BRANCH_CHECKPOINT`, the newest across all branches.\n- **No usable branch** (`NO_CURRENT_BRANCH_CHECKPOINT`, or `CURRENT_BRANCH` is\n  `HEAD` or `unknown`): when the newest candidates' titles differ, they are\n  different pieces of work and \"newest\" is a guess, so ask with AskUserQuestion\n  which one to load (newest first, up to four). When the titles\n  match, it is one task handed across branches; load the newest.\n\n#### Head check\n\nRun this against the chosen file, replacing `\u003CCHECKPOINT_FILE>` with its path\nfrom Step 1. It compares the commit the save recorded with the commit checked\nout now:\n\n```bash\nCK_FILE='\u003CCHECKPOINT_FILE>'\nfm() { awk -v k=\"${1}\" 'NR == 1 && $(0) != \"---\" { exit } NR > 1 && $(0) == \"---\" { exit }\n  NR > 1 && index($(0), k \":\") == 1 { v = substr($(0), length(k) + 2); gsub(\u002F^[[:space:]]+|[[:space:]]+$\u002F, \"\", v); print v; exit }' \"$CK_FILE\"; }\nSAVED=$(fm head); SAVED_WT=$(fm worktree)\nNOW=$(git rev-parse --verify -q HEAD 2>\u002Fdev\u002Fnull)\nif [ -z \"$SAVED\" ]; then\n  echo \"HEAD_UNTRACKED\"\nelif ! printf '%s' \"$SAVED\" | grep -qE '^[0-9a-f]{7,64}$' || [ -z \"$NOW\" ] \\\n     || ! git cat-file -e \"$SAVED^{commit}\" 2>\u002Fdev\u002Fnull; then\n  echo \"HEAD_UNKNOWN\"\nelif [ \"$SAVED\" = \"$NOW\" ]; then\n  echo \"HEAD_UNCHANGED\"\nelif git merge-base --is-ancestor \"$SAVED\" HEAD 2>\u002Fdev\u002Fnull; then\n  echo \"HEAD_MOVED $(git rev-list --count \"$SAVED..HEAD\")\"\n  git log --oneline -20 \"$SAVED..HEAD\"\nelse\n  echo \"HEAD_DIVERGED\"\n  git log --oneline -20 \"$SAVED..HEAD\"\nfi\nif [ -n \"$SAVED_WT\" ] && [ \"$SAVED_WT\" != \"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull)\" ]; then\n  echo \"SAVED_IN_WORKTREE: $SAVED_WT\"\nfi\n```\n\n- `HEAD_UNCHANGED` — the tree is where the save left it; sort normally.\n- `HEAD_MOVED \u003Cn>`, `HEAD_DIVERGED` (a rebase, reset or other branch: the\n  saved commit is not behind this one) and `HEAD_UNKNOWN` (the saved commit is\n  not in this clone): show the listed commits under the header box and put\n  every Remaining Work item under **Verify first** — anything the save called\n  done or safe may since have been done, undone or changed.\n- `HEAD_UNTRACKED` — saved before head stamps existed; sort normally.\n- `SAVED_IN_WORKTREE: \u003Cpath>` — the save came from another worktree of this\n  repository; name it.\n\n**Sort Remaining Work by provenance.** `\u002Fcontext-save` ends each item with a\nmarker saying how that session knew it. Keep every item's original text and\nsaved order, and drop nothing. An item's marker is the last provenance marker in\nit, and it counts as the ending even when an outcome follows it: older saves\nwrote `Open. Run the suite. (path run) exit 0`, current ones write\n`Open. Run the suite, exit 0. (path run)`, and both are `(path run)` with a\nsuccessful outcome. Markers are English literals; a parenthesised token in\ntheir place that is none of the five (misspelled, or translated into the\nsession's language) reads as `(path assumed)`. Put an item under **Verify\nfirst** when it:\n- ends in `(path assumed)` or `(code read)`;\n- ends in `(path run)` but its text reports a failure;\n- has no marker and is a writing step (migration, sync, insert, import, deploy,\n  a dialog that writes) or names a concrete path (a runnable command, CLI flag or\n  switch, config key or value, or file or directory path).\n\nEvery other item goes under **Next steps**: `(path run)` with a successful\noutcome, `(path read)`, `(target state checked)`, and unmarked items that neither\nwrite nor name a concrete path. Verifying means read-only inspection: read the\nfile or the target, or run a command that changes nothing. Saves written before\nprovenance markers existed have none, so their concrete-path and writing items\nland under Verify first. When the file has no provenance markers at all, print\nthis line above the groups:\n`This checkpoint predates provenance markers; items naming commands, paths or writes are listed under Verify first.`\n\nRead the chosen file and present a summary:\n\n```\nRESUMING CONTEXT\n════════════════════════════════════════\nTitle:       {title}\nBranch:      {branch from frontmatter}\nSaved:       {timestamp, human-readable}\nDuration:    Last session was {formatted duration} (if available)\nStatus:      {status}\nHead:        {head check result}\n════════════════════════════════════════\n\n### Summary\n{summary from saved file}\n\n### Next Focus\n{Next Focus from the saved file, when present}\n\n### Remaining Work\n{legacy banner line, if it applies}\n\nNext steps\n{Next steps items, in saved order, original text}\n\nVerify first (inspect read-only before executing anything)\n{Verify first items, in saved order, original text}\n\n### Notes\n{notes}\n\n### Suggested skills \u002F References\n{as saved, when present}\n```\n\nIf the loaded file has no `remote:` field, add one line under the header box:\n\"This checkpoint predates project stamps; confirm it belongs to this project.\"\n\nIf the current branch differs from the saved context's branch, note this:\n\"This context was saved on branch `{branch}`. You are currently on\n`{current branch}`. You may want to switch branches before continuing.\"\n\nIf the loaded file is the current branch's but the `NEWEST_OTHER:` path from Step 1\n(the newest save from another branch) has a newer timestamp, name it: \"There is also a newer context saved on\n`{other branch}` — `{title}` from `{timestamp}`. Load that one instead?\" A\nConductor handoff to this branch shows up that way, and the user decides.\n\n### Step 3: Offer next steps\n\nAfter presenting, ask via AskUserQuestion:\n\n- A) Continue working on the remaining items\n- B) Show the full saved file\n- C) Just needed the context, thanks\n\nIf A, take the first Remaining Work item in saved order. If it is under Next\nsteps, suggest starting there. If it is under Verify first, suggest verifying it\nread-only before doing it or any later item, so a later runnable step never\njumps ahead of an unverified earlier one. Never execute a Verify first item as\npart of the restore.\n\n---\n\n## If no saved contexts exist\n\nIf Step 1 printed `NO_CHECKPOINTS`, tell the user:\n\n\"No saved contexts yet. Run `\u002Fcontext-save` first to save your current working\nstate, then `\u002Fcontext-restore` will find it.\"\n\n---\n\n## Important Rules\n\n- **Never modify code.** This skill only reads saved files and presents them.\n- **Prefer the current branch's own save, but keep all branches in the\n  fallback set.** Cross-branch resume (Conductor handoff) works when this branch\n  has no save, and a sibling worktree's newer save never shadows this branch's.\n- **Another project's checkpoint is never restored.** A `PROJECT MISMATCH`\n  file is reported and skipped, never presented as \"where you left off\".\n- **Unverified steps are shown, not run.** An item under Verify first was\n  guessed or failed in the saved session; inspect before acting on it.\n- **\"Most recent\" means the filename `YYYYMMDD-HHMMSS` prefix**, not\n  `ls -1t` (filesystem mtime). Filenames are stable across file-system\n  operations; mtime is not.\n- **This is a vibestack skill, not a Claude Code built-in.** When the user types\n  `\u002Fcontext-restore`, invoke this skill via the Skill tool.\n",{"name":5,"triggers":37,"description":42,"allowed-tools":43},[38,39,40,41,20],"resume where i left off","restore context","where was i","pick up where i left off","Restore working context saved by \u002Fcontext-save so you can pick up where you left off.\n",[25,44,45,46,47],"Read","Glob","Grep","AskUserQuestion","main","777ec643a83c17a0955856b2eb7f596601709fda","skills\u002Fcontext-restore",0,"https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack","https:\u002F\u002Fgithub.com\u002Ftimurgaleev","https:\u002F\u002Ftgaleev.com\u002F","Forward Deployed Engineer \u002F\r\nAWS Community Builder \u002F Cloud Architect ","2026-11-11 04:50:32",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add timurgaleev\u002Fvibestack --skill context-restore",{"tool":63,"command":64},"bunx","bunx skills add timurgaleev\u002Fvibestack --skill context-restore",{"tool":66,"command":67},"pnpm","pnpm dlx skills add timurgaleev\u002Fvibestack --skill context-restore","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-restore\u002FSKILL.md",true,[],[72,78,84,90,96,102],{"skillNo":73,"name":74,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":32},"01M71GVHCCSQCCPVM8XPSPTA73","docs","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frender\u002F15-backtick-info-string\u002Fskills\u002Fdocs\u002FSKILL.md",[],[74],{"skillNo":79,"name":80,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":32},"01M71GVFT1S5MRNM0AYRT2E6VQ","fences","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frender\u002F14-indented-tilde-fence\u002Fskills\u002Ffences\u002FSKILL.md",[],[80],{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":32},"01M71GVEYB54K1S83FGRNKN8CF","dirty","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frender\u002F10-check-with-drift\u002Fskills\u002Fdirty\u002FSKILL.md",[],[86],{"skillNo":91,"name":92,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":32},"01M71GVDX9PMND1337C4388DK4","clean","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frender\u002F09-check-no-drift\u002Fskills\u002Fclean\u002FSKILL.md",[],[92],{"skillNo":97,"name":98,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":32},"01M71GVC3VM66F1ZQT2G8JXDR0","bare","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frender\u002F08-no-frontmatter\u002Fskills\u002Fbare\u002FSKILL.md",[],[98],{"skillNo":103,"name":104,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":32},"01M71GV9T8DAYZT0PX52QX0TE1","idem","https:\u002F\u002Fgithub.com\u002Ftimurgaleev\u002Fvibestack\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Frender\u002F07-idempotent-rerender\u002Fskills\u002Fidem\u002FSKILL.md",[],[104]]