model-guard SKILL.md skillA
model-guard from hanzhangzzz/agent-skills-zh is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add hanzhangzzz/agent-skills-zh/model-guard@git:20261028.7e77badPins git:20261028.7e77bad in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- hanzhangzzz/agent-skills-zh
- Path
model-guard/SKILL.md- Versions recorded
- 5
- Latest version
- git:20261028.7e77bad, committed Oct 28, 2026
- First version recorded
- Oct 22, 2026
- Size
- 7,932 bytes
- Repository stars
- 1
- License
- MIT
Budget guard for top-tier expensive models (Claude Code Fable, Codex astra): keeps one session from burning the whole plan quota and stalling every other session. Below the reserve line it is a soft CLAUDE.md/AGENTS.md rule (expensive model only thinks, plans and reviews; heavy work goes to cheap subagents); once 5h/7d remaining quota drops under a time-decaying reserve, a PreToolUse hook enforces the split. Triggers: install model guard, fable guard, 装模型预算闸, 贵模型保护, 更新贵模型列表, 改保留额, 卸载模型预算闸.
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
# model-guard:贵模型预算闸 使用方式始终一套:贵模型只做思考、方案、审阅,重活派便宜 subagent。套餐余量充足时这是 CLAUDE.md 里的软提示;余量越过保留线后,PreToolUse hook 把它变成硬约束(强制分工,不是禁用贵模型)。 ## 机制 | 组件 | 作用 | | --- | --- | | `scripts/statusline-tap.sh` | 包在原 statusLine 外层:把 stdin 里的 `rate_limits` 落盘到 `~/.claude/model-guard/rate-limits.json`,再把原 stdin 交给原命令 | | `scripts/guard.sh` | PreToolUse hook(matcher `*`),Claude Code 与 Codex 共用:当前模型是贵模型且越线时,只放行派便宜 subagent、提问、计划类工具(Claude Code 另放行 limit≤200 的 `Read`) | | `scripts/install.sh` | 安装、更新、现状、自检、卸载;幂等,改 settings.json 前备份 | | `~/.claude/model-guard.json` | 贵模型/便宜模型列表、保留额与保留线下限、Codex 便宜模型与工具名清单、被包住的原 statusLine | 触发线随时间走:对 5h、7d 窗口各算 `remaining = clamp(距重置秒数 / 窗口秒数, 0, 1)`,保留线 `= max(保留额 × remaining, min(下限, 保留额))`,余量 `100 - 已用%` 小于保留线即越线,任一窗口越线就进入强制分工。下限(`reserve_floor_5h` / `reserve_floor_7d`,默认 15%)防止临近重置时保留线趋近 0:没有下限时 7d 已用 96% 还剩 1 小时,保留线只有约 0.3%,闸不触发,额度照样被烧光。实际生效的下限是 `min(下限, 保留额)`,`--status` 与软提示显示的也是这个值;保留额设 0 仍等于关闭该窗口的闸。 Claude Code 越线后 `Read` 只放行带 limit≤200 且不带 pages 的读取;用 offset 分段连续读仍可读完整文件,这是有意保留的小口子,大段阅读应派 subagent。模型判定取 transcript 最后一条 assistant 消息(实测首个工具调用时本条消息已写入);`/model` 切换后的第一次调用可能仍按上一条消息的模型判定。 …
Read the whole file at its exact version.
How to install
mdr add hanzhangzzz/agent-skills-zh/model-guard@sha256:b2b92037bb8b634eThe line at the top of this page pins the label git:20261028.7e77bad, 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.
[](https://markdownregistry.com/a/art_7zlwmzuodabchtvm)
3 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 5 versions of this file, between Oct 22, 2026 and Oct 28, 2026, about one every 2 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20261028.7e77bad latest | 2026-10-28 | 7e77bad | 7,932 B | A | view · diff |
| git:20261028.49dc8fc | 2026-10-28 | 49dc8fc | 8,222 B | A | view · diff |
| git:20261022.c845a54 | 2026-10-22 | c845a54 | 7,075 B | A | view · diff |
| git:20261022.26b1f3b | 2026-10-22 | 26b1f3b | 6,684 B | A | view · diff |
| git:20261022.b83378a | 2026-10-22 | b83378a | 5,267 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (7932 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 curl or wget piped into a shell
- 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
Source
hanzhangzzz/agent-skills-zh · 1 stars · license MIT · pushed 2026-10-29 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_7zlwmzuodabchtvm GET https://markdownregistry.com/api/v1/resolve?ref=hanzhangzzz/agent-skills-zh/model-guard GET https://markdownregistry.com/api/v1/blob/b2b92037bb8b634ef0852d916b3fcb2534c5d2a7688528762ed4b6abdcfe3d07
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: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.