agentleFS
Peter-MoriartyPeter-Moriarty/claude-code-multi-machine-setup/skills/machine-move/SKILL.md

machine-move

Skill1 starsChanged 9 months agoMITView on GitHub

Pre-flight check OR new-machine setup. Audits git sync, local state, and portability across all repos. Triggers on: machine move, move computer, switch machine, pre-flight check, sync check, portability check, new computer, setup machine, receiving machine

  • Reads credentials
  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. itgenius-au/skills-library★ 1100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 15 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask the user which mode if ambiguous.

    line 15
  2. Distinctive:

    Run this before switching to a new machine to ensure nothing is left behind.

    line 24
  3. Distinctive:

    Check every repo for uncommitted work, stashes, local branches, and unpushed commits.

    line 28
  4. Distinctive:

    Check for local-only files and config that wouldn't survive a machine move.

    line 85
  5. Distinctive:

    Verify ALL files in the Claude Code auto-memory directory are symlinks pointing to git-tracked repo files.

    line 89
  6. Distinctive:

    Auto-memory dir = symlinks only: Every file must symlink to a git-tracked file.

    line 133
  7. Very specific:

    Periodic audit: Run ls -la on the auto-memory dir after any session that creates new topic files.

    line 134
  8. Distinctive:

    ALL project-specific knowledge: architecture, deployment, infra details

    line 151
  9. Distinctive:

    The test: Before adding something to MEMORY.md, ask: "Will this prevent a mistake or save a tool call in >50% of conversations?" If no, it …

    line 155
  10. Very specific:

    Check all wrapper scripts created by your setup-mcp.sh:

    line 177
  11. Distinctive:

    Run this on the NEW machine after cloning the repo.

    line 227
  12. Distinctive:

    Verify required tools are installed:

    line 231
  13. Distinctive:

    If critical tools are missing:

    line 244
  14. Distinctive:

    Do NOT proceed with setup scripts until prerequisites are met.

    line 252
  15. Distinctive:

    Check auth state and guide through login if needed:

    line 256
  16. Distinctive:

    Run your setup scripts in order.

    line 265
  17. Distinctive:

    Run the same Phase 2 checks from Sending mode to confirm everything works.

    line 281

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “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

Machine Move

Two modes:

  1. Sending (pre-flight audit) - run on the OLD machine before moving. Checks for uncommitted/unpushed work and local-only state.
  2. Receiving (new machine setup) - run on the NEW machine after cloning the repo. Runs setup scripts, pulls all repos, verifies environment.

Mode Detection

Ask the user which mode if ambiguous. Otherwise infer:

  • "pre-flight", "before move", "check sync" -> Sending
  • "new computer", "just set up", "receiving", "just opened here" -> Receiving
  • "machine move" with no qualifier -> Ask

SENDING MODE - Pre-Flight Audit

Run this before switching to a new machine to ensure nothing is left behind. Checks all repos for uncommitted/unpushed work, then audits local-only state.

Phase 1: Git Sync Audit

Check every repo for uncommitted work, stashes, local branches, and unpushed commits.

Repos to check

Parent + all child directories. Adapt this list to your setup-subprojects.sh:

# CONFIGURE: List your child project directories
REPOS="child-project-1 child-project-2 child-project-3"

For each repo, run these checks

From the parent directory:

PARENT_DIR="$(pwd)"

# Parent repo
echo "=== $(basename "$PARENT_DIR") (parent) ==="
git fetch --quiet 2>&1
git status -s                                    # Uncommitted changes
git stash list                                   # Stashed work
(git branch -vv | grep -v '\[origin/' || true)   # Local-only branches
git log --all --not --remotes --oneline          # Unpushed commits on ANY branch

# Each child repo
for dir in $REPOS; do
  if [ -d "$dir/.git" ]; then
    echo "=== $dir ==="
    cd "$dir"
    git fetch --quiet 2>&1
    git status -s
    git stash list
    (git branch -vv | grep -v '\[origin/' || true)
    git log --all --not --remotes --oneline
    cd "$PARENT_DIR"
  else
    echo "=== $dir === MISSING (not cloned)"
  fi
done

Output format

Present results as a summary table:

RepoUncommittedStashesLocal BranchesUnpushed
parentclean0none0
child-1clean0none0
...............

Flag any non-clean rows clearly.

Phase 2: Local State & Portability Audit

Check for local-only files and config that wouldn't survive a machine move.

2a. Memory symlinks and topic file portability

Verify ALL files in the Claude Code auto-memory directory are symlinks pointing to git-tracked repo files. Plain files in the auto-memory directory are NOT portable - they'll be lost on machine move.

# Find your auto-memory directory
# Cache key = absolute repo path with / replaced by - and prefixed with -
REPO_PATH="$(pwd)"
CACHE_KEY="-$(echo "$REPO_PATH" | sed 's|^/||; s|/|-|g')"
AUTOMEM="$HOME/.claude/projects/$CACHE_KEY/memory"

echo "=== Auto-memory directory ==="
ls -la "$AUTOMEM/"

echo ""
echo "=== Checking each file ==="
for f in "$AUTOMEM"/*; do
  name=$(basename "$f")
  [[ "$name" == ".DS_Store" ]] && continue
  if [ -L "$f" ]; then
    target=$(readlink "$f")
    if [ -f "$target" ]; then
      echo "OK: $name -> $target"
    else
      echo "BROKEN: $name -> $target (dangling symlink)"
    fi
  elif [ -f "$f" ]; then
    echo "LOOSE: $name (plain file - NOT portable! Move to repo memory/ and symlink)"
  fi
done

Fix for loose files: Move the file into the repo's memory/ directory, replace with symlink:

mv "$AUTOMEM/loose-file.md" "$(pwd)/memory/"
ln -s "$(pwd)/memory/loose-file.md" "$AUTOMEM/loose-file.md"
git add memory/loose-file.md

Memory Maintenance Philosophy

The auto-memory system loads MEMORY.md into every conversation. To keep context budgets lean:

  1. MEMORY.md = guardrails + pointers (~80 lines max). Only keep: identity, preferences, critical guardrails that prevent mistakes, and 1-line pointers to topic files. No lookup data.
  2. Topic files = reference data (in repo memory/). Account IDs, API patterns, credential locations, project-specific conventions. Read on-demand when relevant.
  3. Child project memory (in {child}/memory/). ALL project-specific knowledge lives in the child. Parent MEMORY.md should never duplicate child memory.
  4. Auto-memory dir = symlinks only. Every file must symlink to a git-tracked file. No plain files, no backups, no loose state.
  5. Periodic audit: Run ls -la on the auto-memory dir after any session that creates new topic files. Check for plain files that need symlinking.

When to Store Inline vs. Link to Reference

Store inline in MEMORY.md (loaded every conversation):

  • Identity, personality, communication preferences - used in every interaction
  • Critical guardrails that prevent mistakes
  • The single most-used ID per service if frequently referenced
  • 1-line pointers to topic files with the keyword that triggers reading them

Store in topic files (read on-demand via pointer):

  • Full account ID lists, credential inventories, secret names
  • API patterns, curl examples, endpoint tables
  • Project-specific conventions, gotchas, and lessons learned
  • Anything only relevant when actively working in that domain

Store in child project memory (only loaded when working in that directory):

  • ALL project-specific knowledge: architecture, deployment, infra details
  • Project-specific credentials and API access
  • Lessons learned from working in that project

The test: Before adding something to MEMORY.md, ask: "Will this prevent a mistake or save a tool call in >50% of conversations?" If no, it belongs in a topic file or child project memory.

Duplication rule: Information should exist in exactly one canonical location. MEMORY.md can contain a guardrail summary + pointer, but never a full copy of what's in a topic or child file.

2b. Claude credentials

[ -f ~/.claude/.credentials.json ] && echo "Claude credentials: OK" || echo "Claude credentials: MISSING (will re-auth on launch)"

2c. Cloud provider authentication

# Example for gcloud - adapt to your provider
gcloud auth list 2>/dev/null

# Check Application Default Credentials
[ -f ~/.config/gcloud/application_default_credentials.json ] && echo "ADC: OK" || echo "ADC: MISSING"

2d. MCP wrapper scripts

Check all wrapper scripts created by your setup-mcp.sh:

# CONFIGURE: List your wrapper scripts
WRAPPERS="gsm-env"
for w in $WRAPPERS; do
  [ -x ~/.local/bin/$w ] && echo "OK: $w" || echo "MISSING: $w"
done

Fix: ./scripts/setup-mcp.sh

2e. Claude Code settings

[ -f ~/.claude/settings.json ] && echo "settings.json: OK" || echo "settings.json: MISSING"

This file may contain absolute paths (MCP registrations). Check for hardcoded paths:

grep -c "$HOME" ~/.claude/settings.json 2>/dev/null && echo "(paths reference current home dir)"

Phase 3: Summary & Actions

If everything is clean

Report: "All repos synced. Local state is portable. Safe to move."

Print the new machine setup commands:

# On new machine, after cloning the repo:
./scripts/setup-memory.sh         # Create memory symlinks
./scripts/setup-mcp.sh            # Install MCP servers + wrappers
cp config-backup/global/settings.json ~/.claude/settings.json

If issues found

List each issue with:

  1. What's wrong (e.g., "child-project-2 has 2 uncommitted files")
  2. The fix action (e.g., "commit and push")

Offer to fix git issues (commit + push dirty repos) but always ask for approval first - these are irreversible actions.


RECEIVING MODE - New Machine Setup

Run this on the NEW machine after cloning the repo. Runs setup scripts, pulls everything to latest, verifies the environment is fully functional.

Step 1: Check Prerequisites

Verify required tools are installed:

echo "=== Prerequisites ==="
for cmd in node npm npx python3 gcloud claude git gh; do
  if command -v "$cmd" &>/dev/null; then
    echo "OK: $cmd ($(command -v $cmd))"
  else
    echo "MISSING: $cmd"
  fi
done

If critical tools are missing:

# macOS (Homebrew):
brew install node python pipx uv gh
brew install --cask google-cloud-sdk
npm install -g @anthropic-ai/claude-code

Do NOT proceed with setup scripts until prerequisites are met.

Step 2: Cloud Provider Authentication

Check auth state and guide through login if needed:

# CONFIGURE: Your cloud auth commands
gcloud auth list 2>/dev/null

Step 3: Run Setup Scripts

Run your setup scripts in order. Each is idempotent.

./scripts/setup-subprojects.sh    # Clone/pull child repos (if applicable)
./scripts/setup-memory.sh         # Create MEMORY.md symlinks
./scripts/setup-mcp.sh            # Install MCP + register servers

Step 4: Restore Global Settings

cp config-backup/global/settings.json ~/.claude/settings.json

Step 5: Verify Environment

Run the same Phase 2 checks from Sending mode to confirm everything works.

Present as a checklist:

CheckStatusAction Needed
Memory symlinksOK / MISSING./scripts/setup-memory.sh
Claude credentialsOK / MISSINGWill auth on first launch
Cloud authOK / MISSINGProvider login command
MCP wrappersOK / N MISSING./scripts/setup-mcp.sh
settings.jsonOK / MISSINGcp config-backup/global/settings.json ~/.claude/

Step 6: Summary

If everything passed

Report: "New machine fully set up. All repos cloned and up to date. MCP servers registered. Restart Claude Code to load MCP servers."

Remind about first-use OAuth flows:

# These will trigger OAuth in browser on first use:
# - google-drive, google-workspace, wordpress, etc.
# - Any MCP server that uses browser-based OAuth

If issues remain

List each with the fix action. Offer to re-run specific setup scripts if needed.

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.