HewyDownload
Pixel art: someone walking their dog down a gravel road through prairie wheat fields, phone in hand, with Hewy's green wren on a fence post.

Blog ·

Keep Claude Code running after you close your laptop.

An agent that stops when your laptop sleeps isn't much of an agent. Here's how to keep Claude Code or Codex working on a server while you're away, and still keep an eye on it.

Why it stops

Claude Code, Codex and the other coding agents run in a terminal. When the agent runs on your laptop, it lives as long as that terminal does: close the lid, lose Wi-Fi or let the machine sleep, and the work stops halfway, often in the middle of a change.

Running the agent over SSH on a server doesn't help on its own. The agent is now on the server, but it's still tied to your SSH session, and that session ends when the laptop sleeps.

The fix is to run the agent somewhere that doesn't depend on your laptop being awake, and to have a way back to it.

The do-it-yourself way: tmux

If you're happy in a terminal and have a project or two, tmux on the server does the job. It keeps the session running after you disconnect.

ssh you@your-server
tmux new -s agent        # a session that outlives this connection
cd ~/your-project
claude                   # or codex

Give the agent its task, then press Ctrl-b then d to detach. Close the laptop. Later, from any machine:

ssh you@your-server
tmux attach -t agent

A few things to know:

The Hewy way

Hewy is an app for Mac, iPhone and Android that does the tmux part for you, and gives each agent a proper chat window instead of a terminal. A small program on your server, the Hewy Daemon, keeps your agents running there. The apps connect to it over SSH, like you would, and your phone gets a notification when an agent needs you.

  1. Add your server

    Any server you can SSH into: a VPS, a box under your desk, a Raspberry Pi. Tap Add Server, enter its address and your user name, and tap Continue. Hewy makes its own key for the device and offers to install it.

    Hewy's Add Server screen, with a server's address and user name filled in
  2. Set it up for agents

    Choose your agents and tap Set Up. Hewy shows exactly what it will install first, then puts the daemon and the agents in your own account on the server, with no root needed for the basics. Sign in with your Claude or ChatGPT plan, or add an API key.

    Set Up in Hewy, listing what it will install on the server: Node.js, the Hewy Daemon, Claude and Codex
  3. Start a chat and give it a goal

    Start a chat in your project's folder and say what you want done. Turn on Goal for longer jobs and choose how long it may work: the agent keeps going until the goal is met or the time is up, not just for one turn.

    A new chat in Hewy with Goal turned on for up to two hours, and a goal typed in
  4. Close the laptop

    The agent carries on, on the server. When it needs an answer, such as permission to run a command, your phone lets you know. Tap it to answer, and to see what the agent has done so far. When you're back at your desk, the same chat is waiting on your Mac.

    Hewy's chat list, with a chat waiting under "Needs you"

Which to use

If you live in the terminal and work on a project at a time, tmux is free and works well. If you hop between a lot of projects and servers, would rather click than type, or want to answer your agents from your phone, that's what Hewy is for. It's free for 14 days, and the setup guide shows everything Set Up does on your server, step by step.