Everything you need to know about Insomnia — the smart Windows sleep prevention utility.
Install Insomnia and add a trigger. Use the manual Keep Awake toggle for immediate effect, add an application as a watched trigger (stays awake while it runs), or enable an AI integration (stays awake only during active AI work). Insomnia uses Electron's powerSaveBlocker API to prevent Windows from entering sleep mode.
Enable the Claude Code integration in Insomnia. It installs hooks in ~/.claude/settings.json that fire on UserPromptSubmit, PreToolUse, PostToolUse, PermissionRequest, and Notification events — keeping Windows awake precisely while Claude is running tools and generating code. The sleep lock is released within 3 minutes after Claude finishes its last action.
Yes. Insomnia polls ~/.cursor/projects/*/agent-transcripts/**/*.jsonl every 5 seconds. These files are only written during active Cursor Agent sessions, so the PC stays awake only while the Agent is actively working — not just because Cursor is open and idle.
Yes, via two detection paths: a notify hook in ~/.codex/config.toml for CLI usage, and session transcript polling at ~/.codex/sessions/**/*.jsonl for VS Code extension and standalone app usage. Both signals are combined so all Codex surfaces are covered.
Yes. Aider is detected via process monitoring — Insomnia checks whether aider.exe is running every 10 seconds. There's a 30-second grace period after the process disappears before the sleep lock is released.
Yes. Ollama is detected via process monitoring — Insomnia watches for ollama.exe and ollama_llama_server.exe. The PC stays awake during local model inference and releases within 30 seconds after Ollama stops.
Setting the screen timeout to "Never" keeps your PC awake permanently, wasting power and wearing your hardware. Insomnia keeps the PC awake only while a trigger is active — the moment all triggers go inactive, normal Windows sleep behavior resumes automatically. It's the difference between leaving the lights on all day versus a motion-sensor light.
Use the manual Keep Awake toggle — flip it on before you present, off when you're done. Alternatively, add your presentation software (PowerPoint, Keynote for Windows, browser) as a watched app so Insomnia keeps the PC awake automatically whenever the app is running.
Three options:
1. Direct download — grab the .exe installer from GitHub Releases and run it.
2. winget — run winget install StanleyProjects.Insomnia in any terminal.
3. Scoop — run scoop bucket add stanley-projects https://github.com/stanley-projects/scoop-stanley then scoop install stanley-projects/insomnia.
No. Insomnia is Windows-only (Windows 10 and Windows 11). It uses Windows-specific APIs: tasklist for process detection, PowerShell for app discovery, and the Windows powerSaveBlocker. There are no plans for other platforms.
Yes. Insomnia is completely free, open-source, and MIT licensed. There are no accounts, subscriptions, in-app purchases, or telemetry of any kind. Nothing leaves your machine.
Insomnia itself is extremely lightweight — it polls tasklist every 10 seconds and checks a few small files every 5 seconds. Sleep prevention does keep your display on, using more power than sleep. But Insomnia releases the sleep lock automatically when all triggers go inactive, so your PC sleeps normally the rest of the time.
Yes. Click + Add in the main window, go to the Apps tab. Insomnia auto-discovers all installed apps from Start Menu, registry, Microsoft Store, and desktop shortcuts. Search for your app or use "Browse manually…" to select any .exe. Each app has its own enable/disable toggle.
The purple owl (eyes open) in the system tray means Insomnia is actively preventing sleep. The grey owl (eyes closed) means no triggers are active and Windows will sleep normally. Hover over the tray icon to see exactly why it's awake: e.g. "Staying awake for — Claude Code" or "Staying awake for — Manually triggered".