How to run Claude Code 24/7 on your own machine
Claude Code is a terminal program. Close the terminal, let the laptop sleep, or reboot, and it is gone. To have it answer at any hour, three things must stay up: a process that runs Claude Code, a way to reach it, and the machine itself. This page goes through each one on a Mac. I use Angelia for the first two, which I built, so the commands below use it. The part about the machine applies whatever you use.
What has to stay up
- The process. Something must start Claude Code, keep it running and start it again after a crash.
- The way in. You need to reach it from outside the terminal. A chat app on your phone works best.
- The machine. It must be on, awake and logged in.
Common ways to do the first two: tmux on the Mac with SSH from the phone, Anthropic's channels in a session you keep open, or a background program like Angelia. The four ways compared covers the differences.
1. The process: a service
curl -fsSL https://useangelia.com/install | sh
angelia service install
The first line installs Angelia and pairs a Telegram or WhatsApp chat (step by step). The second installs a macOS LaunchAgent. It starts Angelia when you log in and starts it again if it crashes.
- Each chat keeps its own Claude Code session. After 30 minutes without messages, the process exits to free memory. The next message starts it again with
--resume, so the conversation goes on where it stopped. - The sessions survive a restart of Angelia and a reboot of the Mac.
- A turn that shows no progress for 30 minutes gets a warning in the chat. At 60 minutes Angelia stops it. You can send
/stopat any time. - When you reach your plan's usage limit, the chat says so instead of failing silently.
Check it from the terminal with angelia status. The log is in ~/.angelia/daemon.log. It holds ids and errors, not your messages.
2. The machine: no sleep, back after a reboot
This is the part people forget. A sleeping Mac answers nothing.
- Desktop Mac (mini, Studio, iMac): in System Settings, open Energy and turn on Prevent automatic sleeping when the display is off. Also turn on Start up automatically after a power failure if your Mac shows it.
- MacBook: in System Settings, open Battery, then Options, and turn on Prevent automatic sleeping on power adapter when the display is off. This works only on power. With the lid closed, a MacBook sleeps unless an external display is connected.
- For a few hours only: run
caffeinate -sin a terminal. The Mac stays awake on power until you press Ctrl-C. - After a reboot: the service starts at login, not at boot. With FileVault on, someone must log in after each reboot. macOS updates reboot the Mac, so check after an update.
An old Mac mini that stays home is the simplest choice. It uses little power and never goes into a bag.
3. Work it does without you asking
Running all day also lets the agent work on a schedule. A profile lists its jobs in angelia-jobs.yaml in its folder:
jobs:
morning-card:
schedule: "0 8 * * mon-fri"
turn: "Check the open pull requests and tell me which need me."
Then run angelia jobs install. macOS runs each job as its own timer, and the answer comes to the chat. A job can also post a fixed message or run a script.
Updates and restarts
angelia update
It installs the newest signed release. Your profiles and chats are not touched. Send /restart in a chat, then /restart confirm, to restart from the phone.
What still stops it
- Power cuts and network outages. Angelia reconnects by itself when the network comes back.
- Your plan's usage limits. Every chat draws on the same plan.
- macOS only for now. Linux, with a systemd unit, is next.
- Claude Code changes often. A new version can break something before Angelia is updated for it. Angelia is a young project (v0.3), maintained by one person.
Try Angelia
curl -fsSL https://useangelia.com/install | sh
It checks the release's signature, then a wizard pairs your first chat. Free and open source (MIT). How it works · Security model · GitHub