Move a Claude Code workspace to a new Mac

Source on GitHub n-uf/claude-machine-transfer (opens in a new tab)

machine-transfer is a Claude Code skill that helps you move a Claude Code workspace to a new Mac without losing work in flight. A busy workspace is more than files. It has lead sessions that run child sessions, branches with unpushed commits, sidebar sections, memory and skills in ~/.claude, scheduled tasks and signed-in tools.

Copying the disk moves the files and loses the rest. So the skill moves the workspace by fresh restarts. Each lead session writes down where it stands. A successor session on the new Mac checks that record against git and takes over. The old session goes idle and stays in the sidebar as history.

A lead session is a top-level session that owns a scope, such as an app or a set of repos. The skill covers a move from one Mac to another, with the Claude desktop app and Remote Control.

How a move works, one wave at a time

You move one sidebar section at a time. The skill calls that a wave. Start with a quiet one to prove the method.

  1. Take stock. List every open session by sidebar section. scan-workspace.sh inventories each folder two levels down; scan-unpushed.sh lists folders with no remote and commits that are on no remote.
  2. Agree the layout. Decide what moves now, what waits, and how files travel.
  3. Prepare the new Mac. Same folder paths (and the same user name, if you can), matching tool versions, gh signed in over HTTPS, sidebar sections in the same order.
  4. Push everything to remotes. A folder with no remote becomes a private repo after a secret scan. A branch that can't be pushed goes into a git bundle.
  5. Freeze and hand off. Each lead session reaches a safe point, pushes its branches with no force, and writes a handoff note, a branch ledger (every branch and its commit) and a handover message. scan-unpushed.sh must print nothing. Then the wave stops shipping, merging, pushing and publishing.
  6. Carry over. Repos are cloned from GitHub over HTTPS. Everything else travels as a sealed archive: scanned with gitleaks, listed in a checksum manifest, and encrypted with age when it's private.
  7. Restart sessions. A successor starts on the new Mac with Remote Control on and waits for its handover. It runs check-heads.sh against the ledger. Any mismatch stops it, and it doesn't reset anything to make the numbers fit. When every branch matches, it replies "ready" and restarts its own child sessions from the handoff note.
  8. Verify and switch. Run one real flow end to end on the new Mac, such as a test suite or a dev server. Lift the freeze, then move the next wave.

Moving files without opening SSH

By default the skill doesn't turn on SSH or Remote Login between the two Macs. SSH gives the whole user account to the other side: every file, every signed-in tool, any program. It uses two bridges instead.

  • GitHub. A private repo holds small files with no secrets: notes, briefs, scripts. Private files go as age-encrypted archives on a private release, encrypted to a key that is made on the new Mac and never leaves it.
  • Syncthing. For large folders, or ones you keep working in until the switch. Pair the Macs by device ID. Share the folder send-only from the old Mac and receive-only on the new one, at the same absolute path. Turn off relaying, global discovery and NAT traversal so it stays on your LAN.

AirDrop and a USB drive are fallbacks for one-off files.

What went wrong in the real move

The skill came out of a real move of a workspace with many sessions. These failed along the way, and the checklist now covers each one.

  • A fresh gh auth login lacks the read:packages scope, so every install from npm.pkg.github.com fails with a 403. gh auth refresh -h github.com -s read:packages fixes it.
  • Headless Chrome dies with path_service … Failed to get the path for 1001 until you've opened Google Chrome once from Finder.
  • The Claude desktop app won't start sessions from a turn that another session's message began. You type the go yourself, in the entry session on the new Mac.
  • A session with Remote Control off can't see or message sessions on the other Mac, so its handover goes into a file.
  • Some providers track an OAuth grant per user and app, not per machine. Revoke the old machine's grant first, then create the new one. Do it the other way round and you revoke both.
  • A scheduled task runs on one Mac only. Recreate it on the new one, then disable it on the old one.
  • Memory you write after the first ~/.claude archive has to be sent again before each wave's successors start.

Not every session has to move. One that needs something only the old Mac has can stay there, and you use it from the new Mac over Remote Control.

Credentials never travel. You sign in again on the new Mac, and service keys are made fresh there.

What's in the repo

  • SKILL.md: the method, the roles and the rules.
  • References: a glossary, each stage in detail, the restart protocol, file bridges, new-Mac setup, credentials and scheduled tasks, and when copying session history is the better choice.
  • Templates, among them the freeze brief, handoff note, branch ledger, handover message and transfer board.
  • Scripts in plain bash for macOS: scan-workspace.sh, scan-unpushed.sh, stage-claude-home.sh, seal-archive.sh, check-archive.sh, check-heads.sh.

Install

Install the skill from inside Claude Code:

/plugin marketplace add n-uf/claude-machine-transfer
/plugin install machine-transfer@n-uf-machine-transfer

Or copy skills/machine-transfer into ~/.claude/skills/. Install it on both Macs. Then, in the session that will run the move, ask Claude to plan a move of your workspace to the new Mac, or type the command (/machine-transfer when copied, /machine-transfer:machine-transfer as a plugin).

Source on GitHub: n-uf/claude-machine-transfer (opens in a new tab). Open source under the MIT licence: use it, change it and share it.

Questions

  • Why not just copy the disk to a new Mac?

    Copying the disk moves the files and loses the rest. A busy Claude Code workspace also has lead sessions, branches with unpushed commits, sidebar sections, memory and skills in ~/.claude, scheduled tasks and signed-in tools. machine-transfer moves it by fresh restarts: each lead session writes down where it stands, and a successor on the new Mac checks that against git.

  • Does machine-transfer use SSH?

    No, by default it doesn't turn on SSH or Remote Login between the two Macs, because SSH gives the other side the whole user account. It moves files over GitHub, with a private repo for small files and age-encrypted archives for private ones, and over Syncthing, kept on your LAN, for large folders.

  • Does machine-transfer copy my sign‑ins?

    No, credentials never travel: you sign in again on the new Mac, and service keys are made fresh there. Some providers track an OAuth grant per user and app, not per machine, so revoke the old machine's grant first and then create the new one.

n-uf is not affiliated with Anthropic. Claude and Claude Code are Anthropic's products.