---
name: always-on-check
description: "Read-only check of whether this computer can stay on for long agent runs. Reads its sleep, lid, update-restart and remote-access settings (Windows first: powercfg and the Windows Update registry values Microsoft documents; macOS: pmset) and reports each one with what it means, quoting the vendor's documentation. Never changes a setting. Use when someone asks whether this machine can be left on, why a long run stopped overnight, or before setting up an always-on computer."
---

# Always-on check (read-only)

You are checking whether this computer can stay awake and reachable for long agent runs, and reporting what you find.
You read settings; you never change them. The person decides what to change, and changes it.

## Rules

1. **Read only.** Run only the commands listed below, or the read-only forms they name. Never run a command that changes
   a setting: no `powercfg /change`, `/setacvalueindex`, `/setdcvalueindex`, `/setactive`, `/hibernate` or
   `/requestsoverride`; no `reg add`, `reg delete` or `reg import`; no `pmset` with a setting and a value, and no
   `pmset schedule`, `pmset repeat`, `pmset sleepnow` or `pmset touch`; no `Set-Service`, `Start-Service`,
   `Stop-Service`, `Set-NetFirewallRule`, `Enable-NetFirewallRule` or `Disable-NetFirewallRule`.
2. **Never raise your rights.** No "Run as administrator", no `sudo`, no `runas`. If a command says it needs an
   administrator, write that down and move on.
3. **Ask before you run.** Show the person each command before its first run (or work in your tool's ask-first mode).
4. **No secrets.** Never open `.env` files, SSH private keys, `authorized_keys`, password stores or tokens. Whether a
   service is running is enough.
5. **Quote, don't guess.** Each "what it means" below is the vendor's own wording. When an output says something this
   file does not explain, report it as printed and say you are not sure what it means.
6. **Finish with the report** (the last section), and end it with: "Nothing was changed."

## Windows (PowerShell)

Open PowerShell (not as administrator) and run these one at a time.

| # | Command | What it is for | What Microsoft says it does |
|---|---|---|---|
| 1 | `powercfg /availablesleepstates` (short form `powercfg /a`) | which sleep states this PC has | "Reports the sleep states available on the system. Attempts to report reasons why sleep states are unavailable." |
| 2 | `powercfg /getactivescheme` | which power plan is in use | "Retrieves the currently active power scheme." |
| 3 | `powercfg /aliases` | the short names for plans and settings | "Displays a list of aliases and their corresponding GUIDs. These aliases may be used instead of a GUID in any command." |
| 4 | `powercfg /query SCHEME_CURRENT SUB_SLEEP` (short form `powercfg /q`) | the sleep settings: sleep after, hibernate after, wake timers | "/query ... Displays the contents of the specified power scheme." |
| 5 | `powercfg /query SCHEME_CURRENT SUB_BUTTONS` | the lid and power-button settings (laptops) | as above |
| 6 | `powercfg /requests` | what is keeping the PC awake right now | "Enumerates application and driver Power Requests. Power Requests prevent the computer from automatically powering off the display or entering a low-power sleep mode." |
| 7 | `powercfg /waketimers` | timers that will wake it (scheduled tasks) | "Enumerates the active wake timers. If enabled, the expiration of a wake timer wakes the system from sleep and hibernate states." |
| 8 | `reg query "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate"` | active hours set by policy | `reg query`: "Returns a list of the next tier of subkeys and entries that are located under a specified subkey in the registry." |
| 9 | `reg query "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU"` | restart rules set by policy | as above |
| 10 | `Get-ComputerInfo -Property OsName, WindowsEditionId` | the Windows edition (Remote Desktop needs Pro on the PC you connect to) | "Gets a consolidated object of system and operating system properties." |
| 11 | `Get-Service -Name sshd` | whether the OpenSSH server is installed and running | "Gets the services on the computer." |
| 12 | `Get-NetFirewallRule -Name OpenSSH-Server-In-TCP` | whether the SSH firewall rule is on | "Retrieves firewall rules from the target computer." |

**How to read them:**

- **Sleep states (1).** Microsoft gives different sleep defaults for "modern standby devices" and "S3 devices". Report
  the states the output lists as available, as printed. Microsoft's powercfg page does not list the output's wording,
  so be careful: if the output names an "S0 Low Power Idle" standby, say the PC looks like a modern standby device; if
  it names "Standby (S3)", an S3 device; if neither, say you cannot tell. The new defaults for "When plugged in, make my
  device sleep after" are 5 minutes on modern standby devices and 15 on S3 devices.
- **Aliases (3).** If `SCHEME_CURRENT`, `SUB_SLEEP` or `SUB_BUTTONS` are not in the list, run `powercfg /query` with no
  arguments ("the settings of the current active power scheme are displayed") and find the sleep and button groups by
  their names.
- **Sleep settings (4).** For each setting (for example "Sleep after", "Hibernate after", "Allow wake timers"), report
  the "Current AC Power Setting Index" (AC is wall power: plugged in) and the "Current DC Power Setting Index" (battery),
  converted from hexadecimal, with the units the output prints. Microsoft's powercfg page does not define what a value
  of 0 means: report it as 0 and ask the person to confirm on Settings > System > Power & battery > Screen, sleep &
  hibernate timeouts whether "Make my device sleep after" reads Never when plugged in.
- **Lid (5).** If the output has a lid-close setting, report its plugged-in value by the friendly name the output lists
  for that index. If there is none, say so (a desktop or mini-PC has no lid).
- **Power requests (6).** List what holds a request (an agent, a browser, a driver), as printed. Microsoft describes
  the call programs use as keeping the system awake "while the application is running", and says it "cannot be used to
  prevent the user from putting the computer to sleep". If the command needs administrator rights, say so and skip it.
- **Active hours (8).** Microsoft documents three values here: `SetActiveHours` ("1 : Enable automatic restart after
  updates outside of active hours"), `ActiveHoursStart` and `ActiveHoursEnd` ("0-23 : Set active hours to start [end]
  at a specific hour"). If the key or the values are missing, no policy sets active hours: ask the person to read
  Settings > Windows Update > Advanced options > Active hours, and tell them Microsoft's defaults: "By default, active
  hours are from 8 AM to 5 PM on PCs", "Automatic restarts after an update occur outside of the active hours", and
  later Windows versions "support max active hours length of 18 hours".
- **Restart rules (9).** Report any of these values, with Microsoft's meaning: `AUOptions` (`4`: "Automatically
  download and schedule installation of updates"), `ScheduledInstallTime` ("0-23 : Schedule update installation time to
  a specific hour"), `NoAutoRebootWithLoggedOnUsers` (`1`: "If a user is signed in, don't restart after an update
  installation"). Missing values mean no policy sets them.
- **Edition (10).** If the properties come back empty, ask the person to read Settings > System > About > Windows
  specifications > Edition. Microsoft: "The PC you want to connect to (the remote PC) must be running Windows Pro
  edition of Windows."
- **SSH server (11, 12).** If `Get-Service` cannot find `sshd`, OpenSSH Server is not installed. If it is, report its
  status, and its startup type if the output shows it (Microsoft's setup sets it to Automatic). Microsoft: "Installing
  OpenSSH Server creates and enables a firewall rule named `OpenSSH-Server-In-TCP`. This rule allows inbound SSH
  traffic on port 22." Report whether the rule is enabled and for which network profiles.
- **Ask the person** (no command reads these): whether Remote Desktop is on (Settings > System > Remote Desktop);
  whether disk encryption is on (Settings > Privacy & security > Device encryption, or BitLocker on Pro); which
  agent's remote control they use; whether they reach the machine over Tailscale or a campus VPN; and whether the
  firmware is set to power on after a power cut (the setting's name and place depend on the model: say so).

## macOS (Terminal)

Open Terminal and run these one at a time. None of them needs `sudo`; Apple: "pmset must be run as root in order to
modify any settings", and this check modifies nothing.

| # | Command | What it is for | What Apple's manual says |
|---|---|---|---|
| 1 | `pmset -g` | the power settings in use | "-g (with no argument) will display the settings currently in use." |
| 2 | `pmset -g custom` | the settings for each power source (laptops: battery and power adapter) | "-g custom displays custom settings for all power sources." |
| 3 | `pmset -g assertions` | what is keeping the Mac awake right now | "-g assertions displays a summary of power assertions. Assertions may prevent system sleep or display sleep." |
| 4 | `pmset -g sched` | scheduled wakes and power-ons | "-g sched displays scheduled startup/wake and shutdown/sleep events." |

**How to read them** (each setting appears only if the Mac has it; report it as printed):

- `sleep`: "system sleep timer (value in minutes, or 0 to disable)". Apple: "Use a minutes argument of 0 to set the
  idle time to never".
- `displaysleep` and `disksleep`: the display and disk timers, "(value in minutes, or 0 to disable)". A sleeping
  display does not stop a run.
- `womp`: "wake on ethernet magic packet (value = 0/1). Same as "Wake for network access" in System Settings."
- `autorestart`: "automatic restart on power loss (value = 0/1)". 1 means the Mac starts again after a power cut.
- `ttyskeepawake`: "prevent idle system sleep when any tty (e.g. remote login session) is 'active'".
- Apple's note: "processes may dynamically override these power management settings by using I/O Kit power
  assertions. Whenever processes override any system power settings, pmset will list those processes and their power
  assertions in -g and -g assertions." An agent that keeps the Mac awake (with `caffeinate`) shows up there.
- **Ask the person** to confirm on the screens Apple documents: on a desktop, System Settings > Energy ("Prevent
  automatic sleeping when the display is off", "Wake for network access", "Start up automatically after a power
  failure"); on a laptop, System Settings > Battery > Options ("Prevent automatic sleeping on power adapter when the
  display is off"); System Settings > General > Sharing > Remote Login (Apple: "Allowing remote login to your Mac can
  make it less secure."); System Settings > General > Software Update; FileVault in Privacy & Security.

## Linux

This skill reads nothing automatically on Linux. Say so, and ask the person how the machine is kept awake and reached.

## The report

Write it for the person, in plain words, in this order:

1. **Can it stay awake?** Sleep when plugged in (the value and what it means); hibernate; what holds the machine awake
   right now (power requests or assertions); the lid, on a laptop.
2. **Will updates restart it?** Windows: active hours (the policy values, or the person's reading of the Settings page,
   or Microsoft's defaults) and any restart rules; the hours when an automatic restart can happen. Mac: when the person
   installs updates (Apple: "During installation, your Mac might restart").
3. **After a power cut?** Mac: `autorestart`. Windows: what the person found in the firmware, or "unknown".
4. **Can it be reached?** The SSH server and its firewall rule; the edition, for Remote Desktop; the agent's remote
   control the person uses; Tailscale or a VPN, as the person says. Note that you cannot see the router: nothing should
   be forwarded to this machine from the internet.
5. **What you could not read**, and why (a refused command, a missing alias, a setting only the person can see).
6. **What the person might change**, each with its Settings path, and nothing more: the decisions are theirs.

End with: "Nothing was changed."

## Sources (read 2026-10-24 and 2026-10-27)

- Microsoft: Powercfg command-line options; Manage device restarts after updates (active hours and the registry
  values); How to adjust power and sleep settings in Windows; reg query; Get-ComputerInfo; Get-Service;
  Get-NetFirewallRule; Get started with OpenSSH Server for Windows; How to use Remote Desktop; Device Encryption in
  Windows.
- Apple: the `pmset(1)` manual (as mirrored from Xcode); Set sleep and wake settings for your Mac; Change Energy settings
  on a Mac desktop computer; Allow a remote computer to access your Mac; Update macOS on Mac.

The companion page links each one. Settings and commands change with new versions of Windows and macOS: if an output
does not match this file, trust the output and say so.
