agentleFS
GiuseppeBellamacinaGiuseppeBellamacina/claude-code-sync/skills/pull/SKILL.md

pull

Skill1 starsChanged 53 days agoMITView on GitHub

Restore a personal Claude Code setup from a local sync folder created by push (or, with --cloud, from the Artifact that push published), on a new OR an already configured machine (overwrite, replace everything, or ask item by item), then run the external-tool instructions. Use when the user runs /setup-sync:pull.

  • Pipes a download into a shell

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ingest, setup and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Google CloudSkill

    ingest

    Extracts, distills, and compiles raw sources (PPTX slide decks, PDFs, Word docs, Excel sheets, web URLs, transcripts, codebases, or raw/ directories) into persistent, structured Knowledge Compiler markdown wikis following the Open Knowledge Format (OKF v0.2) and Andrej Karpathy LLM-Wiki standard. Use when the user invokes /ingest, asks to ingest raw files or a target path, compile knowledge, update the wiki, or extract unstructured files into markdown knowledge bases. Don't use for retrospectively compiling the active chat conversation without external files (use distill-session) or for read-only vault lookups (use vault-query).

    Also in 3 projects that use this

  • VercelSkill

    setup

    Set up Vercel CLI and project configuration. Use when the user says "set up Vercel", "configure Vercel", "link to Vercel", or "vercel init".

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

  • NVIDIASkill

    research

    Before designing a feature, research how comparable libraries solve the problem, check best practices, known pitfalls, and upstream changes. Use when starting a new feature, investigating an unfamiliar area, or the user asks to research something.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    leave something alone: --exclude <selectors>.

    line 29
  2. Very specific:

    Write the answers to a JSON file outside the sync folder, {"<id>": "snapshot" | "local" | "remove" | "both"}.

    line 66
  3. Very specific:

    Ask the user before anything needing login, a secret, curl | sh/iex style installers, or a system-wide install.

    line 84
  4. Very specific:

    Never invent secrets: for items reported as secret, ask the user for the value or leave it for them.

    line 85
  5. Distinctive:

    Check hooks/statusLine entries that point at machine-specific absolute paths and fix or report them.

    line 86
  6. Very specific:

    Write pull-report.md into the backup folder (~/.claude/backups/pre-sync-<timestamp>/, so it survives deleting the sync folder) with the …

    line 109

“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sync pull

Parse $ARGUMENTS: an optional folder (default ~/.claude-sync), an optional mode flag and an optional --cloud [artifact-link]. With --cloud, do the cloud fetch below first. If the folder has no manifest.json, stop and say so. In the commands below <script> is ${CLAUDE_PLUGIN_ROOT}/scripts/apply.mjs (if ${CLAUDE_PLUGIN_ROOT} was not expanded, it is under ~/.claude/plugins/cache/cosmic-plugins/setup-sync/).

Before step 0: fetch the snapshot from the cloud (only with --cloud)

The push published the whole snapshot as one HTML page (an Artifact titled Setup Sync Snapshot). Rebuild the folder from it:

  1. Find it: use the link in the arguments, or Artifact with action: "list" and look for the title Setup Sync Snapshot. If there are several, ask which one (show the last-updated times). If there is none, say so and stop; the push must be run with --cloud first.
  2. Download it: Artifact with action: "read", the url, and path: "index.html". It saves the page to a local file and tells you where. (If the result names a saved file for the full page instead, use that.)
  3. Unpack it into the sync folder:
    node "${CLAUDE_PLUGIN_ROOT}/scripts/unpack.mjs" --html "<saved page>" --dir "<folder>"
    It checks every file against its checksum, refuses paths that could escape the folder and refuses to overwrite a folder that is not a previous snapshot. It prints what it restored. On any error stop and report it; do not edit the page by hand.
  4. Continue with step 0 using that folder (the <script> of the later steps is still apply.mjs). The page is the user's own snapshot, but it still carries shell instructions: step 4 applies as usual.

0. Understand what the user asked

Besides the folder and a mode flag, $ARGUMENTS may hold a request in plain words, in any language: "don't touch my MCP servers", "only restore plugins and settings", "keep my CLAUDE.md", "skip the tool installation", "ask me about conflicts". Turn it into flags:

  • leave something alone: --exclude <selectors>; restore only some things: --only <selectors>.
  • Categories: plugins, marketplaces, mcp, settings (top-level setting names), hooks, skills, agents, commands, output-styles, themes, workflows, mods, claude-md, keybindings, extra. A selector is a category or category:name for one item (mcp:docs-langchain, plugin:ponytail, settings:theme, agents:reviewer.md).
  • "Ask me about conflicts" means the Ask mode; "wipe everything and use the snapshot" means Replace; "skip the tool installation" means skip step 4 and report it as skipped.
  • Pass the same flags to every script call below (--plan, apply, --verify). What the push itself left out is recorded in the snapshot and respected automatically: replace never deletes local data in a category the push did not cover.

Say your interpretation in one line before running. Ask only when the request is really ambiguous.

1. Look before touching anything

node "<script>" --dir "<folder>" [--exclude ...] [--only ...] --plan

It changes nothing and prints counts and the non-identical items, each with an id, a status and short snapshot/local values:

  • new: only in the snapshot. same: identical (not listed). conflict: both sides, different.
  • localOnly: only on this machine. secret: the snapshot value was redacted, never overwritten.

Item ids: marketplace:<n>, plugin:<id>, mcp:<n>, <dir>/<name> (skills, agents, commands, output-styles, themes, workflows, mods), file:CLAUDE.md, file:keybindings.json, settings.<key>[.<subkey>].

2. Pick the mode

  • Fresh machine (no conflict and no localOnly items): no question, use overwrite.
  • A flag in the arguments decides: --overwrite, --replace, --ask.
  • Otherwise tell the user how many items are new / conflicting / local-only, and ask with AskUserQuestion:

    1. Overwrite (default, recommended): the snapshot wins on conflicts, everything only on this machine is kept.
    2. Replace everything: this machine ends up exactly like the snapshot; local-only items are removed.
    3. Ask me item by item: specific questions for each doubt.

    Mention that a full backup is taken automatically either way.

Replace

List every localOnly item that would be removed (plugins, MCP servers, skills, settings keys...) and get one more explicit confirmation. Never remove anything the user did not see listed. setup-sync itself, the claude-plugins-official marketplace and skills owned by external tools are always kept.

Ask

Turn conflict and localOnly items into a few concrete questions (AskUserQuestion, at most 4 per call, repeat as needed). Each question names the item and shows both values, with options such as Use snapshot / Keep local; for files add Keep both (puts the snapshot copy next to the local one as <name>.synced); for localOnly use Keep / Remove. Group long homogeneous lists (e.g. many settings.enabledPlugins.*) into one question first, and drill down only if the user wants. new items are applied unless the user says otherwise (answer local to skip one). For text files with conflicts (CLAUDE.md), offer to merge: pick Keep both, then merge the two files yourself, show the result, and delete the .synced copy only after the user agrees.

Write the answers to a JSON file outside the sync folder, {"<id>": "snapshot" | "local" | "remove" | "both"}; items not mentioned follow the overwrite rule.

3. Apply

node "<script>" --dir "<folder>" [--mode replace] [--decisions <file>] [--exclude ...] [--only ...]

If the plan lists extra:* items, they are files the user asked to sync from outside ~/.claude and will be written at the same place in the home folder. Show each target path and get an explicit OK first; leave out (--exclude extra:<path>) any the user does not confirm.

It backs up first (~/.claude/backups/pre-sync-<timestamp>/: settings, CLAUDE.md, keybindings, skills/agents/commands/mods..., MCP servers, marketplaces, plugin list), then adds marketplaces, installs plugins, adds/replaces user MCP servers, copies files, copies mods to ~/.claude/mods/<name> and registers them in CLAUDE_CODE_PLUGIN_DIRS, and writes settings.json last. Show the user the report (ok / skipped / failed / warnings) and the backup path. If warnings is not empty, the snapshot came from another operating system and those items (typically a statusLine/hook command, or an MCP server started with cmd /c) probably will not work here: for each one ask the user whether to keep it, skip it, or adapt it (e.g. drop the cmd /c wrapper on macOS/Linux), and apply the answer. In addition, and say that restoring means copying files back from it.

4. Run <folder>/externals.md (your job)

First read the whole file and show the user the list of commands it would run (one line each) and the MCP server commands the apply step registered, and get one explicit confirmation before executing anything. A snapshot is code: it installs plugins from the marketplaces it names, registers MCP servers that run commands, and carries shell instructions, so if the folder did not come from the user's own push (a shared drive, a downloaded repo), say so and recommend reading manifest.json and externals.md first. Refuse to run commands that have nothing to do with setting up Claude Code or its tools.

Then execute each item in order, prerequisites first, and run its verify command after each one. On a machine that already has some of these tools, check first and skip what is already installed and working. If the plan's platform.snapshot differs from platform.local, the commands were written for another OS: translate them (winget ↔ brew / apt / dnf, PowerShell ↔ sh, .exe names, path separators), tell the user which ones you changed, and confirm them before running.

  • Ask the user before anything needing login, a secret, curl | sh/iex style installers, or a system-wide install. Skip an item rather than guess when its instructions look stale or wrong, and say why.
  • Never invent secrets: for items reported as secret, ask the user for the value or leave it for them.
  • Check hooks/statusLine entries that point at machine-specific absolute paths and fix or report them.
  • For each mod, run the setup its entry lists (dependencies, binaries), then claude plugin validate ~/.claude/mods/<name> and report the result.
  • Per-project steps (e.g. /graphify .) are only mentioned, not run.

5. Verify (do not skip)

Re-run the comparison against the machine as it is now, with the same flags the apply used:

node "<script>" --dir "<folder>" [--mode replace] [--decisions <file>] [--exclude ...] [--only ...] --verify

Exit code 2 means something is wrong. Read the output:

  • mismatches: items that were meant to change but still differ. Try once to fix the cause (a failed command is in the apply report), re-run apply for them, verify again; if it still fails, report it as not synced, with the error.
  • intentionallyKept: what the user chose to keep local. Not a failure, list it as kept.
  • needsUser: secrets the user must enter by hand.
  • checks: settings parse, mods registered in CLAUDE_CODE_PLUGIN_DIRS, backup exists.

Then verify what the script cannot see, with real commands: each external tool from externals.md answers its verify command, each mod passed claude plugin validate, hook/statusLine commands point at paths that exist.

6. Report and checklist

Write pull-report.md into the backup folder (~/.claude/backups/pre-sync-<timestamp>/, so it survives deleting the sync folder) with the full detail below, then show the user the compact chat version (see Chat format after the checklist):

# Setup Sync, pull report (<date>, <OS>, mode: overwrite|replace|ask)
## Synced        counts by kind (marketplaces, plugins, MCP servers, files, mods, settings entries, externals installed)
## Kept          what the user chose to keep local, and local-only items that were left alone
## Removed       what replace/ask removed (empty otherwise)
## Not synced    each item, the error or reason, and how to fix it
## Needs you     secrets to enter, logins, a new session to start
## Checklist
- [x] backup taken (path)
- [x] marketplaces and plugins installed, on/off state matches the snapshot
- [x] MCP servers present
- [x] files, agents, skills, styles, themes, workflows copied
- [x] mods copied, registered in CLAUDE_CODE_PLUGIN_DIRS, claude plugin validate passed
- [x] settings.json written and parses
- [x] every external tool installed and its verify command passed
- [x] verify run: no unexpected leftovers
- [ ] new session started so MCP servers and mods load   <- always left for the user

Tick a box only with evidence from the verify output or a command you ran; otherwise leave it [ ] with the reason.

Chat format (what the user reads)

The file is the full record; in chat give a compact, scannable version, not the file pasted. Use this shape, omitting any block that would be empty:

## Setup Sync · pull {✅ done | ⚠️ done with N issues | ❌ failed}
`<folder>` · <date> · <OS>{ · mode: <mode>}

| Synced | |
| --- | --: |
| Marketplaces | 3 |
| Plugins | 19 |
| ... one row per kind that has items | n |

**Verification**
| Check | Result |
| --- | --- |
| Snapshot matches this machine | ✅ 0 differences |
| Secrets scan | ✅ 0 hits |
| ... one row per check that ran | ✅ / ⚠️ / ❌ + a few words |

**⚠️ Needs attention**
- `<item>`: <reason>. Fix: <one line>

**Next:** <the one thing to do now>

Rules: status emoji ✅ ⚠️ ❌ only; counts live in the table, not in prose; one line per issue, always with its fix; list kinds that have nothing in a single line ("None on this machine: skills, agents, mods"); never ✅ for something not verified (use ⚠️ and say why); no paragraphs, no repeating the checklist verbatim, end with the file path of the full report.

Remind that /reload-plugins applies plugin changes now, but new MCP servers and newly registered mods need a new session (mods load through CLAUDE_CODE_PLUGIN_DIRS, read at startup).

7. Clean up

Ask whether to delete the sync folder; with --cloud, also ask whether to delete the Artifact that held the snapshot (Artifact with action: "delete" and its url, only after an explicit yes, and say that the link stops working for everyone). Delete only after an explicit yes, only the exact folder used, and keep it if anything is under Not synced or Needs you so the pull can be re-run. The backup folder in ~/.claude/backups/ (which holds the report) is separate and is never deleted by this skill.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.