{
  "markdown": "<div align=\"center\">\n\n# ☕ Claude Code Keep Alive Plugin\nKeep your machine awake while Claude works.\n\n[![CI](https://img.shields.io/github/actions/workflow/status/mrzeszowski/claude-code-keep-alive/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/mrzeszowski/claude-code-keep-alive/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/github/license/mrzeszowski/claude-code-keep-alive?style=flat-square)](LICENSE)\n[![Release](https://img.shields.io/github/v/release/mrzeszowski/claude-code-keep-alive?style=flat-square)](https://github.com/mrzeszowski/claude-code-keep-alive/releases)\n[![Platform](https://img.shields.io/badge/platform-macOS%20%C2%B7%20Linux%20%C2%B7%20Windows-6e40c9?style=flat-square)](#how-it-works)\n\n<img src=\"docs/demo.png\" alt=\"demo\" width=\"600\">\n\n</div>\n\nA [Claude Code](https://docs.claude.com/en/docs/claude-code) plugin that prevents your machine from sleeping during long Claude Code sessions. Inspired by GitHub Copilot CLI's `/keep-alive` command.\n\n## Install\n\nInside a Claude Code session:\n\n```text\n/plugin marketplace add mrzeszowski/claude-code-keep-alive\n/plugin install keep-alive@claude-code-keep-alive\n/reload-plugins\n```\n\nThat's it. The plugin's four slash commands are now available under the `/keep-alive:` namespace.\n\n## Usage\n\n| Command | What it does |\n| --- | --- |\n| `/keep-alive:status` | Show current state. |\n| `/keep-alive:on` | Inhibit sleep until you turn it off. |\n| `/keep-alive:on 30m` | Inhibit sleep for 30 minutes. (`m`, `h`, `d` suffixes; bare number = minutes.) |\n| `/keep-alive:off` | Release the inhibitor. |\n| `/keep-alive:busy` | Inhibit sleep only while Claude is actively processing. Idle time is allowed to sleep. |\n\nThe `keep-alive:` prefix is the plugin namespace — every Claude Code plugin's commands are prefixed by the plugin's name to avoid collisions across plugins.\n\n## How it works\n\n- **macOS:** spawns a detached `caffeinate -dis` process.\n- **Linux (systemd):** spawns a detached `systemd-inhibit --what=idle:sleep ... sleep` process.\n- **Windows:** spawns a detached PowerShell (`pwsh`) script using `SetThreadExecutionState`. Requires PowerShell 7+.\n\nState lives in `${XDG_CACHE_HOME:-$HOME/.cache}/claude-code-keep-alive/state` — a single global file shared across all your Claude Code sessions on this machine. `flock` (or a `mkdir`-based fallback on macOS) serializes concurrent invocations.\n\n`busy` mode is driven by two hooks shipped with the plugin: `UserPromptSubmit` starts the inhibitor, `Stop` tears it down. Both are no-ops unless you've explicitly opted in with `/keep-alive:busy`.\n\n## Updating\n\nInside a Claude Code session:\n\n```text\n/plugin update keep-alive@claude-code-keep-alive\n/reload-plugins\n```\n\nYou only receive updates when the plugin's `version` field is bumped (not on every commit). If the command reports the plugin is already up to date, you have the latest release.\n\n## Uninstall\n\n```text\n/plugin uninstall keep-alive@claude-code-keep-alive\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n",
  "bytes": 3084,
  "sha": "a57522eaa10b29c41aafd3ffadbd0fe6ee0b7462c03220efba22c67fdde28dc7",
  "repo_slug": "mrzeszowski/claude-code-keep-alive",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_mrzeszowski_claude_code_keep_alive_keep__891f03f7/readme"
}