/scrolls-skills:scrolls-restorefrom scrolls-skills
Restores a docs/.scrolls/ project-memory system from git history, reversing /scrolls-remove. Recovers only agentic memory (scrolls folders + pointer stubs) without rolling back other changes.
Ships in scrolls-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill reverses /scrolls-remove. It brings back only the agentic memory: the scrolls folders, plus the pointer stubs in SCROLLS.md, CLAUDE.md and AGENTS.md. It brings them back into the repository as it is now, and never rolls back anything else. That is the difference from git revert: a revert would conflict with later edits to CLAUDE.md or AGENTS.md, or undo them. This skill adds the stub back into each file instead.
Show the user the plan before applying anything, unless they passed -y/--yes.
All of the logic is in one stdlib-only Python file, scripts/restore.py. restore.sh (bash: macOS, Linux, or Windows with Git Bash/WSL) and restore.ps1 (PowerShell 7+) are thin launchers. They find Python 3.9+ and pass every flag through unchanged. Pick one by what's available: try bash --version, and if that succeeds use .sh. Otherwise use .ps1 via pwsh (preferred), or powershell.exe only if pwsh isn't installed.
/scrolls-restore [<COMMIT>] [-p PATH ...] [-t | -l] [-r]
[--onto REF [-b NEW_BRANCH]] [--full] [-f]
[-n] [-y] [--no-commit]
/scrolls-restore --list [--all]
Read these from the invocation text, in any order.
Source: where the memory comes from.
<COMMIT> (the default). The script uses the newest /scrolls-remove commit in HEAD's history, found by its Scrolls-Action: remove trailer. Its Scrolls-Previous-Commit is the source, and its other trailers say exactly what to put back.
STARTER.md, for example a plain git rm. The plan flags this so the user can check it.<COMMIT> (or --from <COMMIT>). This can be a commit, branch or tag.
Target: where the memory goes.
--onto <REF>: a local branch. The script commits there through a temporary git worktree, then removes it. The current checkout, branch and working tree are never touched. --onto naming the current branch is the same as the default.-b / --branch <NAME>: use with --onto when it names a SHA, tag or remote-tracking ref. The script creates branch NAME at that commit and commits there. Without -b, those refs are refused, because the commit would otherwise end up on no branch. An existing branch name is refused too.Scope: which folders. These are the same flags /scrolls-setup and /scrolls-update use, relative to the current directory.
-p <path> / --path=<path> (repeatable): restore only the folders at this path. The path can be a project folder (<path>/docs/.scrolls), a docs folder (<path>/.scrolls), or the scrolls folder itself.-t / --reporoot: measure from the repository's top level.-l / --local: measure from the current directory. This is the default anyway; with no flag, the script warns when the current directory isn't the repo root.-r / --recurse: restore every folder under the base directory. Without it, only the exact spots above are used. Use -r to undo a /scrolls-remove -r sweep.Other
--full: for pointer files the removal purged (-x), bring back the whole old file instead of just the scrolls stub. This only applies when the file is absent now. If it exists, only the stub is inserted, and the plan says so.-f / --force: replace a scrolls folder that already exists at the target with the source's version. Without it, the script refuses and points the user at /scrolls-update. A folder that exists under the other name (scrolls vs .scrolls) is always skipped, never duplicated. For that case, suggest /scrolls-hide or /scrolls-unhide.--list: list the removal checkpoints, newest first, then stop. Each entry shows its SHA, date, source commit, folders, and whether it has been restored yet.--all: use with --list to search every branch, not just HEAD's history. It only finds checkpoints. To restore one, pass its SHA as <COMMIT>.-n / --dry-run: show the plan only.-y / --yes: skip the confirmation step.--no-commit: stage the changes but don't commit. With --onto, the worktree is left in place and its path is printed.-p, -t and -l are mutually exclusive.
| In the removal commit | Restore does |
|---|---|
Scrolls-Folder | Checks the folder out from the source commit. |
Scrolls-Deleted | If the file is absent now, restores it whole from the source. If it exists, inserts the stub, unless the file already points at the scrolls. |
Scrolls-Stripped | Inserts the stub back into the file as it is now. If the file has since been deleted, recreates it with the stub only. |
Scrolls-Purged | Uses the stub only, by default. --full restores the whole old file if it's absent now. |
Scrolls-Kept, Scrolls-Review, Scrolls-Pruned | Nothing. Those files were never touched, and a pruned docs/ comes back with the folder. |
For an ordinary source commit, each pointer file that had a scrolls stub in that commit gets the same treatment. The stub goes in near the top of the file. If the file opens with a top-level heading, the stub goes under it, and the SCROLLS.md block's own heading becomes a subsection. This is the same placement /scrolls-setup uses.
Run the script without -y, passing the user's flags through:
bash <skill-dir>/scripts/restore.sh [args...]
pwsh <skill-dir>/scripts/restore.ps1 [args...]
The output shows the source and how it was chosen, the target, one line per folder or file, and the exact commit message. Nothing changes yet.
If it exits with an error, report it and stop:
--list (or --list --all), -t, or -r as fits.-b without --onto, --all without --list, or --onto naming a non-branch without -b./scrolls-update, or -f). A path to be written has uncommitted, untracked or ignored changes. Unrelated changes are already staged. A worktree couldn't be opened, for example because the --onto branch is checked out elsewhere. Don't work around any of these yourself; let the user decide.Show the plan and ask before applying. Call out these cases:
-f replacements--fullSkip this step only if the user passed -y/--yes. Stop here if they passed -n.
Run the same command again with -y added. It makes one commit:
maint(memory): scrolls-restored
- restored from: #<source sha>
- removal commit: #<removal sha>
Notes:
- restored folder: docs/.scrolls (from <short sha>)
- restored: SCROLLS.md (file was absent; restored whole from the source)
- inserted: CLAUDE.md (stub re-added near the top; existing content kept)
- target: branch main
Scrolls-Action: restore
Scrolls-Source-Commit: <source sha>
Scrolls-Removal-Commit: <removal sha>
Scrolls-Folder: docs/.scrolls
Scrolls-Restored: SCROLLS.md
Scrolls-Inserted: CLAUDE.md
Some lines change with the source:
removal commit line and Scrolls-Removal-Commit trailer appear only when the source came from a removal commit.deletion commit and Scrolls-Deletion-Commit instead.The trailer kinds are Folder, Replaced, Restored, Created, Inserted, Kept and Skipped. Later runs read Scrolls-Removal-Commit to tell that a checkpoint has been restored. Never reword this message.
If git commit fails (exit 4, usually a hook), the restore is left staged. With --onto, the temporary worktree is kept so nothing is lost. Report the hook output and the git commit -F … command the script printed. Never retry with --no-verify.
This skill never pushes.
Give:
git revert --no-edit <sha>Always finish by suggesting /scrolls-update. The restored memory describes the code as it was at the source commit, not as it is now.
git fetch --unshallow.<COMMIT>. Use --list --all to find it.-p; moving folders to a new location isn't supported.maint isn't a standard Conventional Commits type, so a strict commitlint hook may reject the commit (exit 4).Worked examples are in assets/EXAMPLES.md. Each example has a premise, the usage, caveats, and the expected output. Read that file only when you need it: for example, when a request does not map clearly to the flags above, or when the user asks for an example.
See meta/MAINTAINERS.md for the layout, how to run the tests/ suite, and versioning notes. They are not part of carrying out a user's /scrolls-restore request; don't read or act on meta/MAINTAINERS.md or tests/ while answering one.
CHANGELOG.md (opens in a new tab)README.md (opens in a new tab)agents/openai.yaml (opens in a new tab)assets/EXAMPLES.md (opens in a new tab)meta/MAINTAINERS.md (opens in a new tab)scripts/restore.ps1 (opens in a new tab)scripts/restore.py (opens in a new tab)scripts/restore.sh (opens in a new tab)tests/test_restore.ps1 (opens in a new tab)tests/test_restore.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
Generated from the plugin's indexed repository (sugatoray/aiskills) — no native marketplace selected
npx claudepluginhub p/sugatoray-scrolls-skills-skills-scrolls9 skills in this plugin
/scrolls-compactCompacts the history in a docs/.scrolls/ (or docs/scrolls/) project-memory system at a point in time, and saves a git checkpoint of everything it condenses. Condenses the parts of SPEC.md, PLAN.md, HANDOFF.md, GAP_ANALYSIS.md and GAP_CONTEXT.md that git blame shows are older than a compaction base — by default the newer of 7 days ago and the 20th-latest first-parent commit on main/master — while open tickets, open gaps and HANDOFF's open threads always stay word for word. Records ONE commit whose message names the checkpoint (the commit just before the compaction), writes compacted/scrolls_compact_<yyyymmdd>_<githash>.md with one marker section per compacted file, adds a row to COMPACT.md's Compaction History table, lists COMPACT.md in STARTER.md, and tags the checkpoint. --list, --show and --extract read old history back out of git. Use this only when the user runs /scrolls-compact, or explicitly asks to compact, condense, prune or checkpoint the scrolls / project memory history. Supports --before=YYYYMMDD, --base=COMMIT, --keep-days=N, --keep-commits=N, --trunk, --include/--exclude, -p/--path, -t/--reporoot, -l/--local, -r/--recurse, -n/--dry-run, -y/--yes, --no-commit and --no-tag. Refuses to run when the scrolls folder has uncommitted changes, since the checkpoint would not contain them. Works on macOS, Linux, and Windows (bash or PowerShell)./scrolls-explainerShows, copies or rebuilds scrolls-explainer.html: an interactive, offline page that explains how the scrolls skill family works (/scrolls-setup, /scrolls-update, /scrolls-hide, /scrolls-unhide, /scrolls-remove, /scrolls-restore, /scrolls-help) — one tab per command that animates, step by step, what the command does to docs/.scrolls/, SCROLLS.md, CLAUDE.md, AGENTS.md and git, with a callout explaining each step, a tab for how a new agent session reads the memory, and full keyboard navigation (arrows step, [ ] or digits switch tabs, Space pauses, ? lists shortcuts). Use this whenever the user runs /scrolls-explainer, or asks for a visual, diagram, animation, walkthrough, explainer or interactive page of how the scrolls commands or the scrolls memory work, or wants something to show a team. By default (same as --show) it opens the bundled page in place and copies nothing; -o/--output copies it to a file or folder (-o . for ./scrolls-explainer.html), -f/--force overwrites with -o, --open opens the copy, and --build to regenerate the bundled page from the scrolls-* skills as they are now (their tabs, lockstep version, and a review check when a SKILL.md changed). Works on macOS, Linux, and Windows (bash or PowerShell)./scrolls-helpShows a crisp, example-driven reference for the whole scrolls skill family (/scrolls-setup, /scrolls-update, /scrolls-hide, /scrolls-unhide, /scrolls-remove, /scrolls-restore, /scrolls-compact, and the /scrolls-explainer page) — what each command does, their shared -p/-t/-l/-r/-u/-x/--onto/--before/--base flags, and common usage examples (new project, monorepo, running from a subdirectory, toggling hidden/visible, removing and restoring scrolls, compacting old history). Use this whenever the user runs /scrolls-help, or asks what the scrolls commands do, how to use them, what flags they take, which one they need, or seems unsure about docs/.scrolls setup — even if they only name one of the seven commands rather than 'scrolls' generally. Supports -e/--online to render it as a styled page served on an OS-assigned localhost port instead of chat text, with light/dark and colorize/plain toggles. Works on macOS, Linux, and Windows (bash or PowerShell)./scrolls-hideConverts an already-set-up docs/scrolls/ working-memory folder from visible (scrolls) to dotfile-hidden (.scrolls), renaming the folder and rewriting the path references inside it and in SCROLLS.md so nothing breaks. Use this whenever the user runs /scrolls-hide, or asks to hide, dot, or re-hide the scrolls folder, go back to hiding project memory / docs/.scrolls, or rename scrolls to .scrolls. This is the retrofit path for a project that was set up visible and now wants it hidden — for a brand-new project, /scrolls-setup's default (no -u/--unhide flag) already creates it hidden and this skill isn't needed. By default checks one exact location (docs/scrolls under the current directory); supports -r/--recurse to sweep an entire directory tree instead (e.g. every package in a monorepo in one run), repeatable -p/--path to target specific locations, -t/--reporoot to target the git repository's top level regardless of which subdirectory you're in, -l/--local to target the current directory explicitly, and the DEFAULT_SCROLLS_RELPATH environment variable to change the default location. Works on macOS, Linux, and Windows (bash or PowerShell). The opposite of /scrolls-unhide./scrolls-removeRemoves a docs/.scrolls/ (or docs/scrolls/) project-memory system from a git repository — the exact opposite of /scrolls-setup. Deletes the scrolls folder, deletes SCROLLS.md, strips the scrolls pointer stub out of CLAUDE.md (and the dangling pointer out of AGENTS.md), deleting either file outright only when nothing else is left in it, and records the whole removal as ONE git commit whose message names the commit just before the removal, so it can always be undone. Use this whenever the user runs /scrolls-remove, or asks to remove, delete, uninstall, tear down, or get rid of the scrolls / project memory / docs/.scrolls. Supports -p/--path (repeatable), -t/--reporoot, -l/--local, -r/--recurse to find and remove every scrolls folder under a directory in one commit, -x/--purge [CLAUDE.md|AGENTS.md|SCROLLS.md|<other file>|all] to delete pointer files outright even when they hold other content, -n/--dry-run, -y/--yes to skip the confirmation, and --no-commit. Refuses to run when anything it would remove has uncommitted changes, since those could not be restored. Works on macOS, Linux, and Windows (bash or PowerShell)./scrolls-setupSets up a minimal docs/.scrolls/ working-memory system for a project — a small set of cross-session memory files (STARTER.md, SPEC.md, HANDOFF.md, GAP_ANALYSIS.md, GAP_CONTEXT.md, PLAN.md, WISDOM.md) plus a SCROLLS.md file that points future sessions at STARTER.md, a short CLAUDE.md pointer to SCROLLS.md, and a matching AGENTS.md pointer to CLAUDE.md for other agent harnesses. Use this whenever the user runs /scrolls-setup, or asks to set up 'scrolls', a project-memory system, session handoff notes, a docs/.scrolls folder, or a CLAUDE.md/AGENTS.md/SCROLLS.md that points new sessions at persistent project docs. Trigger even if the project has no docs/ folder, no CLAUDE.md, no AGENTS.md, or no SCROLLS.md yet — creating them is part of the job. Supports -p/--path for a custom docs location, -t/--reporoot to pin everything to the git repository's top level regardless of which subdirectory you're in, -l/--local to pin it explicitly to the current directory, -r/--recurse to scan recursively for an existing scrolls folder before creating a new one (avoiding accidental duplicates), and -u/--unhide to name the folder scrolls instead of .scrolls. Defaults to the current directory, but warns first if that differs from the repo root so a subdirectory invocation doesn't silently create a second, disconnected scrolls system. Works on macOS, Linux, and Windows (bash or PowerShell).