edict

edict is a command for coding agents from skymanbp/cc-enforcer. It costs 29 tokens per session (735 once invoked), scanned D, original, MIT.

A command for managing project-specific or personal hard rules stored in TOML configuration files. These rules can describe required practices and patterns that edits or shell commands must not use.

In plain words
What is it for?
Use it to view active rules, add or remove a rule, reload the configuration, or find the project-level or global rules file.
Why use it?
Teams and individuals often need rules beyond the shared defaults. It provides one place to list, add, remove, reload, and locate those rules.

Command

Part of the cc-enforcer plugin — 2 skills, 6 commands, 1 agent, 4 hooks shipped together

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/skymanbp/cc-enforcer/edict
Clone the repo
git clone --depth 1 https://github.com/skymanbp/cc-enforcer

Or install cc-enforcer, the plugin that ships this one along with the rest of its 2 skills, 6 commands, 1 agent, 4 hooks.

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 edict

README.md
[![agentmods](https://agentmods.dev/badge/commands/skymanbp/cc-enforcer/edict.svg)](https://agentmods.dev/commands/skymanbp/cc-enforcer/edict)
Your own site
<a href="https://agentmods.dev/commands/skymanbp/cc-enforcer/edict"><img src="https://agentmods.dev/badge/commands/skymanbp/cc-enforcer/edict.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 735 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 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 $0.00029 $0.00735
Opus 5 $0.00015 $0.00367
Sonnet 5 $0.00006 $0.00147
Haiku 4.5 $0.00003 $0.00073

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

Security

Grade D, and why

edict 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 3d 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.

/cc-enforcer:edict add G01 "永不 sudo rm -rf root paths" --must --global --deny-bash 'rm\s+-rf?\s+/'

Recursive force deletehighDestructive command

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

/cc-enforcer:edict add G01 "永不 sudo rm -rf root paths" --must --global --deny-bash 'rm\s+-rf?\s+/'
commands/edict.md · 54 lines

What it actually says

/cc-enforcer:edict

圣旨 = 用户为本项目自定义的硬规则,优先级高于通用 12 条。 默认文件:${CLAUDE_PROJECT_DIR}/.claude/cc-enforcer/edicts.toml(项目级,可入 git 团队共享)。 --global(v0.14):写入 ~/.claude/cc-enforcer/edicts.toml(个人全局,跨项目生效)。

子命令

子命令 行为
list 列出当前所有圣旨(来源文件 / id / severity / 硬拦截规则数)。优先 project,无则 fallback 到 global
add ID "TEXT" [...] 追加一条圣旨。默认 --must,支持 --deny-edit / --deny-bash 多次 + --note + --global
remove ID [--global] 删除圣旨。默认先找 project 再 fallback global;--global 限定只删 global 文件
reload 重读并打印当前生效圣旨(验证配置)
path 打印 edicts.toml 实际/将创建的路径

用法(agent 应当如此执行)

请把用户的 $ARGUMENTS 传给 manage_edicts.py:

python "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/manage_edicts.py" $ARGUMENTS

执行后向用户报告:

  1. 该操作是否成功;
  2. 圣旨文件路径;
  3. 当前生效圣旨数量与 id 列表(运行 list 子命令获取)。

示例

/cc-enforcer:edict list
/cc-enforcer:edict add E01 "禁止使用 mongoose,统一用 prisma" --must --deny-edit 'from\s+["'"'"']mongoose["'"'"']' --deny-bash 'npm\s+(i|install)\s+mongoose'
/cc-enforcer:edict add E02 "所有 API 必须经过 src/api/client.ts" --should --note "见 PR #142"
/cc-enforcer:edict add G01 "永不 sudo rm -rf root paths" --must --global --deny-bash 'rm\s+-rf?\s+/'
/cc-enforcer:edict remove E01
/cc-enforcer:edict path

设计契约

  • 必须(must):违反即被 PreToolUse(Edit|Write|Bash) 物理 DENY。
  • 建议(should):仅注入软提醒,不 DENY。
  • 圣旨不能绕过插件内置的 12 条规则;内置守卫先跑、圣旨后跑。
  • 文件改动即时生效(hooks 每次重读)。

完整设计 → docs/EDICTS.md

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. 3d ago First seen · 54 lines · 29 tokens per session scan D 64222d961232

Subscribe to this mod's changes

edict is a command published in the GitHub repository skymanbp/cc-enforcer (5 stars, last pushed 8d ago), licensed MIT. It adds 29 tokens to every session and 735 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it D with 2 findings (asks for root, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.