Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Run automatically on Claude Code events. Claude doesn't decide.
2 cautions to review before installing
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
A Claude Code plugin that blocks shell commands that read or edit files — enforcing the built-in Read and Edit tools. Also hints agents to re-read files when the Edit tool fails with stale strings.
Find/grep enforcement lives in the sibling plugin: no-find-grep — blocks bare
find/grepand detects commonrgflag misuse.
Registers a PreToolUse hook that intercepts every Bash command before execution. It detects and blocks:
| Pattern | Why | Example |
|---|---|---|
sed -n | Use Read tool to view file content instead of parsing with sed | sed -n '100,200p' file |
cat -A/-v/-vet | Use Read tool to inspect file content instead of shell tricks | cat -A file |
xxd / od | Use Read tool to inspect file content instead of hex/octal dumps | xxd file |
sed -i | Use Edit tool for file editing instead of sed in-place | sed -i 's/old/new/' file |
sd | Use Edit tool for find-and-replace. sd always returns exit 0 even on no-op. | sd 'old' 'new' file |
python -c with open() | Use Read/Edit tools for file operations instead of ad-hoc scripts | python3 -c "open('f').read()" |
When a match is found, the hook prints a diagnostic message to stderr and exits with code 2, preventing the command from running.
Also registers a PostToolUseFailure hook on Edit: when the Edit tool fails with "String to replace not found," it provides additionalContext hinting the agent to re-read the file with the Read tool before retrying.
At session end (or /clear), the plugin reports how many commands were blocked.
My global CLAUDE.md already says:
For file editing, use the built-in
Edittool instead ofsed -i,sd, orpython -c.
But Claude Code doesn't always follow instructions consistently. A hook enforces the rule at the tool level, every time, with no exceptions.
Install via the marketplace:
TonyWu20/my-claude-marketplace
Or manually, register the plugin in your Claude Code settings:
{
"plugins": {
"no-shell-file-ops": {
"path": "/path/to/no-shell-file-ops"
}
}
}
| File | Purpose |
|---|---|
hooks/hooks.json | Hook registration — intercepts Bash tool calls and Edit failures |
hooks/block-file-ops.sh | Shell script that blocks shell file-read and file-edit commands (enforcing Read/Edit tools) |
hooks/hint-edit-reread.sh | Shell script that catches Edit tool failures and hints the agent to re-read the file via additionalContext |
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).
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
no-shell-file-ops@my-claude-marketplace is listed by tonywu20/my-claude-marketplace — review the source before installing
npx claudepluginhub tonywu20/my-claude-marketplace --plugin no-shell-file-opsPlugins from other owners that cover similar ground