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.svg" alt="Measured on agentmods" 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 | $0.00039 | $0.00438 |
| Sonnet 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 8d 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
6 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.
- 8d 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 3d ago), licensed MIT. It adds 78 tokens to every session and 876 once invoked, about $0.0004 per session on Opus 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.
Other skills, from other repositories
orbit-notion
Open Orbit briefing skill — selected by the Orbit pipeline when Notion is the user's only connected connector, or when the user explicitly scopes their daily digest to Notion. Pulls the past 24 hours of document edits, comments, mentions, and database row changes from the user's authenticated Notion connection and…
Cortex
Operate Cortex, the LifeOS memory system — the typed Knowledge Archive (People, Companies, Ideas, Research with typed related: links) plus recall of prior work sessions, ISAs, and conversations. Search, add, harvest, develop, ingest, distill, graph-navigate, recall. USE WHEN cortex, knowledge, knowledge base, search…
feishu
Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.
pinchtab-mcp
Use this skill when a task requires browser automation through PinchTab's MCP server connected to a remote browser instance. Covers navigation, element interaction, data extraction, form filling, multi-step flows, and session management via MCP tools.
peekaboo
Capture and automate macOS UI with the Peekaboo CLI.
mochi-remind
Handle due reminders — notify the user with natural language and mark them done.