Codex Power is a tiny native macOS utility for turning a MacBook into a thin client for long-lived Codex sessions, except the whole thing now looks like it escaped from Windows 95 on purpose.
It is a very small app with one job: switch a MacBook between three power tiers.
- Normal: restores Apple's default
pmsetvalues so lid close and idle sleep behave normally. - Codex: disables system sleep, keeps network sessions alive, uses low-power battery mode, and lets the display turn off quickly.
- Goblin: Codex Mode plus max power mode where the Mac supports it.
Goblin Mode is a nod to Codex's very real 2026 goblin moment, which OpenAI wrote about in "Where the goblins came from".
The app is intentionally boring under the hood: SwiftUI, AppKit, App Intents, pmset, and macOS's native administrator prompt. No daemon. No separate helper agent. No Electron. No elaborate background service quietly deciding it knows better than you.
This is an unofficial personal utility. It is not affiliated with OpenAI, Apple, or the Codex product team.
Changing sleep settings requires administrator approval. Codex Power does not store your password. By default it asks macOS to present the standard admin prompt for each privileged action. If you install the optional sudoers allowlist below, toggles stop asking every time.
Here is the whole gag in motion: one extremely unnecessary Windows 95 control panel for one extremely practical Mac power switch.
Here is the main window, which is a native Mac app cosplaying as a beige control panel with unsettling commitment.
Here is the menu bar extra in the actual macOS top bar, because the app also registers itself where a laptop power toggle morally belongs.
Here is the raw pmset disclosure, because sometimes the correct UI is just showing the receipts in a scroll box and letting the user decide whether reality is acceptable.
For the least annoying install:
- Clone or download this repo.
- Open Terminal in the repo folder.
- Run:
./Scripts/setup.shThat builds the app, installs it to /Applications/Codex Power.app, installs the narrow passwordless pmset allowlist after one normal macOS admin prompt, and opens any missing Siri shortcut imports.
Expected macOS prompts:
- Enter your Mac password once for the
pmsetallowlist. - Click Add Shortcut for the five Codex Power shortcuts if Shortcuts opens import previews.
- If Shortcuts asks about scripting actions, enable Shortcuts > Settings > Advanced > Allow Running Scripts once.
After that, the app and Siri shortcuts should switch modes without repeated password prompts.
To build a distributable DMG:
./Scripts/package_dmg.shThat writes dist/Codex-Power-<version>.dmg. Without Apple Developer credentials, the script creates a normal ad-hoc-signed local build. With a Developer ID identity and notarization credentials, it signs the app with hardened runtime, signs the DMG, submits it to Apple's notary service, and staples the ticket.
Local notarized build:
export CODEX_POWER_SIGN_IDENTITY="Developer ID Application: Your Name (TEAMID)"
export CODEX_POWER_DMG_SIGN_IDENTITY="$CODEX_POWER_SIGN_IDENTITY"
export CODEX_POWER_NOTARY_KEYCHAIN_PROFILE="codex-power"
./Scripts/package_dmg.shThe notary profile is created once with xcrun notarytool store-credentials. The script also accepts CODEX_POWER_APPLE_ID, CODEX_POWER_APP_SPECIFIC_PASSWORD, and CODEX_POWER_TEAM_ID if you prefer environment variables over a keychain profile.
For the full Apple Developer ID, notarization, and GitHub Actions secret setup, see Apple Signing and Notarization.
- Normal / Codex / Goblin switches modes from one beige little panel.
- Refresh in the tiny menu rereads
pmsetand battery status without changing anything. - pmset opens the raw status panel so you can inspect what macOS currently thinks is true.
- The menu bar icon opens a native menu with the same power actions, status, battery readout, and a way to bring the window back after hiding it.
- Siri asks to escalate Codex to Goblin makes the "Enable Codex Mode" Siri intent ask whether you want the max-power tier too.
The app also registers a codexpower:// URL scheme for automation. codexpower://codex-mode enables Codex Mode, codexpower://goblin-mode enables Goblin Mode, codexpower://disable-goblin drops back to Codex Mode, codexpower://normal-sleep restores Normal, and codexpower://refresh refreshes status.
| Mode | Sleep | Power profile | Best for |
|---|---|---|---|
| Normal | Restores Apple's defaults with pmset restoredefaults. |
Apple default. | Walking away, packing the Mac, or normal laptop use. |
| Codex | Sets sleep 0, disablesleep 1, ttyskeepawake 1, and tcpkeepalive 1. |
Low power on battery, standard power on AC. | Lid-closed thin-client sessions. |
| Goblin | Same no-sleep settings as Codex. | High power on battery and AC where supported. | Maximum responsiveness while the Mac is parked and ventilated. |
The app source includes native App Intents/App Shortcuts for:
- "Enable Codex Mode"
- "Disable Codex Mode"
- "Enable Goblin Mode"
- "Disable Goblin Mode"
- "Refresh Codex Power"
On macOS 15 or newer, enabling Codex Mode by Siri can ask: "Would you like to escalate to Goblin Mode?" Toggle that behavior in the app.
The default ./Scripts/setup.sh flow also installs generated Shortcuts with the same names. That is the reliable Siri path for command-line-tool builds, because macOS may not immediately index native App Intent metadata from a self-built app bundle.
To reinstall the generated Shortcuts manually:
./Scripts/install_siri_shortcuts.shThe generated shortcuts run exact passwordless pmset commands and speak a short result. They avoid the per-run "Allow this shortcut to open Codex Power?" prompt because they do not use the Open URL action for mode changes.
On first use, macOS may ask you to allow Shortcuts to run scripts. That is a Shortcuts safety setting; approve it once for these generated shortcuts.
If you are upgrading an older local install and Siri keeps finding stale shortcuts, open Shortcuts, delete the Codex Power shortcuts, then rerun ./Scripts/install_siri_shortcuts.sh. Fresh installs do not need that cleanup.
Codex Power works in tandem with macOS instead of replacing System Settings. It writes the same underlying pmset values that macOS uses for sleep, display sleep, disk sleep, network wake behavior, and low-power mode.
That means there is no separate shadow state. If you change sleep behavior in System Settings after using Codex Power, macOS may overwrite some of these values. If you press Codex Mode again, Codex Power writes its preferred values back. Last writer wins, and the app's status panel shows the current truth from pmset.
- Codex Power does not make network requests.
- Codex Power does not collect telemetry.
- Codex Power does not store or transmit passwords.
- The app reads local
pmsetand battery status so it can display the current power state. - The optional passwordless setup writes
/private/etc/sudoers.d/codex-powerwith an allowlist of exact/usr/bin/pmsetcommands. It does not grant general passwordless sudo. - The generated Siri shortcuts run those same exact local
pmsetcommands and use/usr/bin/sayfor audible confirmation.
To stop macOS from asking for a password every time, install the narrow pmset sudoers allowlist once:
sudo ./Scripts/install_passwordless_pmset.shThis writes /private/etc/sudoers.d/codex-power for the current console user. It allows only the exact pmset commands Codex Power uses for Normal, Codex, and Goblin. The app tries passwordless sudo -n pmset ... first and falls back to the normal macOS admin prompt if the allowlist is missing.
Remove it with:
sudo ./Scripts/uninstall_passwordless_pmset.shsudo ./Scripts/uninstall_passwordless_pmset.sh
rm -rf "/Applications/Codex Power.app"Generated Siri shortcuts can be deleted from Apple's Shortcuts app.
Build and open:
./build.sh
open "build/Codex Power.app"./Scripts/install.shInstalls to /Applications/Codex Power.app.
./Scripts/verify.shThe verification script type-checks Swift, validates the plist, builds the app bundle, checks the signature, and confirms the expected executable and icon exist.
GitHub Actions runs the same verification on push and pull requests, then builds a DMG artifact with ./Scripts/package_dmg.sh.
Codex Mode intentionally prevents sleep, including lid-close sleep. That is useful for a deskbound thin-client workflow, but it is not a replacement for Apple's normal clamshell recommendations.
Do not leave a closed, awake MacBook in a bag or any poorly ventilated place.
Requirements:
- macOS 14 or newer
- Xcode Command Line Tools
- Swift compiler from CLT
Build output lives in build/ and is ignored by Git.
MIT



