---
title: "ClamGuard: close the lid without cooking your MacBook"
description: "Work on an external display with the lid shut. ClamGuard watches fans and heat, and eases heavy builds when closed."
url: "https://clamguard.eatingdream.dev/index.md"
canonical: "https://clamguard.eatingdream.dev/"
license: "MIT"
repository: "https://github.com/eatingDream-antigravity-plugins/ClamGuard"
updated: "2026-11-26"
lang: ["en", "zh-CN"]
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://clamguard.eatingdream.dev/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# ClamGuard (`mac-clamshell-mcp`)

> Work on an external display with the lid shut. ClamGuard watches fans and heat, and eases heavy builds when closed.

A native Rust macOS MCP server, live Antigravity dashboard, and CLI wrapper that watches lid state, power source, and thermal pressure to throttle heavy commands and guard closed-lid display state. Not a fan-curve writer, kernel extension, or global pmset modifier. It never asks for sudo and leaves dedicated fan managers untouched.

*中文简介*：合盖接外接显示器时，ClamGuard 帮你盯着风扇和温度，合盖后自动给重型编译降温限流。 原生 Rust 编写的 macOS MCP 服务、实时面板与 CLI 包装器：感知合盖、供电与热压力，自动节流重型构建并守护合盖屏幕状态。

## Agent Resources

- [llms.txt](https://clamguard.eatingdream.dev/llms.txt): Concise agent directory
- [llms-full.txt](https://clamguard.eatingdream.dev/llms-full.txt): Full bilingual technical specification
- [Search for Agents](https://clamguard.eatingdream.dev/.well-known/search?q={query}): Site-wide Markdown search (`GET` and `QUERY`)
- [Agent Skills Discovery](https://clamguard.eatingdream.dev/.well-known/agent-skills/index.json): Machine-readable skill manifest (v0.2.0)
- [Atom Feed](https://clamguard.eatingdream.dev/feed.xml) | [XML Sitemap](https://clamguard.eatingdream.dev/sitemap.xml) | [GitHub](https://github.com/eatingDream-antigravity-plugins/ClamGuard) | [AI Guide](https://github.com/eatingDream-antigravity-plugins/ClamGuard/blob/main/docs/ai-guide.md)

## Install

Install plugin and native binary:

```sh
curl -fsSL https://raw.githubusercontent.com/eatingDream-antigravity-plugins/ClamGuard/main/scripts/install.sh | sh
```

Add portable Agent Skill:

```sh
npx skills add eatingDream-antigravity-plugins/ClamGuard
```

## MCP Tools

- `clamshell_panel`: Opens the live dashboard and reports lid, power, thermal, fan, display guard, and active throttle tier.
- `clamshell_set_brightness`: Sets built-in display brightness (0-100%) when open, or queues wake-restore target while closed.
- `clamshell_lock_screen`: Locks the screen via SACLockScreenImmediate without sleeping background agent jobs.
- `clamshell_refresh`: App-only ETag-deduplicated telemetry polling after UI capability negotiation.
- `clamshell_configure`: App-only policy, display guard, thermal brightness cap, and language persistence.

## How It Works

### See fan speed and heat at a glance

Closing the lid traps heat under the keyboard. ClamGuard reads the real fan speeds and thermal state from the SMC without an admin password, and eases heavy builds when things warm up.

*中文*：合上盖子，热量就闷在键盘底下。ClamGuard 不用管理员密码，直接从 SMC 读出真实的风扇转速和热压力，升温时顺手给重型编译限流。

### Guard the screen without disturbing your monitor

Without an external display, ClamGuard puts the screen to sleep when you shut the lid. When docked on a monitor, it leaves your big screen awake and queues your saved brightness for when you open up.

*中文*：没接外接屏时，合盖就让内屏安心休眠；接了外接显示器时则绝不打扰大屏，只记下原本亮度，等你重新开盖再恢复。

### Gets along with Macs Fan Control

If you already use Macs Fan Control or TG Pro, ClamGuard notices right away and never clashes with it. It only reads fan speeds and never writes to the SMC or touches your fan curves.

*中文*：如果你已经在用 Macs Fan Control 或 TG Pro，ClamGuard 会一眼认出来且绝不冲突。它只读取转速，从不写入 SMC，也不碰你的风扇曲线。

## Dynamic Thermal and Clamshell Throttle Profiles

| Profile | Trigger Condition | QoS and Concurrency Cap |
| --- | --- | --- |
| Normal | Lid open and nominal thermal pressure | Full speed, no throttling |
| Utility | Lid closed on AC power | Utility QoS (nice 10), E-core cap (2-4 jobs) |
| Eco | Lid closed on battery | Background QoS (nice 15), max 2 jobs (1 at <=20%) |
| Strict | Serious or critical thermal pressure | Lowest priority (taskpolicy -b, nice 19), 1 job |

## Safety and Privacy

1. Zero root and zero SMC writes: never requires sudo, never writes SMC/NVRAM/kexts, and stores state in owner-only 0700/0600 files.
2. Hardware-confirmed brightness guard: refuses brightness writes unless hardware confirms the lid is open and internal display is awake.
3. Compile-time #[cfg(test)] hardware refusal: unit and integration tests can never lock your screen, sleep displays, or spawn daemons.
4. Zero outbound network traffic: 100% local Rust binary communicating exclusively over local MCP stdio.

## Suite Navigation

- [eatingDream Hub](https://eatingdream.dev/) (`eatingdream.dev`)
- [ContextRadar](https://contextradar.eatingdream.dev/) (`contextradar.eatingdream.dev`)
- [RemoteCast](https://remotecast.eatingdream.dev/) (`remotecast.eatingdream.dev`)
- [ColabDeck](https://colabdeck.eatingdream.dev/) (`colabdeck.eatingdream.dev`)

```json
{"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://clamguard.eatingdream.dev/#website","name":"ClamGuard | eatingDream","url":"https://clamguard.eatingdream.dev/","description":"Work on an external display with the lid shut. ClamGuard watches fans and heat, and eases heavy builds when closed.","inLanguage":["en","zh-CN"],"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://clamguard.eatingdream.dev/.well-known/search?q={search_term_string}"},"query-input":"required name=search_term_string"}},{"@type":"SoftwareApplication","@id":"https://clamguard.eatingdream.dev/#software","name":"ClamGuard","alternateName":"mac-clamshell-mcp","url":"https://clamguard.eatingdream.dev/","description":"Work on an external display with the lid shut. ClamGuard watches fans and heat, and eases heavy builds when closed. A native Rust macOS MCP server, live Antigravity dashboard, and CLI wrapper that watches lid state, power source, and thermal pressure to throttle heavy commands and guard closed-lid display state.","applicationCategory":"DeveloperApplication","operatingSystem":"macOS (Apple Silicon and Intel)","license":"https://github.com/eatingDream-antigravity-plugins/ClamGuard/blob/main/LICENSE","codeRepository":"https://github.com/eatingDream-antigravity-plugins/ClamGuard","author":{"@type":"Organization","name":"eatingDream","url":"https://eatingdream.dev/"},"offers":{"@type":"Offer","price":"0","priceCurrency":"USD"},"featureList":["See fan speed and heat at a glance","Guard the screen without disturbing your monitor","Gets along with Macs Fan Control"]},{"@type":"TechArticle","@id":"https://clamguard.eatingdream.dev/#guide","headline":"ClamGuard (mac-clamshell-mcp): macOS clamshell and thermal guard","description":"Work on an external display with the lid shut. ClamGuard watches fans and heat, and eases heavy builds when closed.","url":"https://clamguard.eatingdream.dev/","mainEntityOfPage":"https://clamguard.eatingdream.dev/","dateModified":"2026-11-26","inLanguage":["en","zh-CN"],"author":{"@type":"Organization","name":"eatingDream","url":"https://eatingdream.dev/"},"about":{"@id":"https://clamguard.eatingdream.dev/#software"},"isPartOf":{"@id":"https://clamguard.eatingdream.dev/#website"}}]}
```
