I built a Claude Code plugin that hands your session to the cloud when you close your MacBook, and teleports it back when you open it
retained text
You know the moment: Claude Code is halfway through a long task, you have to leave, you close the lid, and the task just stops.
Claude Code can already pull a cloud session *down* into your terminal with `claude --teleport`. What it can't do is push a session that's already running on your laptop *up*. So I built that, and tied it to the lid.
**Sleepwalk** (free, MIT, macOS): [https://github.com/swperb/sleepwalk](https://github.com/swperb/sleepwalk)
**When you close the lid** while a session is mid-turn:
1. its work is committed and pushed to a branch (its own `sleepwalk/…` branch if you were on main)
2. a Claude Code on the web session starts, with a brief built from your original request and the recent conversation
3. the local session is paused through hooks, so the local and cloud agents never edit the same files
**When you open the lid**, the cloud session is told to push and stop, and a Terminal window opens running `claude --teleport`, so you carry on locally with the whole cloud conversation.
If anything fails on the way (no network, push rejected), it rolls everything back and leaves your session running locally.
**Measured on my MacBook Pro** over two real round trips: lid close to cloud session running took 5 and 7 seconds, and sleep was held for under 8 seconds.
**Install**, inside Claude Code:
/plugin marketplace add swperb/sleepwalk
/plugin install sleepwalk@sleepwalk
/sleepwalk:install
**Things that surprised me while building it**, in case they help anyone scripting Claude Code:
* `claude --cloud "task"` refuses `--print` when it *creates* a session, so Sleepwalk drives it with `expect` in a pseudo-terminal, then sends the real brief with `claude -p --cloud <id>`, which only succeeds once the session exists.
* Interactive Claude Code inherits folder trust from a parent folder, but creating a cloud session checks the folder itself. Sleepwalk never answers that trust prompt for you; it asks you once at the start of a session instead.
* The first time a LaunchAgent reads \~/Documents, macOS shows a privacy prompt that blocks it. At lid close nobody is there to click Allow, so the watcher now triggers that prompt at install time.
**How Claude helped:** Claude Code wrote most of it with me, and the plugin was tested by using it on its own repo: close the lid mid-task, open it, check the log.
**Honest limits:**
* macOS only
* the cloud agent gets a summary brief, not your full local conversation (there's no way to move a transcript into a cloud session)
* untracked files that aren't gitignored get pushed with the WIP commit
* the iPhone-hotspot fallback for closing the lid in the car is covered by tests but not yet proven on the road
* it's an independent project, not from Anthropic
I'd love to hear where it breaks. Issues and PRs welcome.document fetched 2026-10-21 00:22 · canonical https://reddit.com/r/ClaudeAI/comments/1xaflh1/i_built_a_claude_code_plugin_that_hands_your