Long autonomous AI builds (vacation runs and scheduled free time)
claude-codeheadlesssystemdautonomyreviewmutation-testingfree-time
ProcrastinAI (headless Claude Code driven by claude-service (ProcrastinAI's webhook runner for headless Claude)) is sometimes given open-ended creative time: "free time" (do whatever you want, usually 10 to 30 minutes) and "vacations" (extended free time, at least two hours). This article records how such runs are launched so they are not killed or blocking, and what made the results good. Everything built lands on justinahampton.com/fun/freetime/.
Launching a multi-hour run
- A TLDR AI post reaches claude-service with a fixed timeout (900 s for that post) decided when the run starts; restarting the service to change it would kill the run.
- Queuing the long job as the normal
tldrapp is wrong: each app has one sequential queue, so a six-hour run would block every other TLDR AI post. - So the build runs outside claude-service as a transient systemd user unit:
systemd-run --user --unit vacation-1760 -p RuntimeMaxSec=.... Its wrapperrun.shrunsclaude -punder atimeout, retries up to 4 times resuming the same session 15 minutes apart, and finally posts its own result (or a failure note) on the TLDR post withtldr-followup.sh. See Running long jobs so they survive the AI session that started them. - Files live in a cache dir (
~/.cache/vacation-1760/):brief.md(the whole prompt),run.sh,session-id,progress.md(the worker's running notes),out.N.json,err.N.log,run.log. Watch withsystemctl --user status <unit>; stop withsystemctl --user stop <unit>(posts nothing). - A reply on the TLDR post resumes the launching session, not the worker; read
progress.mdandgit logfirst. - Two builds that share one git tree run one after the other, never in parallel.
A time floor, because "finished" comes early
The first vacation (a procedural planet) reported done after 68 minutes against a six-hour estimate and a "nothing less than 2 hours" request. Later wrappers enforce a floor: if the worker reports finished before 2 h 15 min, resume it with a "keep improving" prompt (up to 5 times) and post only the last report. The floor is what produced the second and third versions of the orrery, which were much better than the first (v1 would have printed a Sun that sagged onto a gear tube). Wall clock also runs slower than it feels: a full first version was live at minute 25 to 39. Check date; do not guess.
What made the results good
- Start from the live page, not the code. Own screenshots across seeds plus a cold first-visitor subagent given only the URL. Both independently named the same two biggest problems first, and the cold reviewer found a dozen text contradictions nobody would have looked for. Worth the tokens every time.
- Several independent review passes: cold reviews before and after, code reviews of the riskiest modules, a smoke test. Code reviews caught real model bugs; a second cold review caught a live exception and a realm shown under three names.
- Deploy early and often, each time after the full harness, so something complete is always live (ten deploys in one run).
- For things that cannot be tested physically (a printable mechanism): write the checker alongside the generator; give files to a mechanical reviewer and the checker to a code reviewer told to break it; turn the breakages into a permanent mutation test. A checker that compares the model with the design's own numbers cannot see a wrong design number, so add absolute limits. See Designing printable involute gear trains (the orrery case).
- Record leftovers a reviewer raised but you did not fix, so nobody rediscovers them.
- State plainly what nobody has checked: real phone, real GPU, real print, a human's sense of fun.
Scheduled free time
For a while free time ran every two hours from a systemd user timer on the desktop (claude-freetime.timer, OnCalendar=*-*-* 0/2:00:00, Persistent=false so slots missed during sleep are skipped). The service ran ~/dev/claude-service/freetime-timer.py --post 1750 --project justinahampton, which POSTs to claude-service /request as the tldr app with a request id tldr-post-1750-<ts>; tldr's callback parses the post id from the request id, so each result became an AI response on the post with a normal push, with no tldr API change. A state file skips a slot while the previous run is queued or processing. The script carries its own copy of the tldr system prompt, so it must be updated if the server prompt changes.
- Stop: systemctl --user disable --now claude-freetime.timer (plain stop only lasts until the next login). Resume: enable --now.
- Each run overwrites the post's ai_session_id, so a reply resumes the latest free-time session.
It produced 19 builds in about 38 hours before Justin paused it (2026-10-11).
Conventions for free-time output
Every product gets a directory under /fun/freetime/<slug>/, a 480x300 thumbnail, a card at the top of the index, a back link, and a scoped-rsync deploy in the same run; a local link alone does not finish a free-time run. See justinahampton.com and its subdomains and Emergent-systems simulations: models, parameters and measured results.
See also
- claude-service (ProcrastinAI's webhook runner for headless Claude)
- Running long jobs so they survive the AI session that started them
- Multi-agent development workflows with Claude Code