Free & Open Source · Windows

Keep your PC awake
when it matters

Insomnia prevents Windows from sleeping — automatically when AI coding tools are working, when specific apps are running, or manually on demand. No more broken sessions.

↓ Download for Windows View on GitHub
Insomnia app — keep Windows awake during AI coding sessions

You're running Claude Code or Aider on a long task. You step away. Your PC falls asleep, kills the process, and you come back to a broken session and lost work. Setting your sleep timeout to "Never" works — but then your PC never sleeps when you actually want it to.

Insomnia fixes this. It stays awake only while something needs it, then gets out of the way.

Features

Smart, not blunt

Hook-based AI integration

For Claude Code and Cursor, Insomnia hooks directly into the tool's event system — awake while the AI is working, asleep the moment it stops. Precise to the second.

📋

App watching

Add any app as a trigger. Insomnia auto-discovers every installed app on your system. When it's running, you stay awake. When it closes, you don't.

🔘

Manual toggle

Need to stay awake right now? One switch. No timers, no fuss. Toggle it off when you're done. Perfect for presentations.

🦉

Lives in the tray

A purple owl means awake. A grey owl means inactive. The hover tooltip tells you exactly why. Close the window — it keeps running.

Zero bloat

Plain HTML, CSS, and JS. No React. No bundler. Zero external runtime dependencies. Installs in seconds and uses almost no resources.

🔒

Local and private

Nothing leaves your machine. No telemetry, no accounts, no cloud. Settings are stored locally and that's it.

Integrations

Built for AI-assisted coding

Tool Type How it works
✨ Claude Code Smart Hook-based — awake only while Claude is actively running tools. Idle for 3 min = asleep.
✏️ Cursor Smart Agent transcript polling — awake while Cursor Agent is actively working. Idle for 3 min = asleep.
🤖 Aider Process Awake while Aider is running. 30s grace after it closes.
💻 OpenAI Codex Smart Hook + session-activity based — awake while Codex is actively working in CLI, VS Code, or the standalone app.
🧠 Ollama Process Awake during local model inference. 30s grace after Ollama stops.
Install

Get started in 30 seconds

Download the installer and run it. Or use a package manager:

# winget winget install StanleyProjects.Insomnia
# Scoop scoop bucket add stanley-projects https://github.com/stanley-projects/scoop-stanley
scoop install stanley-projects/insomnia
↓ Download Installer (.exe)

Windows 10/11 · Free · Open Source (MIT)

FAQ

Common questions

How do I keep my Windows PC from sleeping?

Install Insomnia and add a trigger. Use the manual Keep Awake toggle for immediate effect, enable an AI integration to stay awake only during active AI work, or add any application as a watched trigger. Insomnia uses Electron's powerSaveBlocker API to prevent Windows from sleeping.

Does Insomnia work with Claude Code?

Yes. Enable the Claude Code integration and Insomnia installs hooks in ~/.claude/settings.json. Your PC wakes the moment Claude starts working and sleeps within 3 minutes after the session goes idle.

Does Insomnia work with Cursor?

Yes. Insomnia polls ~/.cursor/projects/*/agent-transcripts/**/*.jsonl every 5 seconds — files only written during active Cursor Agent sessions. The PC stays awake only while the Agent is working, not just because Cursor is open.

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

Setting power settings to "Never" keeps your PC awake permanently, wasting power and battery. Insomnia keeps it awake only while a trigger is active — the moment all triggers go inactive, normal sleep behavior resumes automatically.

Is it free? Does it have telemetry?

Completely free, MIT licensed, open source. No accounts, no subscriptions, no telemetry. Nothing leaves your machine.

See all FAQs →

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