hopsesh

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: Apache-2.0

README

hopsesh logo

hopsesh

Find your Claude Code sessions on your other machines and continue one here.

Release CI OpenSSF Scorecard Go Reference

Install · Quick start · Round trips · Ask Claude · How it works · Why not…? · FAQ

hopsesh lists Claude Code sessions on two machines grouped by repository, then moves one to this machine, cloning its repository and printing the resume command

Recorded with VHS from demo/hopsesh.tape, with made-up machines and sessions.

You started something in Claude Code on your desktop, and now you're on your laptop. hopsesh shows every session on all your machines and moves the one you pick here: repository, worktree, paths and all. Then it gives you the claude --resume command.

  • Finds your machines from Tailscale and ~/.ssh/config, and connects only to the ones you allow, with your own ssh, keys and agent. Nothing to install on the other machines. Machines without SSH keys can log in with a password (v0.2.0).
  • Lists every session by repository: machine, path, branch, worktree, last prompt, when it was last active, and whether it's running right now.
  • Moves a session safely: finds the repo here or clones it, recreates the worktree, warns about unpushed or uncommitted work, rewrites paths, and shows a plan first. hopsesh undo reverses a move.
  • Moves back just as easily (v0.2.0): the copy left behind is marked "↪ moved to …", listings show one row per session, and hopsesh pull <id> brings back the newest copy, code included. If both copies changed, it stops and asks; it never merges.
  • Works from inside Claude Code (v0.2.0): ask "bring my laptop session here" and Claude plans the move with hopsesh, then moves only after you say yes.
  • Picks up where you left off: the resumed session's first message tells Claude it was moved and asks it to check that nothing is missing. It can start with Remote Control on and tell the old session where the work went.
  • CLI, TUI and a macOS app on one engine. --json output everywhere it matters.

Status: alpha. It works end to end on macOS and Linux; Windows support is built but less tested. hopsesh is an independent project, not affiliated with Anthropic.

Install

macOS and Linux:

curl -fsSL https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.sh | sh

Windows (PowerShell):

irm https://raw.githubusercontent.com/roeehrl/hopsesh/main/scripts/install.ps1 | iex

Both check the download against the release's checksums.txt and its signature, and hopsesh update installs later releases with the same checks.

  • macOS app: download the signed, notarized .dmg (macOS 13+, Apple silicon and Intel).
  • Linux packages: .deb, .rpm and .apk for amd64 and arm64 are on the release page, for example sudo apt install ./hopsesh_<version>_linux_amd64.deb.
  • From source (Go 1.26+): go install github.com/roeehrl/hopsesh/cmd/hopsesh@latest

The other machines need only an SSH server (Remote Login on macOS, OpenSSH on Windows) and their Claude Code sessions.

Quick start

hopsesh hosts                 # machines found in Tailscale and ~/.ssh/config (connects to nothing)
hopsesh hosts allow studio    # let hopsesh connect to one
hopsesh trust studio          # confirm its SSH host key
hopsesh                       # browse sessions and move one here

Or from scripts:

hopsesh ls --json                          # every allowed machine, grouped by repo
hopsesh plan studio:"fix flaky tests"      # read-only preview of a move (v0.2.0)
hopsesh pull studio:"fix flaky tests"      # plan, confirm, move, print the resume command
hopsesh pull 7f3c2a1e                      # no machine name: the newest copy (v0.2.0)
hopsesh pull studio:7f3c2a1e --clone --rc --notify --yes
hopsesh hosts add nas alice@192.168.1.20 --password   # a machine without SSH keys (v0.2.0)
hopsesh doctor studio                      # SSH, host trust, Claude version, Remote Control
hopsesh undo 7f3c2a1e
The macOS app
The hopsesh macOS app listing sessions from two machines, grouped by repository, each with a Hop here button

Same engine, with a preflight screen for each move: repository, worktree mode, what gets rewritten, and what's left behind on the other machine. From v0.2.0, its Settings screen can put the hopsesh command on your PATH (a link into the app, no administrator password) and install the Claude Code skill.

Round trips

Coming in v0.2.0. Until it's released, try it from source: go install github.com/roeehrl/hopsesh/cmd/hopsesh@main

Move a session to your laptop, work on it, and move it back later. hopsesh treats the session as living on one machine at a time:

  • The copy left behind is marked. Its title becomes ↪ moved to <machine> · <title>, so even Claude Code's own resume list on that machine shows that it moved.
  • One row per session. Listings combine the copies of a session across machines and show the newest one. hopsesh pull <id-or-title> without a machine name brings that copy here, into the folder it came from.
  • It never merges. If both copies changed since the move, the move is refused until you choose --keep-both (the incoming copy becomes a separate session) or --replace (the copy here is set aside and hopsesh undo brings it back).
  • The code follows. hopsesh fetches the session's commit, straight from the other machine if it was never pushed, and fast-forwards a clean checkout. It never merges, rebases or stashes; if the checkout isn't clean or has diverged, it says exactly what's missing.
  • hopsesh plan shows all of this without changing anything.

Details: docs/design.md §12.

Use it from Claude Code

Coming in v0.2.0. Until it's released, try it from source: go install github.com/roeehrl/hopsesh/cmd/hopsesh@main

hopsesh skill install              # Claude asks before each hopsesh command
hopsesh skill install --add-rules  # read-only hopsesh commands run without asking

Then ask Claude things like "bring my laptop session here" or "which sessions are running on the studio?". Claude plans first and moves only after you say yes. --add-rules allows the read-only commands (ls, plan, show, …) and adds "ask" rules for pull, undo and import, so moves always ask you, even in auto mode. The skill never starts another Claude and never handles passwords: for a machine that logs in with a password, Claude asks you to run hopsesh hosts setup-key yourself. hopsesh skill remove takes it out again. Details: docs/design.md §13 and §14.

How it works

  1. Discovery reads tailscale status --json and your ~/.ssh/config. It connects to nothing until you allow a machine.
  2. Listing connects with your system ssh (strict host-key checking, ControlMaster) and reads the head and tail of each transcript over SFTP. One batched git probe per machine adds branch, worktree and unpushed/uncommitted counts.
  3. Moving builds a plan, then copies the transcript and its side files into a staging folder. It rewrites paths in one pass, so ids and signed thinking blocks are never touched. It re-reads the result, installs it where Claude Code looks for it, and keeps an undo journal.

The details, including the Claude Code file-format traps hopsesh handles, are in docs/design.md.

How it treats your data
  • Your machines only. Sessions travel over your own SSH. There's no hopsesh server, no cloud relay and no telemetry. The app can check GitHub once a day for new versions, only if you say yes.
  • Read-only until you say go. Each machine needs your permission, and every move is shown as a plan first.
  • Never moves credentials. Logins, keys, live sockets and account data stay where they are; each machine stays signed in on its own. A machine's SSH password (v0.2.0) is kept in the macOS Keychain or asked for each time, and never written to hopsesh's files or a command line.
  • Transcripts can hold secrets. hopsesh scans for likely secrets while moving and can redact the copy (--redact). Every remote action goes to a local audit log.
  • Only Claude Code itself talks to the model. hopsesh never calls the API.

Why not…?

  • claude --teleport? Teleport brings a session from Claude Code on the web to your machine. hopsesh moves sessions between your own machines.
  • Remote Control? Remote Control lets you drive a session that keeps running where it is. hopsesh moves the session, so it continues on the machine you're at, with that machine's files and tools. It can turn Remote Control on for the moved session.
  • Copying the .jsonl and running claude --resume? It works only if every path is the same on both machines, the project folder name matches Claude Code's naming rules, and there's no second copy of the session. hopsesh handles those cases, plus the repository, worktree, side files and undo.
  • Syncing all of ~/.claude between machines? Sync tools copy everything, all the time. hopsesh moves the one session you pick, when you pick it, and fixes it up for the new machine.

Related projects, with different trade-offs:

  • parcels ships a repository together with a live agent session over Tailscale.
  • go-claude-teleport moves a session, its git worktree and its tmux window over SSH.
  • claude-nomad syncs your setup and history with path remapping.
  • chronicle syncs history through git.

FAQ

Does anything leave my machines?

No. Sessions go directly between your machines over SSH. hopsesh has no server and no telemetry, and it never calls the Anthropic API.

Do I need Tailscale?

No. Any machine you can ssh to works, including aliases, ProxyJump and ProxyCommand from your ~/.ssh/config. Tailscale just makes machines easy to find. When an alias's LAN name doesn't resolve, hopsesh falls back to the machine's Tailscale name.

One of my machines logs in with a password, not an SSH key

From v0.2.0: add it with hopsesh hosts add <name> <destination> --password, or switch an existing one with hopsesh hosts auth <machine> password. In the app, use the "Login" button on the Machines screen, or tick "This machine logs in with a password" when adding it.

hopsesh asks for the password when it connects:

  • On macOS it remembers it in the Keychain by default (--keychain=false to be asked each time).
  • Otherwise it asks with a hidden prompt in the terminal, or a dialog in the app.
  • In scripts, --password-stdin reads it from standard input.

It's never written to hopsesh's files or put on a command line.

Better still, hopsesh hosts setup-key <machine> (in the app: "Set up key login") logs in once with the password and adds your SSH key there. It then checks that key login works, switches the machine to keys and forgets the password. This works for macOS and Linux machines. hopsesh hosts shows each machine's login method. Details: docs/design.md §15.

Does the other machine need hopsesh installed?

No. It only needs an SSH server. There's an optional helper (hopsesh hosts helper install <machine>) that makes listing faster on machines with long histories. It's a copy of hopsesh pinned by SHA-256, checked before every run, listens on nothing, and is removed with hopsesh hosts helper remove <machine>.

What if the session is still running on the other machine?

By default hopsesh copies it as it is and asks the old session to stop (handoff). With --fork, both copies continue independently. hopsesh refuses to overwrite a session that's running on this machine.

I moved a session and kept using the old copy too. What happens?

From v0.2.0, moving it again stops and explains: both copies changed, and hopsesh never merges them. Choose --keep-both to bring the incoming copy in as a separate session, or --replace to set the copy here aside (hopsesh undo restores it).

Different usernames, home folders or operating systems?

That's the point. Paths are rewritten for the new machine, including JSON-escaped Windows paths, and separators are converted between Windows and macOS/Linux. Paths it can't map are left as they are and listed in the plan.

Different Claude accounts on the two machines?

hopsesh reads claude auth status on both sides. If the accounts differ, it leaves out thinking blocks, because they're signed for the original account.

Why does macOS ask about "devices on your local network"?

macOS 15 and later ask before an app may reach machines on your LAN. The hopsesh app asks when it first connects to such a machine, explains why, and if you chose Don't Allow, links to System Settings → Privacy & Security → Local Network. Tailscale connections aren't affected, and the command-line tool run from Terminal never needs this permission.

How do I undo a move?

hopsesh undo <session-id> removes the copy and restores anything it set aside. hopsesh undo with no arguments lists recent moves.

Contributing

Contributions are welcome. Issues labelled good first issue are a good place to start. You don't need two machines: demo/record.sh shell starts two made-up machines in Docker and drops you on one with hopsesh ready (see demo/README.md).

See CONTRIBUTING.md for the 60-second dev setup, and use Discussions for questions and ideas. Report security issues privately as described in SECURITY.md.

License

Apache License 2.0. "Claude" and "Claude Code" are trademarks of Anthropic, PBC; hopsesh is not affiliated with, endorsed by or sponsored by Anthropic.

Directories

Path Synopsis
cmd
hopsesh command
Command hopsesh finds Claude Code sessions on your other machines and continues one here.
Command hopsesh finds Claude Code sessions on your other machines and continues one here.
hopsesh-app command
Command hopsesh-app is the hopsesh desktop app (macOS, Windows).
Command hopsesh-app is the hopsesh desktop app (macOS, Windows).
internal
claudeskill
Package claudeskill installs, checks and removes the hopsesh skill for Claude Code: a personal skill at <claude config dir>/skills/hopsesh that teaches Claude to list and move sessions with the hopsesh CLI (plan first, move only after the user says yes).
Package claudeskill installs, checks and removes the hopsesh skill for Claude Code: a personal skill at <claude config dir>/skills/hopsesh that teaches Claude to list and move sessions with the hopsesh CLI (plan first, move only after the user says yes).
cli
Package cli implements the hopsesh command line.
Package cli implements the hopsesh command line.
config
Package config holds hopsesh's user configuration and state locations.
Package config holds hopsesh's user configuration and state locations.
core/audit
Package audit keeps an append-only JSONL log (one file per day in the state folder) of every remote command, copy, install and undo.
Package audit keeps an append-only JSONL log (one file per day in the state folder) of every remote command, copy, install and undo.
core/fsys
Package fsys is the small filesystem interface hopsesh reads sessions through, so the same code enumerates sessions on this machine (os) and on a remote one (SFTP).
Package fsys is the small filesystem interface hopsesh reads sessions through, so the same code enumerates sessions on this machine (os) and on a remote one (SFTP).
core/hops
Package hops keeps the local log of completed moves (state/hops.jsonl): which session went from which machine to this one, and whether the copy left behind has been marked as moved.
Package hops keeps the local log of completed moves (state/hops.jsonl): which session went from which machine to this one, and whether the copy left behind has been marked as moved.
core/hosts
Package hosts discovers the user's machines without connecting to any of them.
Package hosts discovers the user's machines without connecting to any of them.
core/link
Package link connects the old and new sessions using only official Claude Code features: it builds the resume command (--resume, --fork-session, --remote-control, --desktop), the start prompt that tells the resumed session it was moved and asks it to check its environment (and, when asked, to notify the old session with SendMessage), and the text to paste into the old session otherwise.
Package link connects the old and new sessions using only official Claude Code features: it builds the resume command (--resume, --fork-session, --remote-control, --desktop), the start prompt that tells the resumed session it was moved and asks it to check its environment (and, when asked, to notify the old session with SendMessage), and the text to paste into the old session otherwise.
core/lnp
Package lnp handles macOS local network privacy (macOS 15 and later).
Package lnp handles macOS local network privacy (macOS 15 and later).
core/moved
Package moved defines how hopsesh marks the copy of a session left behind after a handoff.
Package moved defines how hopsesh marks the copy of a session left behind after a handoff.
core/repos
Package repos matches a session's working directory to a git repository.
Package repos matches a session's working directory to a git repository.
core/rewrite
Package rewrite adapts a copied session to the target machine.
Package rewrite adapts a copied session to the target machine.
core/scan
Package scan finds likely secrets in transcripts before they move.
Package scan finds likely secrets in transcripts before they move.
core/secrets
Package secrets keeps machine passwords in the macOS Keychain when the user asks for it.
Package secrets keeps machine passwords in the macOS Keychain when the user asks for it.
core/sessions
Package sessions locates and summarizes Claude Code sessions.
Package sessions locates and summarizes Claude Code sessions.
core/transport
Package transport runs commands and reads files on remote machines.
Package transport runs commands and reads files on remote machines.
devtools/demoseed command
Command demoseed fills a demo machine with made-up git repositories and Claude Code sessions, for the recordings in demo/.
Command demoseed fills a demo machine with made-up git repositories and Claude Code sessions, for the recordings in demo/.
devtools/icon command
Command icon renders hopsesh's app icon (1024×1024 PNG): a teal rounded square with a "hop" arc between two dots.
Command icon renders hopsesh's app icon (1024×1024 PNG): a teal rounded square with a "hop" arc between two dots.
devtools/linkcheck command
Command linkcheck exercises the app's command-line link from inside a .app bundle (it must run as <bundle>/Contents/MacOS/<name>).
Command linkcheck exercises the app's command-line link from inside a .app bundle (it must run as <bundle>/Contents/MacOS/<name>).
devtools/lnpcheck command
Command lnpcheck reports, for each host given, whether macOS local network privacy applies to it and what an in-process probe sees.
Command lnpcheck reports, for each host given, whether macOS local network privacy applies to it and what an in-process probe sees.
devtools/realcheck command
Command realcheck validates the session reader against the real ~/.claude on this machine: every project folder name must equal Slug(cwd) for the cwd its transcripts record (or the relocated cwd), and summaries must have titles.
Command realcheck validates the session reader against the real ~/.claude on this machine: every project folder name must equal Slug(cwd) for the cwd its transcripts record (or the relocated cwd), and summaries must have titles.
engine
Package engine plans and performs a session transport: it decides where a session goes on this machine, which files move, how paths map, what to do about the repository and worktrees, and then stages, rewrites, verifies and commits the copy with an undo record.
Package engine plans and performs a session transport: it decides where a session goes on this machine, which files move, how paths map, what to do about the repository and worktrees, and then stages, rewrites, verifies and commits the copy with an undo record.
gui
Package gui is the backend of the hopsesh desktop app (Wails v3).
Package gui is the backend of the hopsesh desktop app (Wails v3).
integrate
Package integrate connects hopsesh to the rest of the user's machine: the command-line tool on PATH (for app installs) and the hopsesh skill for Claude Code.
Package integrate connects hopsesh to the rest of the user's machine: the command-line tool on PATH (for app installs) and the hopsesh skill for Claude Code.
inventory
Package inventory scans machines for Claude Code sessions and joins each session with its live status and git state.
Package inventory scans machines for Claude Code sessions and joins each session with its live status and git state.
tui
Package tui is hopsesh's interactive terminal UI: machines → repositories → sessions, then plan, confirm and move, ending with the command to resume.
Package tui is hopsesh's interactive terminal UI: machines → repositories → sessions, then plan, confirm and move, ending with the command to resume.
update
Package update checks for and installs new hopsesh releases from GitHub.
Package update checks for and installs new hopsesh releases from GitHub.
version
Package version carries build metadata injected at link time by GoReleaser.
Package version carries build metadata injected at link time by GoReleaser.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL