Let My Agent Sleep
AI agents start long-running jobs, stop waiting, and resume a supported session when the job finishes. No polling. No token burn from waiting.
npx let-my-agent-sleep install
● Handles 17-hour training runs end to end · requires tmux · MIT
Waiting is the expensive part.
A long job doesn't need a babysitter. But most agents don't know that — so they sit there and spend.
Your agent burned tokens all night checking a log
It kicked off a 12-hour training run, then read the same log every 10 seconds until morning. Thousands of checks, zero new information — and you paid for every one. That's where LMAS was born.
One handoff, one wake-up
The agent starts the job and goes quiet. Hours or days later — the moment the job ends — the supported session wakes with the result and full context, and keeps working.
What a research loop looks like.
When a run fails, the agent wakes, fixes, and relaunches. When it succeeds — even 20 hours later — the supported session picks up and continues.
python -u training/train.py -c configs/qat/exp_b.yaml — handoff returned, session sleeps.stderr.log, finds a bad config path, fixes it, and relaunches. Turnaround: ~1 minute.nohup python -u training/train.py -c configs/qat/exp_a.yaml > train.log & — and now it has to stay awake.sleep 10 && tail -n 5 train.log — "step 4/4000". Still running. Check again.Failures wake you too.
A crashed run wakes the agent in seconds — not discovered dead the next morning.
The agent designs the next step itself.
Five runs in one session — smoke → eval → full → relaunch → full eval — with no scheduler and no job chaining. Each completion event is just a prompt; the agent decides what's next.
One session, zero polling.
The whole multi-day loop runs in a single session — no restarts, no re-priming.
What you actually get.
Survives everything
Close the app, compact the context, run for days — the job and the wake-up outlive the agent.
Crashes get fixed in minutes
A failed run wakes the agent immediately — not found dead the next morning.
Zero polling burn
No polling loop, no "continue" spam. The session sleeps until there's something worth waking for.
Nothing to run
bash + tmux and plain files. No LMAS daemon, no cloud, no database.
And two things it will never do: kill your job with a timeout, or decide your next run for you.
Works with your agent.
OpenCode
PrimaryFull plugin, server-backed wake-up.
Codex
SupportedAutomatic same-session resume.
Claude Code
ExperimentalResume when available; prompt fallback.
Why not just use nohup?
nohup keeps the process alive. LMAS also records a handoff, watches completion, and wakes a supported agent session with the stdout, stderr, metadata, and artifact paths it needs to continue.
Does LMAS make completion free?
No. The wake-up prompt still costs tokens. LMAS removes the waiting portion: the log polling, repeated continues, and context reloads while the job is still running.
Do I need to change my training code?
No. The agent wraps your existing command with LMAS. Your script still runs as the same command, in the same working directory, with stdout and stderr captured.
What does it require?
tmux must be installed. LMAS itself has no daemon, database, cloud scheduler, or project-specific callback. OpenCode wake-up still needs the owning OpenCode server/session alive at completion.