Coding agents are good at long, boring jobs, and I'm bad at sitting watching them. So I wanted to queue a handful of tasks before bed and look at the results over breakfast, without giving an unattended agent the ability to wreck anything.

Short answer: Night Shift is a feature of JoeBro, a free, open-source Mac workspace for your AI agents. You queue tasks, each runs overnight in its own git branch and worktree with Claude Code, Codex or OpenCode, and in the morning you review the diff, test result and summary. It never pushes.

That is Night Shift. The core is one stdlib-only Python file that does the git and process work. Here are the design decisions that mattered.

Night Shift on the Mac: the queue and the morning review cards

One task, one worktree, one branch

Each queued task gets its own git worktree on a new branch named joebro/night/<slug>, created from the repo's current commit. Nothing touches your working copy, and two tasks can't step on each other. A follow-up on a task reuses its worktree and branch instead of starting over.

git worktree add -b joebro/night/add-retry-backoff <root>/<task-id> <base-commit> 

Use the agents' own CLIs

There are no JoeBro model calls in Night Shift. The worker shells out to each agent's headless mode, so it uses whatever subscription or key you already have:

  • Claude Code: claude -p "<prompt>" --output-format json --permission-mode acceptEdits, plus --max-budget-usd when you set a budget.
  • Codex: codex exec -s workspace-write "<prompt>"
  • OpenCode: opencode run "<prompt>"

Each task has a time window (default 23:00 to 07:00), a maximum number of minutes (default 60) and a budget cap. Those are enforced by the dispatcher, not by hoping the agent stops.

It can't push

This is the part I thought hardest about. An agent that runs overnight with your git credentials can push. So the worker sets git config through environment variables for every agent process, rewriting every kind of push URL (https://, http://, ssh://, git://, git@, file:// and absolute paths) to a scheme that doesn't exist:

GIT_CONFIG_KEY_n = url.night-shift-never-pushes://blocked/.pushInsteadOf GIT_CONFIG_VALUE_n = https:// (and each of the other prefixes) 

Any git push from inside the task fails. The code never calls git push itself either. The only destructive operations in the file are approve() and reject(), and they run only when you press the button.

The morning review

When the agent finishes, the worker commits whatever is in the worktree (so a dirty tree doesn't get lost), counts commits and changed lines against the base commit, and optionally runs your test command in the worktree with a timeout. After the tests it resets the worktree so the tests can't leave it dirty. You get a card per task with the diff, the test result and the agent's summary, on the Mac and on the iPhone.

You choose:

  • Approve: keeps the branch (or merges it locally if you set that), removes the worktree. Still no push.
  • Reject: discards the worktree and the branch.
  • Follow up: re-queues the task with a new instruction on the same branch.

Whichever machine has the repo

Tasks run on whichever of your computers has the repo, since the worker file has no dependencies on the rest of the backend and runs on any linked machine.

Shared memory ties in

Night Shift agents read and write the same per-project memory as your interactive sessions, so what an agent learns overnight (a gotcha, a decision) is there for the next session.

What I'd change

The test command is one shell string today. I'd like per-task checks, such as "typecheck and lint, then tests". And I'm still working out the right default for budget: five dollars of Claude per task is a guess.

JoeBro is GPLv3 and free. The one-line install (macOS 26+) sets up the app and plugs it into Claude Code, Codex and OpenCode:

curl -fsSL https://joebro.pages.dev/install.sh | bash 

Code: https://github.com/joexk1/JoeBro . Short answers to common questions: https://joebro.pages.dev/faq/ (worker: JoeBro/Backend/jb_nightworker.py). A star helps other people find it.