# Getting started

awake keeps the computer awake while an agent works and lets it sleep once the agent goes quiet. It
starts and stops the hold itself, going by what the agent does, so there is no `caffeinate` to
remember in a spare terminal.

## Install

In Claude Code:

```bash
claude plugin marketplace add localixai/plugins
claude plugin install awake@localix-lab
```

Restart Claude Code. It runs on macOS and Linux and needs `node` 20 or later on the `PATH` the
agent's hooks see. On Linux it holds through `systemd-inhibit`, which works from a desktop session.

The same folder is also an [Agent Plugins](https://agent-plugins.org) package (`plugin.json` and
`hooks.json` at its root), so a client of the core loads it as it is.

## What counts as work

Every prompt, tool call, tool result, subagent, compaction and answer counts as work. The computer
stays awake until 15 minutes after the last one, then the hold ends and the system's own sleep
settings apply again. The plugin reads nothing in the event and sends nothing back to the agent.

Some work sends no event for a long time. In Claude Code the plugin also counts it as work: a model
turn still running, a tool call that takes long, and background work the agent waits on after it
answered, such as a build started with `run_in_background`, a background subagent or a monitor.
While any of these lasts, the plugin marks the activity once a minute. It writes nothing but that
one file in its own folder, starts no process, and stops when the session ends. Waiting for you,
on a permission prompt or a question, does not count.

## Is it holding now?

In Claude Code the status line under the prompt says so: `awake: 14m` while the computer is held,
with the minutes left; `awake: waiting: 1 task` while it is held for background work; and
`awake: not held` when the system refused the hold. Once no agent has worked for 15 minutes, the
line goes away.

In a shell, or in another client:

```bash
awake status
```

Claude Code puts the plugin's `bin/` on the `PATH` of its shell, so the agent can run it too. The
answer is the keeper's process id and how long the computer stays awake. When nothing holds it,
the answer says why: no agent worked in the last 15 minutes, `node` was not found, or the system
refused the hold (`systemd-inhibit` outside a desktop session says `Access denied`). After a
refusal the plugin waits ten minutes before it tries again. macOS shows the hold in
`pmset -g assertions`, Linux in `systemd-inhibit --list`.
