DESIGN.mdB

DESIGN.md from cn0xroot/cc-monitor is a DESIGN.md file: the design rules coding agents follow in that repo.

Install it, pinned
mdr add cn0xroot/cc-monitor/DESIGN.md@git:20260914.cc15ae5

Pins git:20260914.cc15ae5 in mdr.lock. Pin the fingerprint instead.

Audit grade
B, 13 of 14 checks passed
Kind
DESIGN.md file
Repository
cn0xroot/cc-monitor
Path
DESIGN.md
Versions recorded
6
Latest version
git:20260914.cc15ae5, committed Sep 14, 2026
First version recorded
Sep 12, 2026
Size
13,826 bytes
Repository stars
65
License
MIT

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# AI 操作监测工具 —— 技术方案设计

[English](./DESIGN.en.md) | 简体中文

## 1. 背景与目标

监测对象:Claude Code 在本机执行的所有可能影响系统安全或数据安全的操作——文件读写、命令执行、网络访问、以及其它 Claude Code 工具能触发的操作。

目标:
- **可见**:记录 Claude Code 做了什么(谁、何时、对什么、做了什么操作、结果如何)。
- **可控**:对高危操作能够拦截/告警/需人工确认,而不是只能事后审计。
- **难绕过**:监测能力不能被 Claude Code 自身(无论是正常行为还是被提示注入劫持后的行为)轻易关闭。
- **跨平台**:Linux 和 macOS 都要能用,核心逻辑尽量共用一套代码。

## 2. 监测范围

对应 Claude Code 的操作可归纳为四类:

| 类别 | 具体操作 | 对应 Claude Code 工具 |
|---|---|---|
| 文件读写 | 读取文件、写入/覆盖文件、编辑(diff)、批量替换 | Read / Write / Edit / NotebookEdit |
| 命令执行 | Shell 命令、后台进程、脚本 | Bash |
| 网络访问 | 抓取网页、调用外部 API/MCP 服务 | WebFetch / WebSearch / MCP 工具 |
| 元操作 | 派生子 Agent、跨会话消息、权限模式切换 | Agent / SendMessage / 权限模式变更 |

需要重点防范的两类结果:**破坏系统**(删文件、改配置、执行危险命令)和**泄露数据**(读取凭据/密钥后通过网络外发)。

## 3. 总体思路:双层监测架构

单纯依赖 Claude Code 自身上报(hooks)有一个根本问题:如果 Claude Code 进程被绕过、hooks 配置被篡改,或者攻击者通过其它路径(比如诱导用户直接改配置)关闭监测,监测就形同虚设。因此设计上采用 **应用层 + 系统层** 两道防线:

- **应用层(主力,语义丰富)**:利用 Claude Code 内置的 Hooks 机制(`PreToolUse` / `PostToolUse` 等),在每次工具调用前后拦截,拿到结构化信息(工具名、参数、cwd、session_id)。优点是信息语义清晰("Bash 执行了 rm -rf /tmp/x"),成本低(几个 shell/Python 脚本即可跨平台)。缺点是这一层运行在被监测对象自己的框架内,理论上可被篡改配置绕过。
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add cn0xroot/cc-monitor/DESIGN.md@sha256:6ee6f2ae13f7a248

The line at the top of this page pins the label git:20260914.cc15ae5, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_afgnnixyesndy3bg.svg)](https://markdownregistry.com/a/art_afgnnixyesndy3bg)

2 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 6 versions of this file, between Sep 12, 2026 and Sep 14, 2026, more than one a day.

versioncommittedcommitsizeaudit
git:20260914.cc15ae5 latest2026-09-14 cc15ae5 13,826 BB view · diff
git:20260914.f82265c2026-09-14 f82265c 13,028 BB view · diff
git:20260914.8c4ea332026-09-14 8c4ea33 11,676 BB view · diff
git:20260914.c73a6152026-09-14 c73a615 11,681 BB view · diff
git:20260913.7daae472026-09-13 7daae47 10,300 BB view · diff
git:20260912.45f2b1c2026-09-12 45f2b1c 10,094 BB view

Audit of the latest version

B  13 of 14 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • fail: No curl or wget piped into a shell (matched: curl|bash)
  • pass: Size between 200 bytes and 200 KB (13826 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Starting a new one? Use a template for DESIGN.md on mdpantry, which passes every one of these checks and says what to change in it.

Source

GitHub

cn0xroot/cc-monitor · 65 stars · license MIT · pushed 2026-09-28 · branch master

API

GET https://markdownregistry.com/api/v1/artifacts/art_afgnnixyesndy3bg
GET https://markdownregistry.com/api/v1/resolve?ref=cn0xroot/cc-monitor/DESIGN.md
GET https://markdownregistry.com/api/v1/blob/6ee6f2ae13f7a24869e89532fef40fb150b4619e2ec4d45df7ab481e3a24b17a

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: what DESIGN.md is and how agents use it · which agent file does what.

Other files named DESIGN.md

DESIGN.md DESIGN.md file
garrytan/gstack · DESIGN.md
git:20261104.2ff2d3b · audit A · 140,694 stars
DESIGN.md DESIGN.md file
paperclipai/paperclip · DESIGN.md
git:20261105.56517dd · audit A · 111,624 stars
DESIGN.md DESIGN.md file
pbakaus/impeccable · DESIGN.md · Neo kinpaku system. Two brand anchors, kinpaku gold and verdigris patina, sit on dark warm-black lacquer. Restraint in…
git:20260721.d7d1027 · audit A · 106,186 stars
DESIGN.md DESIGN.md file
tt-a1i/archify · DESIGN.md · A precise, vivid technical instrument for trustworthy interactive architecture maps.
git:20260817.a0bc059 · audit A · 94,561 stars
DESIGN.md DESIGN.md file
heygen-com/hyperframes · DESIGN.md
git:20260408.fe9cd30 · audit A · 80,701 stars
DESIGN.md DESIGN.md file
cherryhq/cherry-studio · DESIGN.md
git:20261102.a500029 · audit A · 53,286 stars
DESIGN.md DESIGN.md file
garrytan/gbrain · DESIGN.md
git:20260519.3a0e111 · audit A · 31,587 stars
DESIGN.md DESIGN.md file
different-ai/openwork · DESIGN.md
git:20261105.74b7c70 · audit A · 24,407 stars

Browse by kind, by grade B, or by owner.