Skip to main content

I Closed My Laptop and My AI Agents Kept Shipping

Hermes reviews, OpenCode builds, Tailscale and Conduit put it on my phone, and Amphetamine keeps a lid-closed MacBook awake

Updated 21 min readMarkdown
I Closed My Laptop and My AI Agents Kept Shipping

Last week I closed my MacBook's lid, left it on the desk, and went out for chai. Forty minutes later my phone buzzed:

PR #7 merged into main. All checks green. Starting task 4 of 9.

Nobody was at the laptop. Well, nobody human.

Most of my coding happens in OpenCode now. That's great while I'm sitting in front of the MacBook. The trouble is the rest of the day, when I'm commuting, eating, or standing in a queue thinking "I could have shipped that migration by now." So I set up a small team that works while I'm away: one agent that writes code, one agent that manages it, and me on my phone acting like a slightly smug engineering manager.

This post is the whole setup. The cast, the loop that turns a plan into merged pull requests, how the bots are organized, how my phone reaches a laptop with its lid shut, and the guardrails that stop the whole thing from going sideways. There are a lot of diagrams. Get a coffee; my MacBook already had one.

Meet the night shift

Six things make this work, and each one has exactly one job.

The cast: you with a phone running Hermes Conduit, Tailscale as the private road, Hermes as tech lead, OpenCode as builder, Amphetamine keeping the Mac awake, and GitHub with CI as referee
Who Job in this setup Where it runs
OpenCode The builder. Writes code, commits, opens PRs, applies review feedback, merges when allowed MacBook
Hermes Agent The tech lead. Reviews the plan, splits it into tasks, hands them out, reviews every PR MacBook
Hermes Conduit The walkie-talkie. I chat with my bots, answer questions and approve things iPhone
Tailscale The private road between my phone and my laptop Both
Amphetamine The espresso shot. Keeps a lid-closed Mac awake MacBook
GitHub + CI The referee. Branches, PRs, and checks nobody gets to argue with Cloud

A quick word on each, because they're all worth knowing on their own.

OpenCode is an open-source coding agent that works with 200+ model providers, including local models. It has a TUI, a desktop app and an SDK, but the piece that matters here is opencode run, which takes a prompt, does the work, and exits. That makes it easy for another program to drive.

Hermes Agent is Nous Research's open-source (MIT) agent. It keeps persistent memory, writes and reuses its own skills, runs scheduled jobs, and talks to you over a gateway on 20+ messaging platforms. It also has Bot Mode, which turns profiles into a roster of named bots, each with its own model, memory, skills and chat. More on that later, because it's the part that makes the phone experience pleasant.

Hermes Conduit is an independent iOS client for your own Hermes agent (it isn't made by Nous Research). It connects to the Hermes dashboard you run and gives you chats, bots, tasks, voice, and approvals you can answer from a notification.

Tailscale builds a private WireGuard network (a "tailnet") between your devices. Each device gets a stable private address, and you don't open a single port on your router.

Amphetamine is a free keep-awake app for macOS. Its closed-display mode is the reason a MacBook in clamshell, with no external monitor, keeps working instead of falling asleep.

The big picture

Here's how the pieces connect.

Architecture: the phone running Conduit reaches the MacBook over a Tailscale tunnel. On the Mac, the Hermes dashboard and gateway host several bots, which drive OpenCode in the git repo. OpenCode pushes branches and PRs to GitHub, where CI runs. Amphetamine keeps the whole Mac awake with the lid closed

I think about it as three planes:

  • The control plane is me, Conduit, Tailscale and the Hermes dashboard. It's how intent gets in and status gets out.
  • The work plane is Hermes and OpenCode operating on a git checkout on the Mac.
  • The referee is GitHub. Branches, pull requests, review comments and CI checks are the shared language between the two agents.

That last point is the design idea I care most about: two agents, one contract. Hermes never edits the code. OpenCode never decides on its own that the work is done. Everything they agree on goes through git, where I can read it later. If you've ever worked on a team with code review, you already know why this helps. The person who wrote the code is the worst person to judge whether it's finished, and that turns out to be true for models too. A second agent with a different prompt (and, if you like, a different model) catches a surprising amount.

Step 1: write a plan and drop it in /plan

Everything starts with a plan I write myself. This is the one part I don't delegate, because the quality of the plan sets the ceiling for everything after it.

In a git repo, the plan lives in a plan/ folder:

my-project/
├── AGENTS.md              # rules both agents read: style, test commands, branch naming
├── plan/
│   ├── 001-auth-overhaul.md
│   └── tasks.md           # written by Hermes in step 2
├── src/
└── .github/workflows/ci.yml

AGENTS.md is doing double duty here. OpenCode reads it as project rules, and Hermes picks it up as a context file, so both agents get the same conventions from one place.

Who owns which file: I write AGENTS.md and the plan, Hermes writes tasks.md and reviews src, OpenCode writes src and tests, and GitHub runs the CI workflow

A plan doesn't need to be long. Mine usually look like this:

# 001: Auth overhaul

## Goal
Replace session cookies with short-lived access tokens + refresh tokens.

## Constraints
- No breaking change to the public /api/v1 routes
- Postgres migrations must be reversible
- Every new endpoint gets an integration test

## Milestones
1. Token model and migration
2. Issue + refresh endpoints
3. Middleware swap behind a feature flag
4. Remove old session code

## Done means
CI green on main, feature flag removed, docs/auth.md updated.

## Out of scope
SSO. Don't touch it. I mean it.

The "Out of scope" section is there because agents are enthusiastic. If you don't fence off the neighbor's garden, they'll helpfully replant it.

Step 2: Hermes reviews the plan and breaks it up

I open my planning bot in Conduit and send something like "New plan in plan/001-auth-overhaul.md on my-project. Review it and break it down." Hermes reads the plan and the codebase, asks me anything it can't decide on its own (Conduit shows those questions as tap-to-answer cards), and writes a task list.

Plan breakdown: a single plan file goes to Hermes, which produces numbered tasks with dependencies. Each task becomes one branch and one pull request

Each task is sized to fit in one pull request and carries its own acceptance criteria. That sizing rule matters more than anything else in this post. Small PRs are easy for Hermes to review and easy for me to read on a phone screen. Giant PRs are where both agents start nodding along to things nobody checked.

Step 3: OpenCode reviews the plan too

Before any code gets written, Hermes asks OpenCode to read the plan and the task list and push back. This sounds redundant. It isn't.

Hermes reviews the plan like a tech lead: scope, ordering, risk. OpenCode reviews it like the person who has to build it: "task 3 needs the migration from task 5," or "there's already a token helper in src/lib/crypto.ts, use that." Hermes folds the feedback into tasks.md, and only then does the first task go out.

Two plan reviews: Hermes checks scope, order and risk like a tech lead, OpenCode checks dependencies, existing code and PR size like the builder, and both feed into tasks.md version 2

Step 4: the build, review, fix, merge loop

This is the engine. Hermes hands out one task at a time and stays on it until it's merged.

The main loop: Hermes picks the next task and hands it to OpenCode, which branches, codes, commits and opens a PR. Hermes reviews the diff. If changes are needed it sends feedback and OpenCode pushes fixes. When Hermes approves and CI is green, OpenCode merges into main and Hermes moves to the next task, until the plan is complete

Here is a single task end to end, so you can see who talks to whom.

Sequence for one task: Hermes sends the task to OpenCode, OpenCode pushes a branch and opens a PR on GitHub, CI runs, Hermes reads the diff and requests changes, OpenCode pushes a fix, CI passes, Hermes approves, OpenCode merges, and Hermes pings my phone

How Hermes talks to OpenCode

Hermes drives OpenCode through its terminal tool, the same way you would by hand. There's an official optional Hermes skill for exactly this, which teaches Hermes how to use opencode run for one-shot tasks, how to run the TUI in the background for longer sessions, and which mistakes to avoid:

hermes skills install official/autonomous-ai-agents/opencode

A task handoff ends up looking roughly like this:

opencode run --dir ~/code/my-project \
  --title "task-03-refresh-endpoint" \
  "Implement task 03 from plan/tasks.md.
   Create branch feat/task-03-refresh-endpoint from main.
   Commit in small steps, run the test command from AGENTS.md before pushing,
   then open a PR with gh. Put 'Task 03' and the acceptance criteria in the PR body."

When review feedback comes back, Hermes continues the same OpenCode session instead of starting from zero, so OpenCode keeps its context about why it wrote things the way it did:

opencode run --dir ~/code/my-project --session <session-id> \
  "Review feedback on PR #14 is in the PR comments. Address every point, push to the same branch, reply on the PR."
Handoff: in round one Hermes runs opencode run with a task prompt and gets back a PR and a session ID; after review comments land, round two continues the same OpenCode session so context carries over

(These are the V1-style flags. OpenCode 2 is out now and its CLI has moved things around a bit, so check opencode run --help on your version.)

How Hermes reviews

For the GitHub side, Hermes uses its bundled github skill, which works through the gh CLI. A review pass is mostly these commands plus a lot of reading:

gh pr view 14 --json title,body,files,commits
gh pr diff 14
gh pr checks 14 --watch
gh pr comment 14 --body-file review.md

Hermes reviews against three things: the task's acceptance criteria, the rules in AGENTS.md, and the diff itself (bugs, missing tests, things that wandered out of scope).

The review gate: a PR has to pass three checks before merging. Does it match the task? Is the diff sound? Are all required CI checks green? Any failure sends feedback back to OpenCode

One gotcha that cost me an evening: both agents use my GitHub login, and GitHub won't let you approve your own pull request. So Hermes can't leave a formal "Approve" review. It posts its review as a PR comment, and the thing that actually blocks a bad merge is branch protection with required status checks on main. Hermes says "approved" in a comment, OpenCode is only allowed to merge when it sees that comment and green checks, and GitHub enforces the checks regardless of what either agent thinks. If you want real approvals, give one of the agents its own GitHub account or a GitHub App identity.

Why Hermes cannot approve: both agents share one GitHub login, so a formal approval is rejected; the real gate is Hermes's approval comment plus required checks, and an optional upgrade gives Hermes its own GitHub identity

Once both conditions are met, OpenCode merges:

gh pr merge 14 --squash --delete-branch

Keeping the loop going without me

The loop is only useful if it keeps turning without me typing "keep going" every twenty minutes. Hermes has a feature built for exactly this: /goal. You give it a standing objective, a small judge model checks after every turn whether it's done, and if not, Hermes feeds itself a continuation prompt and carries on. You can also attach quality gates, shell commands that have to pass before the goal can count as done:

/goal Execute every task in plan/tasks.md through the PR loop. Done when every task is checked off and nothing is left open.
/goal gate add test "$(gh pr list --state open --json number --jq length)" -eq 0

There's a turn budget, so a goal pauses instead of running forever, and you can pause, resume or clear it from your phone.

The goal loop: I set a goal once, Hermes takes a turn, a judge model decides whether it is done, a shell quality gate must pass before the goal is achieved, otherwise Hermes keeps going within a turn budget

The bots: one job each

All of this runs through Hermes Bot Mode. A bot in Hermes is just a profile: its own config, memory, skills, credentials and chat history under ~/.hermes/profiles/<name>/. Bot Mode puts a nice face on that. Each bot gets one permanent "Bot Chat" (so tapping a bot always lands you back in the same conversation), an avatar, and routines, which are plain Hermes cron jobs attached to the bot that runs them.

I keep each bot to a single job, so its memory and skills stay focused.

Bot roster: Conduit on the phone connects to one Hermes gateway on the Mac, which hosts several bots, each a separate profile with its own model, skills, memory and routines. Some bots drive OpenCode, some watch GitHub, one handles general Mac tasks
Bot Job Skills it needs
plan-captain Reviews plans, writes tasks.md, runs the loop for one repo opencode, github
pr-reviewer Reviews diffs against the task and AGENTS.md github
ci-watcher Watches checks, summarizes failures, nudges the right bot github
mac-butler Everything else on the laptop: disk space, updates, "is the build server still running?" terminal tools
morning-brief A routine that sends me what merged overnight and what's blocked github

Since a bot is a profile, everything has a CLI equivalent. hermes -p pr-reviewer chat opens the same agent from a terminal, and a bot's routines show up in hermes cron list. Hermes runs one gateway per machine that serves every local profile, so having five bots doesn't mean five backends.

Each bot's personality and standing rules live in its SOUL.md. Here's the gist of my reviewer's:

You are the PR reviewer for my personal projects.

- Review against: the task's acceptance criteria, AGENTS.md, then the diff.
- Never edit code yourself. Ask OpenCode for changes in a PR comment.
- Small nits: batch them into one comment. Don't block a PR on style alone.
- Never say "approved" while any required check is pending or red.
- If a PR touches anything listed under "Out of scope" in the plan, stop and ask me.

Reaching a closed laptop from my phone

Now the fun part. My phone is on mobile data somewhere in the city. My laptop is on home Wi-Fi with its lid shut. How does a tap in Conduit end up as a message to a bot?

Network path: the iPhone on mobile data and the MacBook on home Wi-Fi each run Tailscale. Traffic goes through an encrypted WireGuard tunnel between them, the Mac's dashboard listens only on its Tailscale address behind a password, and nothing is exposed to the public internet or the router

Conduit signs in to the Hermes dashboard, the web server that hermes dashboard starts. By default it binds to 127.0.0.1:9119, which is only reachable from the Mac itself. That's the right default, because the dashboard can read and write the .env file holding your API keys.

To reach it from the phone, I bind it to the Mac's Tailscale address instead of loopback. Hermes refuses to start a dashboard on a non-loopback address until you configure an auth provider, so first a password:

# one-time: set a username and password for the dashboard
hermes dashboard password --username shubham

# serve the dashboard on the Tailscale interface only
hermes dashboard --host "$(tailscale ip -4)" --port 9119 --no-open

Then in Conduit, I add the dashboard address http://100.x.y.z:9119 (the Mac's Tailscale IP) and sign in. Use the same address the dashboard bound to; the dashboard checks the Host header to block DNS-rebinding tricks, so a different hostname can get rejected even though it resolves to the same machine.

Why this is comfortable:

  • Nothing is on the public internet. The dashboard listens on an address that only devices in my tailnet can reach. No port forwarding, no tunnel service, no "I'll lock it down later."
  • Two locks. You need to be on my tailnet and know the password. The Hermes docs are explicit that the username/password provider is meant for trusted networks or VPNs, and a tailnet is exactly that.
  • It survives networks changing. Phone switches from Wi-Fi to 5G, laptop changes networks, Tailscale reconnects and the address stays the same.

For push notifications, voice calls and lock-screen approvals, Conduit has a free companion plugin for the Hermes host, the Hermes Conduit Notifier. With it installed, Hermes can ask me "allow gh pr merge?" and I answer straight from the notification, end-to-end encrypted between my Mac and my phone.

Closing the lid without killing everything

Here's the bit people don't believe until they try it. Close a MacBook's lid without an external display attached and macOS goes to sleep. Sleep means the gateway stops, OpenCode stops, Tailscale stops answering, and my phone starts talking to a brick.

Amphetamine fixes this with closed-display mode. My settings:

  1. Start a session set to Indefinitely.
  2. Allow the system to stay awake when the built-in display is closed.
  3. On Apple Silicon, install Power Protect, Amphetamine's optional add-on that stops a closed-display session from failing when the Mac is plugged in or unplugged from power.
  4. Keep the charger connected, and turn on Amphetamine's option to end the session if the battery runs low, just in case.
What stays awake with the lid closed: the built-in display sleeps, while an Amphetamine closed-display session keeps the system awake on charger power, so tailscaled, the Hermes gateway and dashboard, OpenCode, git and gh keep running

On Apple Silicon, Amphetamine also forces the built-in display to sleep when the lid is closed, to prevent burn-in. The Mac stays awake; only the screen is off. When you open the lid again you may need to unlock it, which is a nice reminder that someone was working while you weren't.

Two practical notes. A closed laptop has less room to shed heat, so I leave it flat on a desk rather than on a bed. And please don't put a running, awake MacBook in a backpack. That's not a dev setup, that's a hand warmer with a warranty problem.

A day with the night shift

Here's what a normal day looks like from the phone.

A day timeline: at 9:00 I push a plan and close the lid. Through the day Conduit notifications arrive: task list ready, a question about the migration answered with a tap, PRs opened, a review requesting changes, a CI failure that OpenCode fixes, merges, and an evening summary showing the plan is complete

Most of my involvement is answering a question or two and reading PR summaries while waiting for something else. The rest of the time, the two agents argue politely in PR comments and I find out who won when I check GitHub in the evening.

Guardrails, or how not to wake up to a deleted repo

Giving two agents the keys to your repo and your laptop deserves some respect. These are the layers I rely on, from outermost to innermost.

Guardrail layers from outside in: Tailscale and the dashboard password, Hermes command approvals answered in Conduit, OpenCode permission rules, branch protection with required checks on main, and small single-task PRs, with a bot loop guard and cost tracking alongside

Branch protection on main. Require pull requests and require your CI checks to pass. This is the one layer that doesn't depend on either agent behaving, which makes it the most important one.

Hermes approvals. Hermes can ask before running risky commands. Set the approval mode to manual (always ask) or smart (ask when it looks risky), and answer from Conduit. I keep merges and anything touching rm, git push --force or credentials behind an approval.

OpenCode permissions. OpenCode lets you allow, deny or ask per tool and per command pattern in opencode.json. Something like this keeps the obvious footguns out of reach:

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "bash": {
      "git push --force*": "deny",
      "git push -f*": "deny",
      "rm -rf *": "deny",
      "*": "allow"
    }
  }
}

Check the permissions docs for your OpenCode version, since the config format has changed between major versions.

Bots can't chat forever. When bots message each other, Hermes caps how many bot-to-bot messages an exchange can have (gateway.bot_loop_guard.max_hops, 4 by default). Two agents politely thanking each other until your API budget runs out is a real failure mode, and it's nice that someone already thought of it.

Watch the bill. opencode stats shows token usage and cost per model, and the Hermes dashboard has an analytics page with daily tokens and cost. I check both weekly.

Parallel tasks get separate worktrees. If you let Hermes run two tasks at once, give each its own git worktree. Two agents in one working directory will step on each other's files.

Things I learned the slightly hard way

  • Small tasks win. The best predictor of a smooth night is how small the tasks are. If Hermes writes a task I can't summarize in one sentence, I ask it to split it.
  • The plan is the product. Vague plan, vague code. I now spend more time on plan/ than I used to spend on tickets.
  • CI is the real reviewer. Hermes catches design and scope problems. Tests catch the bugs. Without decent tests, this whole setup is two confident agents agreeing with each other.
  • Ask for questions early. I tell my planning bot to ask everything it's unsure about before task 1 starts. One tap at 9am saves a wrong turn at 3pm.
  • Keep a human merge for scary stuff. Database migrations on anything real and auth changes get a manual merge from me. Everything else, the agents can have.

Set it up yourself

The short version, in order:

Setup roadmap in nine stops: install OpenCode, install Hermes and the skill, create bots, protect main, Tailscale on both devices, dashboard password, Conduit and Notifier, Amphetamine, then write a plan and close the lid
  1. Install OpenCode on the Mac and log in to a provider (opencode auth login).
  2. Install Hermes Agent, then add the OpenCode skill: hermes skills install official/autonomous-ai-agents/opencode. Make sure gh auth status works, since the bundled github skill uses gh.
  3. Create your bots in Bot Mode (or as profiles from the CLI), one job each, with a SOUL.md per bot.
  4. Protect main on GitHub: require PRs and required status checks.
  5. Install Tailscale on the Mac and the iPhone, and sign both into the same tailnet.
  6. Set a dashboard password with hermes dashboard password, then run hermes dashboard --host "$(tailscale ip -4)" --port 9119 --no-open.
  7. Install Hermes Conduit on the iPhone, add the dashboard address, sign in, and install the Conduit Notifier plugin on the Mac for notifications and approvals.
  8. Install Amphetamine, start an indefinite session with closed-display mode, and on Apple Silicon add Power Protect.
  9. Write a plan, drop it in plan/, message your planning bot, and close the lid.

Then go do literally anything else. Your laptop has work to do.

References

About the author

No comments yet. Be the first to comment.