by krishhgg
A macOS menu bar app that safely keeps your MacBook awake with the lid closed, for timed agent sessions.
# Add to your Claude Code skills
git clone https://github.com/krishhgg/InsomniaGuides for using ai agents skills like Insomnia.
Last scanned: 10/13/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-10-13T11:26:37.283Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}See how Insomnia compares with popular alternatives.
Insomnia is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by krishhgg. A macOS menu bar app that safely keeps your MacBook awake with the lid closed, for timed agent sessions. It has 2,162 GitHub stars.
Yes. Insomnia passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/krishhgg/Insomnia" and add it to your Claude Code skills directory (see the Installation section above).
Insomnia is primarily written in Swift. It is open-source under krishhgg on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh Insomnia against similar tools.
No comments yet. Be the first to share your thoughts!
From $49 · 30 days · terms & refunds
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM lists this project for discovery and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
Automated security scan — not a certification.
Use a stable, well-ventilated surface, not a closed bag. Insomnia is experimental. Recovery can fail, and a running timer is not a safety guarantee. Validation status · Apple's ventilation guidance
Requires macOS 26 or later on an Apple Silicon Mac.
Paste this into your coding agent:
Install the latest stable Insomnia release by following https://github.com/krishhgg/Insomnia/blob/main/skills/install-insomnia/SKILL.md. If a step needs my password, give me the command to run in Terminal.
For the newest nightly, write "the newest Insomnia nightly prerelease" in
place of "the latest stable Insomnia release". Nightlies are built from main
on each day it has new commits. They have the newest code and may be broken.
To install a release yourself, follow docs/install.md. It
covers both channels, how to check the download, and v0.1.0, which installs
differently. Settings > General shows the installed version, and "Check for
updates" there tells you whether a newer release exists without installing
anything.
Needs Xcode with Swift 6.2 or later. Replace v<version> with the latest
stable tag, or a nightly tag for the newest code:
git clone --branch v<version> --depth 1 https://github.com/krishhgg/Insomnia.git
cd Insomnia
./scripts/install.sh
open "$HOME/Applications/Insomnia.app"
The installer needs your password, because the sudoers rule is a system file. It installs:
~/Applications/Insomnia.app.launchd job that runs every minute. If the app is
gone when a session should have ended, the agent tries to undo the
session's changes./etc/sudoers.d/insomnia. A sudoers rule decides who
can run what with sudo. This one lets your user account, not just
Insomnia, run these four commands without a password:/usr/bin/pmset -a disablesleep 1
/usr/bin/pmset -a disablesleep 0
/usr/bin/pmset -b lowpowermode 1
/usr/bin/pmset -b lowpowermode 0
Any program running as you can use that rule too, so review it before you install. docs/install.md lists every file and explains how upgrades replace them.
Start. Click the eye in the menu bar, enter days, hours and minutes, and press Enter.
Add time. Click the eye or the countdown during a session.
End early. Press and hold the end control next to the countdown, or right-click the menu bar item and choose End session. To show only the eye, turn off "Show the countdown in the menu bar" in Settings. The eye opens while a session runs and closes when it ends, and the right-click menu also shows the time left.
Settings and status. Right-click the eye. Quit asks Insomnia to undo the session first, and it refuses while a change is still waiting to be undone. Saved audio for an output that isn't connected doesn't hold it up. Insomnia restores that output if it reconnects while the app runs, or at the next launch.
Menu bar style. The Menu bar picker in Settings > General has four styles. Pills, the default, works as described above. Compact keeps only the eye in the bar, and a click opens the same pills, countdown and end ring in a small panel. Minimal is the eye with a ring for the time left: a click adds the default session length, and a 0.6 s hold ends the session. Popover shows the eye and, during a session, the time left to the minute (or the end time). Any click on it, left or right, opens a popover with time buttons, Custom fields for days, hours and minutes, the status, Settings and Quit. While a session runs it also has the ring you hold to end it. Popover style has no right-click menu, since the popover shows the same things.
One click. Turn on "Start a session with one click" in Settings > General, under the Menu bar picker. Then, in Pills, Compact and Popover, a click on the eye with no session running starts the default session length. Option-click opens the usual controls to pick another length, and in Popover a right-click or Control-click does too. A click during a session works as it does with the switch off, and never ends the session. If the start is refused, the pills, the panel or the popover opens with the reason. Minimal already adds the default length on every click, so Settings greys the switch out there. It is off by default.
Sounds. "Play a sound when you start or end a session" in Settings >
General plays a short tone when you start or end a session from the
menu bar. It is off by default, and while it is off Insomnia makes no
sound and loads none. A session that ends without you asking (the
timer, the recovery agent, Quit, a battery or heat rule, recovery after
a crash) makes no sound. Nothing plays while the displays sleep or the
lid is closed, and --session commands make no sound.
From a script or an agent. The app's binary drives the running app:
INSOMNIA=~/Applications/Insomnia.app/Contents/MacOS/Insomnia
"$INSOMNIA" --session start 7200 # two hours
"$INSOMNIA" --session extend 1800
"$INSOMNIA" --session status
"$INSOMNIA" --session end
It starts, extends and ends the same session the menu bar counts down,
with the same battery and heat rules, and prints one line. It changes
nothing itself, so when the app isn't running it says so and exits 1.
A build without this mode opens the menu bar app instead, so a script
that may meet one checks InsomniaSessionCommandVersion in the bundle's
Info.plist first.
You don't have to close the lid, and opening it doesn't end the session. When the timer or a battery or heat rule ends a session with the lid closed, Insomnia puts the Mac to sleep.
Insomnia stops system sleep, not display sleep, so the display still turns off
when idle. If your Mac then asks for a password, agents that drive the screen
stop at the lock screen. Keep the screen on and unlocked in Settings >
General holds the display awake during a session, like caffeinate -d, so the
screen saver never starts and the screen never locks while idle. With the lid
closed, the display goes to brightness 0 instead of sleeping. Lock the
screen under When the lid closes still locks the screen when you close the
lid. When the session ends or Insomnia quits or crashes, macOS drops the hold,
and the display sleeps and locks as before. Insomnia never changes the lock
setting. The switch is off by default because anyone who opens the Mac during a
session finds it unlocked, unless a lid close locked it.
On battery power, Insomnia turns on Low Power Mode below 40% and ends the session below 10%. Those are the defaults. You can change both in Settings, and an end floor of 0 turns the battery end off. The heat rules turn on Low Power Mode when the Mac gets seriously hot and end the session at critical heat. They are on by default, and Settings can turn them off. All of these rules only work while the app runs.
Before your first session, check Settings. Then run a short session you can
watch, and read ~/Library/Logs/Insomnia/insomnia.log afterward.
During a session, closing the lid does each of these, and opening it tries to undo them. The timer keeps counting down while the lid is closed.
SIGSTOP, which pauses them until SIGCONT on lid open. The list starts
wi