auto-approve

auto-approve is a skill for Claude Code from guihai24/openskills. It costs 78 tokens per session (876 once invoked), scanned D, original, MIT.

A Claude Code workflow that studies tool-approval logs and proposes repeated operations for automatic approval after you confirm them.

In plain words
What is it for?
Use it to record tool calls, find patterns repeated across days, review candidate approval rules, and audit automatically approved actions.
Why use it?
It reduces repeated approval prompts while keeping dangerous commands excluded and requiring human confirmation for every learned rule.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code.

Good fit Use it to record tool calls, find patterns repeated across days, review candidate approval rules, and audit automatically approved actions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/guihai24/openskills/auto-approve
Install

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.

Any agent
npx skills add guihai24/openskills --skill auto-approve
Clone the repo
git clone --depth 1 https://github.com/guihai24/openskills

Made for: Claude Code.

Wrote 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.

agentmods badge for auto-approve

README.md
[![agentmods](https://agentmods.dev/badge/skills/guihai24/openskills/auto-approve.svg)](https://agentmods.dev/skills/guihai24/openskills/auto-approve)
Your own site
<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>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 876 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 8d ago against content hash a7658012df18, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

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.

The scan reads SKILL.md. This mod also ships 5 executable files (analyze.py, hooks/post-tool-use.sh, hooks/pre-tool-use.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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 种危险模式永不推荐
skills/auto-approve/SKILL.md · 102 lines

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

安装脚本会:

  1. 复制 hooks 和分析脚本到 ~/.claude/auto-approve/
  2. ~/.claude/settings.json 注册 PreToolUse / PostToolUse hooks
  3. 创建数据目录

手动安装

如果你更喜欢手动操作,参见 scripts/install.sh 中的步骤。

使用

  1. 安装后重启 Claude Code — hooks 自动生效,开始静默记录工具调用日志
  2. 正常使用几天 — 积累数据(同类操作至少 ≥ 3 次,跨 ≥ 2 天)
  3. 在 Claude Code 中输入 /auto-approve — 触发分析
  4. 逐条确认候选规则 — 通过的规则立即生效,下次自动放行

安全机制

  • 危险命令黑名单: rm -rfsudogit pushchmod 等 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

Files

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.

Changes

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.

  1. 8d ago First seen · 102 lines · 78 tokens per session scan D a7658012df18

Subscribe to this mod's changes

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.