dcg

dcg is a skill for Claude Code, Codex from momentmaker/kaijutsu. It costs 95 tokens per session (1,251 once invoked), scanned D, original, MIT.

A safety hook that intercepts shell commands and blocks patterns known to cause irreversible damage.

In plain words
What is it for?
It blocks commands such as destructive recursive deletion, hard Git resets, forced pushes to main branches, credential removal, disk-destruction commands, and fork bombs, while allowing defined project-local cleanup.
Why use it?
It reduces the chance that an agent will delete important files, erase local work, destroy data, or overwrite protected Git history by mistake.

Skill for Claude CodeCodex

Written for Claude Code and Codex: PreToolUse hook event, but also reads ~/.codex or $CODEX_HOME. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

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 skills/momentmaker/kaijutsu/dcg
Any agent
npx skills add momentmaker/kaijutsu --skill dcg
Clone the repo
git clone --depth 1 https://github.com/momentmaker/kaijutsu

Made for: Claude Code, Codex.

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 dcg

README.md
[![agentmods](https://agentmods.dev/badge/skills/momentmaker/kaijutsu/dcg.svg)](https://agentmods.dev/skills/momentmaker/kaijutsu/dcg)
Your own site
<a href="https://agentmods.dev/skills/momentmaker/kaijutsu/dcg"><img src="https://agentmods.dev/badge/skills/momentmaker/kaijutsu/dcg.svg" alt="Measured on agentmods" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,251 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 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.00095 $0.01251
Opus 5 $0.00048 $0.00626
Sonnet 5 $0.00019 $0.00250
Haiku 4.5 $0.00010 $0.00125

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

Security

Grade D, and why

dcg scanned grade D with 3 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 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (hooks/dcg.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.

Asks for rootmediumPrivilege escalation

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

- `sudo ... rm -rf /` — same with sudo

Reads agent configuration directoriesmediumAgent snooping

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

| Claude Code | `~/.claude/settings.json` | `PreToolUse` |

Recursive force deletehighDestructive command

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

description: Destructive Command Guard. Installs a pre-tool-use hook that blocks unrecoverable shell commands (rm -rf /, git reset --hard, git clean -fd, rm of .env / credentials, force-pushing to main, fork bombs, shred
skills/community/dcg/SKILL.md · 109 lines

How it starts

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

DCG — Destructive Command Guard

A pre-tool-use hook that intercepts every shell command the agent is about to run. If the command matches a known destructive pattern, the hook returns a non-zero exit and a stopReason payload, blocking execution.

What it blocks

  • rm -rf / — at root
  • sudo ... rm -rf / — same with sudo
  • git reset --hard — irreversible discard of local work
  • git clean -fd — force-delete untracked files (commonly nukes .env, generated configs)
  • git push --force to main / master — overwriting upstream history on protected branches
  • rm of .env / credentials / .pem / SSH keys
  • shred / dd — disk destruction
  • :(){ :|:& };: — fork bomb
  • chmod 777 on $HOME — permission disaster
  • find $HOME -delete — bulk deletion in home

The full pattern list is in hooks/dcg.sh. New patterns can be added by appending to the patterns array.

What it does NOT block

By design DCG is a floor, not a ceiling:

  • rm -rf <project>/build — project-local cleanup is allowed
  • git reset HEAD~1 — non---hard resets are recoverable
  • rm .DS_Store — junk-file removal is allowed
  • Anything outside the agent's shell tool

This is intentional. Over-blocking causes alert fatigue; agents start either circumventing or losing trust. DCG focuses on the truly unrecoverable cases.

How install wires it up

jutsu install dcg registers a pre-tool-use hook with matcher Bash for every active agent:

Agent Settings file Native event
Claude Code ~/.claude/settings.json PreToolUse
OpenAI Codex CLI ~/.codex/config.toml PreToolUse
Google Antigravity CLI ~/.antigravity/settings.json BeforeTool

Each entry is tagged with _kaijutsu: skill:dcg:hook:block-destructive-shell so jutsu remove dcg can clean up exactly what we added without disturbing user-authored hooks.

The script at hooks/dcg.sh is platform-agnostic POSIX bash — it reads the hook JSON from stdin, extracts the command field via jq (with a regex fallback if jq is absent), and matches against the pattern list.

Read the full file on GitHub · 109 lines

Files

What ships with it

3 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. 6d ago First seen · 109 lines · 95 tokens per session scan D 4ca25d2090c1

Subscribe to this mod's changes

dcg is a skill published in the GitHub repository momentmaker/kaijutsu (3 stars, last pushed 2mo ago), licensed MIT. It adds 95 tokens to every session and 1,251 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it D with 3 findings (asks for root, 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.