My Overnight AI Coding Setup#

A few people have asked me this, so here it is in one place. This is my personal setup for personal side projects — not necessarily a recommendation for work machines or company code. Written by Harry Thomas. Last reviewed: September 2026.


TL;DR#

Question Short answer
Which $20/mo subscription? Codex, for me. Better output per token on my workload, no 5-hour usage window, and I can use my codex subscription on third-party harnesses.
How do I prompt from my phone? opencode web --mdns + Tailscale, added to my home screen as a PWA.
Do you type all those prompts? No. I dictate them with OpenSuperWhisper (FOSS, on-device). When prompting from my phone, I use my google pixel which has excellent STT.
How do I run tasks overnight? gnhf, with a laptop kept awake via pmset aliases.

1. Picking a subscription#

I ran both Codex and Claude Code side by side for about two months on the same side projects, then cancelled Claude Code.

What decided it: on high reasoning, I was consistently getting better output than Sonnet for a fraction of the usage. After three overnight gnhf sessions I still had ~50% of my weekly Codex quota left. Codex also has no 5-hour limit, which matters a lot if you want to kick off work at 11pm. And Codex allows you to use your subscription with external harnesses, something claude-code charges an extra usage fee for.


2. Prompting from my phone#

I run opencode on my laptop at home and reach it from my phone over a VPN.

Setup:

opencode web --mdns

This serves the web UI on port 4096 and advertises it on the local network. I put the laptop and phone both on my Tailscale network (free for personal use), so the laptop is reachable from anywhere without exposing anything to the internet.

On the phone, open the UI in the browser and use Add to Home Screen. It then behaves like an installed app, which makes it realistic to actually queue up work from the couch.


3. I dictate my prompts instead of typing them#

If you're like me, you can verbally regurgitate a paragraph much faster than typing it.

For macOS, I use OpenSuperWhisper — MIT licensed, free, and it runs entirely on-device.

brew install --cask my-monkeys/tap/opensuperwhisper

Then go to Finder → Applications → open OpenSuperWhisper

When prompting from my phone, I use my phone's STT (which is excellent on the Google Pixel).


4. Keeping the Mac awake with the lid closed#

Two aliases for ~/.zshrc. The display still turns off; the machine keeps working.

alias awake="sudo pmset -b sleep 0; sudo pmset -b disablesleep 1; echo 'I wont go to sleep!'"
alias sleepy="sudo pmset -b sleep 10; sudo pmset -b disablesleep 0; echo 'Feeling really sleepy...'"

Rename them to whatever you like.

What the flags do:

  • sleep 0 — never idle-sleep. sleep 10 puts the idle timer back to 10 minutes.
  • disablesleep 1 — ignore lid close. This is the one that actually lets you shut the laptop.
  • b — scopes the setting to battery power.

5. Running tasks overnight with gnhf#

I use gnhf to drive unattended sessions. I found it through this walkthrough from the author, which is worth the time.

💡 The thing that makes this economical: split planning from implementation. I have a higher-reasoning model build the plan or backlog first, then let cheaper, faster agents implement against it overnight.

Before you leave it running:

  • Work on a dedicated branch. You want to be able to throw the whole night away.
    • For my personal projects, I create a gnhf branch to work out off of, then open a PR in the morning.
    • My self-hosted projects' (I self-host my personal projects via Coolify) staging environments auto-deploy from the repo's gnhf branch changes on push, so I can monitor the frontend progress of the gnhf session and its latest commit.
  • Open a PR in the morning to review all code changes and do an automated AI code review.

6. A worked example#

Three gnhf sessions produced Kanji Forge, an app I use to study Japanese characters. The plan for each session was written by a higher-reasoning model, then implemented by faster agents.

Those three sessions are documented here: gnhf-cli.md

For small tweaks, I still tweak the app by hand in opencode whenever I hit a bug or something I don't like.

For big refactors, to-do lists or goals that are up to interpretation, especially after each loop, I try to automate those with gnhf.



Questions welcome. If something here has gone stale, ping me and I'll update it rather than let people copy-paste the wrong thing.