audit

audit is a command for Claude Code from sumulige/sumulige-claude. It costs 6 tokens per session (1,164 once invoked), scanned C, original, MIT.

A command that scans approved shell commands and settings for security risks, such as deleting data, granting excessive permissions, or running unverified code.

In plain words
What is it for?
Auditing project or global command approvals, reviewing risk levels, and optionally removing dangerous permissions.
Why use it?
It helps identify dangerous permissions before an agent or developer uses them.

Command for Claude Code

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.

agentmods
npx agentmods add commands/sumulige/sumulige-claude/audit
Clone the repo
git clone --depth 1 https://github.com/sumulige/sumulige-claude

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 audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/sumulige/sumulige-claude/audit.svg)](https://agentmods.dev/commands/sumulige/sumulige-claude/audit)
Your own site
<a href="https://agentmods.dev/commands/sumulige/sumulige-claude/audit"><img src="https://agentmods.dev/badge/commands/sumulige/sumulige-claude/audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 6 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,164 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 5 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 $0.00006 $0.01164
Opus 5 $0.00003 $0.00582
Sonnet 5 $0.00001 $0.00233
Haiku 4.5 $0.00001 $0.00116

Measured 4d ago against content hash 4376330fcb0d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

audit scanned grade C with 5 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 4d 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 rootlowPrivilege escalation

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

### 1. sudo permission

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Downloads and executes remote codemediumSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

| `curl \| sh` | 远程代码执行 | 未验证脚本 |

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Reads agent configuration directorieslowAgent snooping

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

cat ~/.claude/settings.local.json | jq '.permissions'

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

| `rm -rf /` | 系统破坏 | 删除根目录 |

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| `curl \| sh` | 远程代码执行 | 未验证脚本 |
.claude/commands/audit.md · 148 lines

How it starts

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

/audit

审计已批准的命令,检测潜在的安全风险。类似 cc-safe 工具。

使用方式

/audit              # 扫描当前项目
/audit --global     # 扫描全局配置
/audit --fix        # 交互式移除危险权限
/audit --report     # 生成详细报告

检测的危险模式

🔴 Critical (必须移除)

模式 风险 说明
rm -rf / 系统破坏 删除根目录
> /dev/sda 数据丢失 覆写磁盘
:(){ :|:& };: Fork 炸弹 系统崩溃
mkfs 数据丢失 格式化磁盘
dd if=/dev/zero 数据丢失 覆写设备

🟠 High (需要审查)

模式 风险 说明
sudo 权限提升 管理员权限
rm -rf 数据丢失 递归删除
chmod 777 安全漏洞 过度开放权限
docker run --privileged 容器逃逸 特权容器
curl | sh 远程代码执行 未验证脚本
eval 代码注入 动态执行

🟡 Medium (建议审查)

模式 风险 说明
npm install -g 全局污染 全局包安装
pip install --user 环境污染 用户级安装
git push --force 历史丢失 强制推送
DROP TABLE 数据丢失 删除数据表

工作流程

Step 1: 扫描配置文件

检查以下位置:

~/.claude/settings.local.json          # 全局批准
.claude/settings.local.json            # 项目批准
~/.claude/projects/*/settings.local.json  # 各项目批准

Step 2: 模式匹配

const dangerousPatterns = [
  { pattern: /rm\s+-rf\s+\//, level: 'critical', desc: '删除根目录' },
  { pattern: /sudo/, level: 'high', desc: '权限提升' },
  { pattern: /chmod\s+777/, level: 'high', desc: '过度开放权限' },
  { pattern: /--privileged/, level: 'high', desc: '特权容器' },
  { pattern: /curl.*\|\s*sh/, level: 'high', desc: '远程脚本执行' },
  { pattern: /git\s+push\s+--force/, level: 'medium', desc: '强制推送' },
];

Step 3: 生成报告

# Permission Audit Report

**Date**: YYYY-MM-DD HH:mm
**Scanned**: X files
**Issues**: Y found

## 🔴 Critical Issues (0)
None found.

## 🟠 High Risk (2)

### 1. sudo permission
**Location**: ~/.claude/settings.local.json
**Pattern**: `Bash(sudo apt install *)`
**Risk**: 权限提升可能导致系统级变更

**Recommendation**:
移除此权限,改为手动执行 sudo 命令

### 2. rm -rf permission
**Location**: .claude/settings.local.json
**Pattern**: `Bash(rm -rf node_modules)`
**Risk**: 可能意外删除重要文件

**Recommendation**:
限制为特定目录,如 `Bash(rm -rf ./node_modules)`

## 🟡 Medium Risk (1)

### 1. git push --force
**Location**: ~/.claude/settings.local.json
**Pattern**: `Bash(git push --force)`
**Risk**: 可能覆盖远程历史

## Summary

| Level | Count | Action |
|-------|-------|--------|
| 🔴 Critical | 0 | 必须移除 |
| 🟠 High | 2 | 建议移除 |
| 🟡 Medium | 1 | 可选审查 |

## Quick Actions

```bash

Read the full file on GitHub · 148 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. 4d ago First seen · 148 lines · 6 tokens per session scan C 4376330fcb0d

Subscribe to this mod's changes

audit is a command published in the GitHub repository sumulige/sumulige-claude (2 stars, last pushed 6mo ago), licensed MIT. It adds 6 tokens to every session and 1,164 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it C with 5 findings (asks for root, downloads and executes remote code, reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.