case-insensitive-guard

A safety hook for shell commands that checks whether destructive file operations target the wrong capitalization of a file or folder.

In plain words
What is it for?
Use it to inspect commands involving removal, moving, creating, or deleting files and folders, including commands with directory changes, quotes, subshells, and heredocs.
Why use it?
On case-insensitive file systems such as the default macOS file system, a command aimed at `content` can unintentionally affect `Content`. The hook can stop or ask about such commands.

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

Claude Code
/plugin marketplace add karanb192/claude-code-hooks
agentmods
npx agentmods add plugins/karanb192/claude-code-hooks/case-insensitive-guard
Clone the repo
git clone --depth 1 https://github.com/karanb192/claude-code-hooks

Made for: Claude Code.

Per session not measured What this adds to a session before it is invoked.
When invoked not measured Not applicable: nothing here is loaded into a session.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Security

Grade C, and why

case-insensitive-guard scanned grade C with 1 finding 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 2d 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.

Recursive force deletehighDestructive command

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

"description": "Stops `rm -rf content` silently destroying `Content` on case-insensitive filesystems (APFS default, exFAT, NTFS). A PreToolUse hook on Bash that resolves the real target of destructive commands (rm, rmdir
plugins/case-insensitive-guard/.claude-plugin/plugin.json · 21 lines

What it actually says

{
  "name": "case-insensitive-guard",
  "description": "Stops `rm -rf content` silently destroying `Content` on case-insensitive filesystems (APFS default, exFAT, NTFS). A PreToolUse hook on Bash that resolves the real target of destructive commands (rm, rmdir, mv, mkdir, touch, find -delete) through cd/pushd chains, quotes, subshells, and heredocs, and denies the ones that would hit a differently-cased entry of what was typed. Three safety levels (HOOK_SAFETY_LEVEL), per-level ask mode instead of hard deny.",
  "version": "1.0.0",
  "author": {
    "name": "Karan Bansal",
    "url": "https://github.com/karanb192"
  },
  "homepage": "https://github.com/karanb192/claude-code-hooks",
  "license": "MIT",
  "keywords": [
    "claude-code",
    "hooks",
    "safety",
    "filesystem",
    "case-insensitive",
    "data-loss",
    "pretooluse"
  ]
}
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. 2d ago First seen · 21 lines scan C a74f89e37bfe

Subscribe to this mod's changes

case-insensitive-guard is a plugin published in the GitHub repository karanb192/claude-code-hooks (494 stars, last pushed 9d ago), licensed MIT. Its token cost is not measured: this kind of file is read by the harness, not the model. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.