NoLidSleep CLAUDE.md

NoLidSleep CLAUDE.md is an instructions file for coding agents from jark006/NoLidSleep. It costs 773 tokens per session, scanned A, original, MIT.

Repository instructions for NoLidSleep, a Windows desktop program that temporarily prevents a laptop from sleeping when its lid is closed.

In plain words
What is it for?
Use them to build the release executable and understand the Windows power-management and Win32 source files.
Why use it?
They describe how the program changes power settings, restores them on exit, and is organized, reducing the risk of breaking its safety behavior.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/jark006/nolidsleep/claude-md
Clone the repo
git clone --depth 1 https://github.com/jark006/NoLidSleep

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for NoLidSleep CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/jark006/nolidsleep/claude-md.svg)](https://agentmods.dev/instructions/jark006/nolidsleep/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/jark006/nolidsleep/claude-md"><img src="https://agentmods.dev/badge/instructions/jark006/nolidsleep/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 773 This file is loaded in full into every session.
When invoked 773 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00773 $0.00773
Opus 5 $0.00387 $0.00387
Sonnet 5 $0.00155 $0.00155
Haiku 4.5 $0.00077 $0.00077

Measured 4d ago against content hash 701a5929ede1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

NoLidSleep CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 55 lines

What it actually says

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

项目简介

NoLidSleep 是一个 Windows 桌面工具,用于临时阻止笔记本合盖睡眠。启动时将"合盖时执行"动作设为"不操作"(交流+电池均生效),同时调用 SetThreadExecutionState 阻止系统空闲睡眠;退出时恢复为"睡眠"。

构建

本项目优先使用 PowerShell 执行仓库根目录下的 buildRelease.ps1 脚本进行编译、构建:

# Release x64 构建
./buildRelease.ps1

输出路径: x64\Release\NoLidSleep.exe

架构

单文件 Win32 GUI 应用,无框架依赖:

  • NoLidSleep/src/main.cpp — 全部逻辑:电源方案读写、窗口创建、消息循环、DPI 适配
  • NoLidSleep/include/Resource.h — 资源 ID 定义
  • NoLidSleep/NoLidSleep.manifest — DPI 感知声明 + Common Controls 6 依赖
  • NoLidSleep/NoLidSleep.rc — 资源脚本(图标、菜单、对话框)

核心机制

  1. ApplyBlock() — 获取当前电源方案 GUID,通过 PowerWriteACValueIndex / PowerWriteDCValueIndex 将合盖动作改为 0(不操作),再 PowerSetActiveScheme 生效,同时 SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED) 阻止空闲睡眠
  2. Restore() — 将合盖动作改回 1(睡眠),SetThreadExecutionState(ES_CONTINUOUS) 取消睡眠阻止
  3. g_restored 标志确保只恢复一次(WM_DESTROYCtrlHandlerwWinMain 末尾均调用 Restore()

关键 GUID

  • 电源子组 GUID_SUB_BUTTONS (4f971e89-eebd-4455-a8de-9e59040e7347) — Power buttons and lid
  • 设置项 GUID_LIDCLOSE_ACTION (5ca83367-6e45-459f-a27b-476b1d01c936) — Lid close action

DPI 适配

双重保障:manifest 声明 PerMonitorV2 + 运行时 EnableDpiAwareness() 兜底。所有布局尺寸通过 Dp() 函数按 g_dpi/96 缩放。窗口创建时使用 AdjustWindowRectExForDpi(优先)或 AdjustWindowRectEx 计算客户区。

编译选项

  • 语言标准: C++23,C17
  • 字符集: Unicode (wWinMain)
  • 额外编译选项: /utf-8 /Zc:__cplusplus
  • 链接选项: 嵌入 manifest (/MANIFEST:EMBED /MANIFESTINPUT:NoLidSleep.manifest)
  • 链接库: PowrProf.lib, User32.lib, Gdi32.lib, Imm32.lib

退出方式

点击"恢复并退出"按钮、窗口关闭按钮、ESC 键、空格键均可退出,退出时自动恢复电源设置。

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 55 lines · 773 tokens per session scan A 701a5929ede1

Subscribe to this mod's changes

NoLidSleep CLAUDE.md is an instructions file published in the GitHub repository jark006/NoLidSleep (2 stars, last pushed 3mo ago), licensed MIT. It adds 773 tokens to every session, about $0.0039 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.