NodeHop
Close your laptop. Your agents keep working.
Hands Claude Code and Codex sessions from your laptop to an always-on Mac or Linux box, and back.
NodeHop hands running work from your laptop to an always-on machine, and back. Close the lid while Claude Code or Codex is in the middle of a task: the session is stopped, copied to your Mac mini or Linux box, and resumed there with the same conversation. Open the lid: your laptop takes it back. Training jobs work the same way, resuming from their last checkpoint at the other machine's pace.
laptop (primary) always-on machine (server)
──────────────── ──────────────────────────
lid closes ─► stop the agent
copy project + conversation ──────► resume it, same conversation
lid opens ─► ask the server to stop
copy everything back ◄─────────────
resume it here
Highlights
- Your agents never stop — Claude Code and Codex sessions (conversation included) and long commands such as training jobs move between machines and resume.
- Set up by an agent, from one machine — it asks you a few questions and installs NodeHop on the other machine over SSH. No agent needed over there.
- The laptop needs no SSH server — it pushes work when it sleeps and pulls it back when it wakes; only the always-on machine accepts connections.
- Safe on slow networks — transfers are all-or-nothing; if the newest state cannot be sent before sleep, the server resumes from its last complete copy.
- Fallback — if the laptop dies without going to sleep, the server resumes the work in progress after 2 minutes.
- You decide conflicts — if two agents worked in parallel, a native window shows what each one did and lets you pick (the other version is kept).
- A Mac mini or a Linux server takes over — the always-on machine can be a Mac or a Linux box, with or without a screen.
- Paths may differ — different user names and folders on each machine.
- Zero dependencies — Python 3.9+ standard library,
ssh,rsync,tmux.
Before you start
NodeHop does almost everything itself. You only prepare three things, once, on both machines:
- Your agent, installed and signed in. NodeHop is built for Claude Code
first, and Codex works the same way: use either, or both. Install it on each
machine, sign in with your account, and open it once (
claude, then its first screens). NodeHop never moves your login from one machine to the other. - SSH on the always-on machine. macOS: System Settings › General › Sharing ›
Remote Login. Linux:
sudo apt install -y openssh-server. The laptop needs no SSH server. When asked, you type that machine's password once intossh-copy-id. - Tailscale on both machines, signed in to the same account, so they find each other at home and away (recommended; a local network works too).
That's all. Installing NodeHop on the other machine, pairing both machines and hooking into sleep and wake are done for you.
Get started
With an agent (recommended)
Ask your coding agent (Claude Code or any other), on your laptop:
Install NodeHop from https://github.com/BuildRunnerFr/NodeHop by following its AGENT_SETUP.md.
It installs NodeHop, asks you whether this is the laptop or the always-on
machine, which machine is the other one (your Tailscale machines are offered),
and which project to protect, then sets up both machines. All you may have to
do: type the other machine's password once into ssh-copy-id, and run anything
that needs sudo. Details for agents: AGENT_SETUP.md.
By hand
pipx install git+https://github.com/BuildRunnerFr/NodeHop
nodehop onboard # the same questions, with arrow-key menus
Daily use
cd ~/code/my-app
nodehop on # protect this project (Claude Code; --agent codex for Codex)
nodehop start my-app # run its agent, inside NodeHop's tmux
nodehop attach my-app # open its terminal (detach: Ctrl-b d)
nodehop status # where each project runs right now
Then just close the lid. A few more:
nodehop handoff --to server # hand off now, without closing the lid
nodehop pull my-app # bring a project back here
nodehop resolve # two agents worked in parallel: choose
nodehop doctor # check everything, with fixes
nodehop -n handoff # dry run: print every command, change nothing
Training jobs
nodehop on ~/code/my-model --command ".venv/bin/python train.py"
nodehop start my-model
With from nodehop import train (standard library, PyTorch optional) a script
saves a checkpoint and exits cleanly when NodeHop stops it, resumes from it on
the other machine, and picks a micro-batch that fits that machine's memory —
gradient accumulation keeps the effective batch, and so the training, identical.
A 40,000-step run moved between a MacBook (128 × 4) and a Mac mini (64 × 8)
with the same loss curve. See examples/train_relay.py.
How it works
| When | What NodeHop does |
|---|---|
| Every 30 s | The laptop tells the server it is alive; every 5 min it also copies the active projects there. |
| Lid closes | Stop the agent (Claude Code quits in ~1 s; a training job saves a checkpoint), copy what changed, resume it on the server. Budget: ~22 s, because macOS sleeps soon after. |
| Lid opens | Ask the server to stop, copy everything back, resume here. Retries while the network comes back. |
| Laptop silent 2 min without sleeping | The server resumes, from the last copy, the work that was in progress. |
| Laptop back, both agents worked | The server's agent is paused and you choose which version to keep. |
Agents run in NodeHop's own tmux server, so they keep running with no terminal open and can be stopped cleanly. A resumed Claude Code gets a short "carry on" message only if it was in the middle of something; an idle one is just reopened.
Requirements
| The machine you work on (primary) | The always-on machine (server) | |
|---|---|---|
| System | a Mac, usually a laptop | a Mac (e.g. a Mac mini) or a Linux server, headless is fine |
| Needs | Python 3.9+ (the system one works), rsync, tmux, and your agent (Claude Code and/or Codex) signed in |
the same, plus an SSH server (Remote Login on macOS; openssh-server on Linux) |
| Notes | SleepWatcher, installed for you by nodehop onboard |
Mac: keep a user session open (automatic login) so agents can read the login keychain. Linux: loginctl enable-linger so agents keep running with nobody logged in |
- Tailscale recommended, so it also works away from home.
A Linux machine can also be the primary (a systemd sleep hook replaces SleepWatcher), but that setup is less tested.
Configuration
nodehop config get shows everything; nodehop config set <key> <value>
changes it. The useful ones:
| Key | Default | Meaning |
|---|---|---|
presync_seconds |
300 |
how often active projects are copied to the server |
failover_minutes |
2 |
server: resume the laptop's work after this much silence (0 = off) |
sleep_budget_seconds |
22 |
time allowed to hand off when the lid closes |
unattended |
unset (asked) | how a resumed agent handles permission prompts with nobody there: auto (Claude Code's auto mode; Codex sandboxed to the project), acceptEdits, or default |
remote_control |
false |
show NodeHop's Claude Code sessions in the Claude app, to follow and answer them from anywhere |
backups_keep |
5 |
versions set aside after a fallback or conflict, kept per project |
excludes |
node_modules, .venv, … |
never copied (rebuild them on each machine) |
workspace |
unset | where received projects go (unset: same place relative to the home folder) |
claude_args / codex_args |
[] |
extra flags for Claude Code / Codex (e.g. ["-c", "model=\"…\""]) |
FAQ
Does the other machine need an agent to be set up? No. The agent on your laptop installs and configures NodeHop over there through SSH. Claude Code (or Codex) must simply be installed and signed in there too, since that machine runs your agent while the laptop sleeps.
Does it work on battery? Yes. Closing the lid hands off on battery as on power: NodeHop finishes before macOS goes to sleep (a few seconds, within a 22-second budget).
What does NodeHop do with my passwords? Nothing: it never asks for, types or stores one, and agents' logins never leave their machine. It uses its own SSH key, restricted on the server; see SECURITY.md.
What if the resumed agent needs a permission with nobody there? Set
unattended to auto (the onboarding suggests it): Claude Code's auto mode
decides by itself, so work does not stall. With remote_control on, you can
also follow and answer it from the Claude app.
My network is slow; will a big checkpoint make me lose work? A transfer cut
by sleep changes nothing on the other side, and the server resumes from the
last complete copy (at most presync_seconds old).
What if I edit the project on both machines? Don't: the receiving copy is made identical to the sender's. If two agents ever worked in parallel, NodeHop asks you which version to keep and saves the other.
Which agents? Claude Code (the main target) and Codex, each with its
conversation, as long as it is signed in on both machines; anything
else as a plain command (nodehop on --command "…"), restarted on the other
machine. Adding another agent is one module: see CONTRIBUTING.md.
Does it rely on agents' internals? Yes: session files (~/.claude/projects,
~/.codex/sessions) are not public APIs and may change. NodeHop keeps each
agent's details in its own module.
Uninstall
nodehop uninstall --everywhere # from the laptop: this machine and the paired ones
It removes NodeHop's background jobs, app, keys, config, backups and logs, then the program itself. Your projects, your agents and their conversations stay.
Contributing
Issues and pull requests are welcome: see CONTRIBUTING.md and the design notes in CLAUDE.md. Changes are listed in CHANGELOG.md.
License
Metadata
Release files for nodehop 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nodehop-0.2.0.tar.gz | 92.0 kB | With provenance | Details for nodehop-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nodehop-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for nodehop-0.2.0-py3-none-any.whl |
Total release size: 174.3 kB
Release files / nodehop-0.2.0.tar.gz
| Download URL | nodehop-0.2.0.tar.gz |
|---|---|
| Size | 92.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
742d2de5660ade7918c68fcf32d9530be63f4177b1bb1846f2a90a47e65fe6c4
|
|
BLAKE2b-256 checksum How to use checksums |
9d5fc2117024c35040a557d90a806e4637c656d7ca7c612f42f9e043d5d949a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logRelease files / nodehop-0.2.0-py3-none-any.whl
| Download URL | nodehop-0.2.0-py3-none-any.whl |
|---|---|
| Size | 82.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
453583aa9080ee1ecfc265c27fd377fd84385398d878fb28ad28c3e5882c42a6
|
|
BLAKE2b-256 checksum How to use checksums |
1f2ce5d07578b08ba516a5c5e3ac4a6b592e469a91c637a05f554c164035247a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logSecurity for nodehop 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for nodehop-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.