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.
npx skills add guihai24/openskills --skill auto-approvegit clone --depth 1 https://github.com/guihai24/openskillsWrote 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.
[](https://agentmods.dev/skills/guihai24/openskills/auto-approve)<a href="https://agentmods.dev/skills/guihai24/openskills/auto-approve"><img src="https://agentmods.dev/badge/skills/guihai24/openskills/auto-approve/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.
<a href="https://agentmods.dev/skills/guihai24/openskills/auto-approve"><img src="https://agentmods.dev/badge/skills/guihai24/openskills/auto-approve.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00078 | $0.00876 |
| Opus 5.5 | $0.00031 | $0.00350 |
| Sonnet 5.5 | $0.00016 | $0.00175 |
| Haiku 4.5 | $0.00008 | $0.00088 |
Grade D, and why
auto-approve scanned grade D with 2 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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
2. 在 `~/.claude/settings.json` 注册 PreToolUse / PostToolUse hooks Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
- **危险命令黑名单**: `rm -rf`、`sudo`、`git push`、`chmod` 等 20 种危险模式永不推荐 What it actually says
/auto-approve — Claude Code 授权自学习
通过 Hooks 记录工具授权习惯,分析高频模式,经用户确认后自动放行,减少重复审批。
架构
PostToolUse hook (每次工具执行后自动记录)
│
▼
approval-log.jsonl ──→ /auto-approve (用户手动触发)
│
▼
候选规则 → 用户逐条确认 → learned-rules.json
│
▼
PreToolUse hook (命中规则 → 自动放行)
安装
前置要求
jq(命令行 JSON 处理器)python3(3.6+)
一键安装
bash ~/.claude/skills/auto-approve/scripts/install.sh
安装脚本会:
- 复制 hooks 和分析脚本到
~/.claude/auto-approve/ - 在
~/.claude/settings.json注册 PreToolUse / PostToolUse hooks - 创建数据目录
手动安装
如果你更喜欢手动操作,参见 scripts/install.sh 中的步骤。
使用
- 安装后重启 Claude Code — hooks 自动生效,开始静默记录工具调用日志
- 正常使用几天 — 积累数据(同类操作至少 ≥ 3 次,跨 ≥ 2 天)
- 在 Claude Code 中输入
/auto-approve— 触发分析 - 逐条确认候选规则 — 通过的规则立即生效,下次自动放行
安全机制
- 危险命令黑名单:
rm -rf、sudo、git push、chmod等 20 种危险模式永不推荐 - 阈值保护: 必须 ≥ 3 次且跨 ≥ 2 天才会被推荐
- 泛化上限: Bash 通配前缀至少保留 2 个 token,防止出现
Bash(*) - 人工确认: 所有规则必须用户逐条 Y/n 确认,不会静默生效
- 审计日志: 全量记录保留在
approval-log.jsonl,包括自动放行的记录
文件结构
~/.claude/auto-approve/
├── hooks/
│ ├── pre-tool-use.sh # PreToolUse: 查规则匹配则放行
│ └── post-tool-use.sh # PostToolUse: 记录每次工具执行
├── analyze.py # 分析引擎(/auto-approve 触发)
├── deny-patterns.json # 危险模式黑名单
└── data/
├── approval-log.jsonl # 审计日志(自动生成)
└── learned-rules.json # 已确认的自动授权规则
卸载
bash ~/.claude/skills/auto-approve/scripts/uninstall.sh
执行步骤
运行分析脚本:
python3 ~/.claude/auto-approve/analyze.py
脚本会交互式地让用户逐条 Y/n 确认候选规则。确认的规则立即写入 learned-rules.json。
What ships with it
7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 2mo ago First seen · 102 lines · 78 tokens per session scan D a7658012df18
auto-approve is a skill published in the GitHub repository guihai24/openskills (2 stars, last pushed 1mo ago), licensed MIT. It adds 78 tokens to every session and 876 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it D with 2 findings (reads agent configuration directories, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
auto-approve compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| auto-approveguihai24/openskills | Skill | 2 | 1mo ago | MIT | D | 78 | Claude Code |
| orbit-notionnexu-io/open-design | Skill | 107k | today | Apache-2.0 | A | 117 | Claude Code, Codex |
| agentmailpaperclipai/paperclip | Skill | 112k | today | MIT | A | 30 | Claude Code, Codex |
| Cortexdanielmiessler/LifeOS | Skill | 20k | 2d ago | MIT | A | 184 | Claude Code |
| rowboat-spacesrowboatlabs/rowboat | Skill | 18k | today | Apache-2.0 | A | 60 | Claude Code, Codex |
| feishuHmbown/CodeWhale | Skill | 41k | today | MIT | A | 33 | Claude Code, Codex |
| pinchtab-mcppinchtab/pinchtab | Skill | 11k | 11d ago | MIT | A | 52 | Claude Code, Codex |