Repository navigation
Nightshift: four small bash guardrails for leaving a coding agent running overnight #35996
toolshedlabs-hash
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We run coding agents unattended overnight, and the failure we kept bracing for was a crash. A crash turns out to be the cheap one. You lose a few hours and start again after coffee.
The expensive night is the one that never crashes. The agent stays confident and keeps working. At 6am there are eight hours of output that no test ever ran against, plus a bill.
So we stopped tuning prompts and wrote the boring layer instead. Four ideas and four small bash scripts, MIT:
A handoff file rewritten (not appended) at the end of every unit of work, holding the goal, the status right now, the single next action, the traps you already hit and what has actually been verified rather than merely claimed, so that a fresh run reads that one file and carries on as if nothing happened.
A verification gate that fails closed. "I wrote the code" and "the code works" feel the same from the inside, so the check has to sit outside the thing being checked.
A runaway guard with three independent stops: an iteration cap, a wall clock deadline, and a stop file that you or a failed gate can drop.
A morning brief with the verdict on the first line.
It has no loop of its own and no dependencies, so it does not care which agent you run. There is nothing Codex specific in it and nothing to integrate: you already have a way to start the agent, this wraps it.
https://github.com/toolshedlabs-hash/nightshift
Clone it and run ./examples/demo.sh to watch a simulated bad night get caught. About 300 lines total. Taking the ideas and writing your own version is a completely fine outcome.
There is also a paid pack at 5 dollars that adds a cost ledger with a hard ceiling and an orchestrator that runs the pieces as one loop. The four free scripts are the honest core of it. If they already stop your bad nights, keep your money.
The handoff format is the part we are least sure about. Ours keeps drifting and it still feels wrong to hand a model a file that is half state and half instructions. If you have a shape that works, I would like to see it.
All reactions