v0.4.2Lid-closed mode for coding agents

Close the lid.
Your agents keep working.

Afterhours keeps your Mac awake while coding agents work, then lets it sleep when the last one finishes.

For macOS 14 or later. Afterhours isn't notarized yet, so the first time you open it, go to System Settings › Privacy & Security and click Open Anyway.

  • Claude Code
  • Codex
  • OpenCode
  • Antigravity CLI
  • Gemini CLI
  • Copilot CLI
  • Cursor CLI
  • Aider
  • Amp
  • Droid
  • Goose
  • Kiro CLI
  • Kilo CLI
  • OpenClaw
  • Hermes Agent
  • Cline CLI
  • Grok Build
  • Qwen Code
  • Crush
  • Pi
  • fx
Terminal
1:47 AM

Awake for 0h 42m

Lid can close

Battery

82%

About 3h 05m until it sleeps at 15%

Agents

2 of 3 sessions working
  • 1 not running
Session25% leftRuns out in 38m · resets in 1h 17m
Weekly36% left~8% left at reset · resets in 21h 17m
Session88% left
Weekly66% left
Gemini · 5-hour91% left
Claude & GPT (shared) · Weekly97% left

Pause

Psst… it’s interactive. Flip the switch, click an agent, or

The everyday details

Stays up late. So you can go to bed while agents finish the job.

Works with the lid closed

A one-time sudoers rule lets it hold sleep off after you shut the lid.

CodexNeeds you

Waits for your reply

Plugged in, it waits until every session closes. On battery, up to an hour.

Battery23%

About 25m until it sleeps at 15%

Lets go before your battery does

Sleeps anyway below your cutoff, in Low Power Mode, or when it runs hot.

Awake
Paused
Sleeping

Steam shows the state

Two wisps, it’s awake. One, it’s paused. None, your Mac can sleep.

⌥⌘L

One shortcut turns it off

Press ⌥⌘L anywhere to turn Afterhours on or off.

$ afterhours-hook amp
--state working

Hooks for any tool

Anything with hooks can report working, waiting, or idle.

Claude CodeIdle after 15m

Catches stuck sessions

Esc skips Claude Code’s Stop hook, so a silent “working” session times out.

AfterhoursNetwork
Analytics
None
Your code
Never read
Limit checks
Optional

No telemetry

It only talks to your providers to show your limits, and you can turn that off.

Go to bed.
Let them ship.

Download for Mac

For macOS 14 or later. Afterhours isn't notarized yet, so the first time you open it, go to System Settings › Privacy & Security and click Open Anyway.