NoLidSleep: Instructions file for Claude Code

CLAUDE.md

NoLidSleep CLAUDE.md is an instructions file for Claude Code 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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is jark006/NoLidSleep's own configuration. It tells Claude Code how to work on NoLidSleep itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything NoLidSleep configures →

Reuse

Borrowing it

Nothing to install: this file belongs to jark006/NoLidSleep. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/jark006/NoLidSleep/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/jark006/NoLidSleep

Made for: Claude Code.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for NoLidSleep CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/jark006/nolidsleep/claude-md"><img src="https://agentmods.dev/badge/instructions/jark006/nolidsleep/claude-md.svg" alt="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00773 $0.00773
Opus 5.5 $0.00309 $0.00309
Sonnet 5.5 $0.00155 $0.00155
Haiku 4.5 $0.00077 $0.00077

Measured 2mo ago against content hash 701a5929ede1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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_DESTROY、CtrlHandler、wWinMain 末尾均调用 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. 2mo 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 5mo ago), licensed MIT. It adds 773 tokens to every session, about $0.0031 per session on Opus 5.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.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,461 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,750 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens