Frequently Asked Questions

Everything you need to know about Insomnia — the smart Windows sleep prevention utility.

How do I keep my Windows PC from sleeping?

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.

How do I prevent Windows from sleeping during Claude Code sessions?

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.

Does Insomnia work with Cursor?

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.

Does Insomnia work with OpenAI Codex?

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.

Does Insomnia work with Aider?

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.

Does Insomnia work with Ollama?

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.

How is Insomnia different from setting Windows power settings to "Never"?

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.

How do I keep my PC awake during a presentation?

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.

How do I install Insomnia?

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.

Does Insomnia work on macOS or Linux?

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.

Is Insomnia free?

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.

Does Insomnia drain my battery?

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.

Can I add my own application as a trigger?

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.

What does the purple owl mean?

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".

keep windows awake · prevent windows from sleeping · stop pc sleep · caffeine windows · keep pc awake during presentation · prevent sleep windows 11 · sleep prevention utility · stay awake windows · windows power settings · no sleep mode · claude code keep awake · cursor keep awake · ai coding sleep prevention