Help us improve
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
By TonyWu20
Blocks bare find/grep in Bash calls and detects common rg flag misuse. Enforces fd/rg per CLAUDE.md. Shell file-read and file-edit blocking has moved to the no-shell-file-ops plugin.
npx claudepluginhub tonywu20/my-claude-marketplace --plugin no-find-grepA Claude Code plugin that blocks bare find/grep in Bash calls and detects common rg flag misuse.
Shell file-read and file-edit enforcement has moved to the sibling plugin: no-shell-file-ops — blocks
sed,cat,xxd,od,sd,python -cfile operations and provides Edit tool stale-string hints.
Registers a PreToolUse hook that intercepts every Bash command before execution. It detects and blocks:
| Pattern | Why | Example |
|---|---|---|
Bare find | Use fd (or fdfind on Debian/Ubuntu) instead | find . -name '*.txt' |
Bare grep | Use rg instead | grep -rn 'pattern' . |
rg with -r<letter> (scoped to rg's own flags) | -r means --replace in rg, not --recursive. The letter becomes replacement text. rg is recursive by default. Only flags on the rg command itself are checked — other commands' -r flags in a pipeline are ignored. | rg -rn 'pattern' . → replaces matches with "n" |
rg with standalone -L | -L means --follow in rg, not --files-without-match in grep | rg -L 'pattern' . |
rg with | | rg uses ` | for alternation,|` matches a literal pipe |
When a match is found, the hook prints a diagnostic message to stderr and exits with code 2, preventing the command from running.
At session end (or /clear), the plugin reports how many commands were blocked.
My global CLAUDE.md already says:
Always use
fdandrgoverfindandgrep.
But Claude Code doesn't always read or follow instructions consistently — it falls back to find/grep out of habit, and often uses grep flags with rg. A hook enforces the rule at the tool level, every time, with no exceptions. There's no "I didn't read the instructions" loophole.
Install via the marketplace:
TonyWu20/my-claude-marketplace
Or manually, register the plugin in your Claude Code settings:
{
"plugins": {
"no-find-grep": {
"path": "/path/to/no-find-grep"
}
}
}
| File | Purpose |
|---|---|
hooks/hooks.json | Hook registration — intercepts Bash tool calls |
hooks/block-find-grep.sh | Shell script that blocks find/grep misuse, rg flag misuse |
hooks/session-end.sh | Shell script that reports blocked-command count on session exit and /clear |
Compatible with Linux and macOS. Locking uses mkdir-based mutex (no flock dependency).
Executes bash commands
Hook triggers when Bash tool is used
Share bugs, ideas, or general feedback.
Based on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Memory compression system for Claude Code - persist context across sessions
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.
Curate auto-memory, promote learnings to CLAUDE.md and rules, extract proven patterns into reusable skills.
A comprehensive Fortran development pipeline for Claude Code — orchestrates planning, code review, fix execution, and implementation through specialized agents and skills
Routes Claude Code hook events to a Discord channel — approval requests, notifications, and session stop signals — with interactive Approve/Deny buttons. Also provides slash commands to inspect active sessions and conversation history.
LSP proxy that filters stale diagnostics for Rust, Python, and Fortran
A comprehensive Rust development pipeline for Claude Code — orchestrates planning, code review, fix execution, and implementation through specialized agents and skills
Blocks shell commands that read or edit files (sed, cat, xxd, od, sd, python -c). Hints agents to re-read files when Edit fails with stale strings.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claim