claude-code-auto-approve CLAUDE.md

claude-code-auto-approve CLAUDE.md is an instructions file for Claude Code from maxwzg/claude-code-auto-approve. It costs 1,509 tokens per session, scanned C, original, MIT.

Project guidance for Claude Code, an AI coding assistant, working on a plugin that automatically approves selected Bash commands. It describes the plugin's hooks, safety checks, dependencies, files, and development process.

In plain words
What is it for?
Use it when developing, testing, or documenting the claude-code-auto-approve plugin and its command approval lists or hooks.
Why use it?
It gives the coding assistant the project context needed to modify the plugin without overlooking command-safety rules or required files.

Instructions file for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

Runs only inside a plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else, and the catalogue could not identify which plugin ships it.

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

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 claude-code-auto-approve CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/maxwzg/claude-code-auto-approve/claude-md.svg)](https://agentmods.dev/instructions/maxwzg/claude-code-auto-approve/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/maxwzg/claude-code-auto-approve/claude-md"><img src="https://agentmods.dev/badge/instructions/maxwzg/claude-code-auto-approve/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,509 This file is loaded in full into every session.
When invoked 1,509 The same file — it is already loaded in full.
Security scan C 2 findings. Scan, not verified.
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.01509 $0.01509
Opus 5 $0.00754 $0.00754
Sonnet 5 $0.00302 $0.00302
Haiku 4.5 $0.00151 $0.00151

Measured 5d ago against content hash 07719a49b2da, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade C, and why

claude-code-auto-approve CLAUDE.md scanned grade C 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 5d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

"Bash(sudo *)"

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

1. `~/.claude/settings.json` (用户级)
CLAUDE.md · 219 lines

How it starts

The opening of the file, as written. The whole thing — 219 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

此文件为 Claude Code (claude.ai/code) 在此代码库中工作时提供指导。

项目概述

这是 claude-code-auto-approve - 一个 Claude Code Plugin,用于智能 Bash 命令自动批准。

Plugin 功能

  • PreToolUse Hook: 自动批准复合 Bash 命令(管道、链式、子shell 等)
  • PostToolUse Hook: 自动学习用户批准的新命令并添加到允许列表
  • 安全检查: 区分安全命令和危险命令,保护系统安全
  • 依赖检查: 自动检测所需依赖(jq, shfmt 等),缺失时优雅降级

项目结构

claude-code-auto-approve/
├── .claude-plugin/              # Plugin 元数据
│   ├── plugin.json              # Plugin 清单和 Hook 配置
│   └── marketplace.json         # Marketplace 发布配置
│
├── scripts/                      # 可执行脚本
│   ├── approve-compound-bash.sh         # PreToolUse Hook
│   ├── post-process-compound-bash.sh    # PostToolUse Hook
│   ├── add-to-allowlist.sh              # 辅助工具
│   └── command-lists.sh                 # 共享配置
│
├── commands/                     # Claude Code 命令文档
│   └── allowlist.md             # /allowlist 命令
│
├── .claude/                      # 示例配置
│   └── settings.example.json
│
├── 文档/
│   ├── README.md                # 用户文档
│   ├── QUICKSTART.md            # 快速入门
│   ├── DEVELOPMENT.md           # 开发指南
│   ├── STRUCTURE.md             # 架构说明
│   └── CHANGELOG.md             # 变更日志
│
├── test-plugin.sh               # 测试脚本
└── LICENSE                      # MIT 许可证

开发和测试

本地测试 Plugin

# 方法 1: 使用 --plugin-dir
claude --plugin-dir .

# 方法 2: 调试模式
claude --debug --plugin-dir .

# 方法 3: 运行测试脚本
bash test-plugin.sh

安装 Plugin

# 用户级别(推荐)
claude plugin install . --scope user

# 项目级别
claude plugin install . --scope project

# 本地级别
claude plugin install . --scope local

核心脚本说明

approve-compound-bash.sh (PreToolUse Hook)

功能: 在 Bash 命令执行前自动批准

依赖: jq, shfmt

工作流程:

  1. 解析复合命令为单个子命令
  2. 检查每个子命令是否在允许列表
  3. 全部允许 → 自动批准
  4. 包含拒绝 → 主动拒绝
  5. 部分未知 → 回退到原生提示

post-process-compound-bash.sh (PostToolUse Hook)

功能: 在 Bash 命令执行后自动学习

依赖: jq, awk, stat, date

工作流程:

  1. 检测用户批准的新命令
  2. 分类为安全命令和危险命令
  3. 自动添加安全命令到允许列表
  4. 提示手动添加危险命令

command-lists.sh

功能: 共享配置文件

Read the full file on GitHub · 219 lines

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. 5d ago First seen · 219 lines · 1,509 tokens per session scan C 07719a49b2da

Subscribe to this mod's changes

claude-code-auto-approve CLAUDE.md is an instructions file published in the GitHub repository maxwzg/claude-code-auto-approve (2 stars, last pushed 5mo ago), licensed MIT. It adds 1,509 tokens to every session, about $0.0075 per session on Opus 5. A static security scan graded it C with 2 findings (asks for root, reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens