You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A ready-to-use PreToolUse Bash hook that intercepts dangerous commands before execution in Claude Code (and compatible AI agents). Shipped as a file in hooks/claude/ that users can copy into their .claude/hooks/ config.
What it blocks/asks
Category
Action
Decision
Files
rm -rf /, rm -rf ~, rm -rf ..
🚫 block
Files
rm -rf <other> (except safe dirs like node_modules, dist, .next)
Is this in scope for RTK? Or does it belong in a separate repo / community hooks collection?
Overlap with existing features? Does RTK already plan a built-in safety layer (e.g., via the rewrite hook or TOML filters)?
Regex vs structured parsing? Current approach uses grep -qE on the raw command string — works but can false-positive on edge cases. Would a Rust-based approach be preferred?
Default decisions — should rm -rf outside safe dirs be block or ask?
Happy to implement whichever direction you prefer. I have a working prototype ready to go once we align on scope.
Feature request for a community-contributed PreToolUse hook that intercepts and blocks dangerous CLI operations (rm -rf, force push, secret exposure, DROP TABLE, etc.); author has a working prototype but seeks scope/design alignment before submitting a PR.
📁 Relevant files
hooks/claude/dangerous-actions-blocker.sh
.claude/settings.json
Triaged automatically by wshm · This is an automated analysis, not a human review.
Activity
pszymkowiak commentedon Apr 4, 2026
🔍 Automated Triage
featuremediumSummary
Feature request for a community-contributed PreToolUse hook that intercepts and blocks dangerous CLI operations (rm -rf, force push, secret exposure, DROP TABLE, etc.); author has a working prototype but seeks scope/design alignment before submitting a PR.
📁 Relevant files
hooks/claude/dangerous-actions-blocker.sh.claude/settings.jsonTriaged automatically by wshm · This is an automated analysis, not a human review.
fdambrosio commentedon Aug 5, 2026
I agree, we need this feature
KuSh commentedon Nov 8, 2026
Thanks for raising this. Having rtk block, refuse or ask for confirmation before commands it considers dangerous is outside what RTK Open Source takes on: it is covered by RTK Pro Policies (https://pro.rtk-ai.app/), and the contributing guide lists it as out of scope for the open-source core, which focuses on token savings and harness optimization (https://github.com/rtk-ai/rtk/blob/develop/CONTRIBUTING.md#out-of-scope). Closing it on that basis. If you think your case falls outside that line, you can reach the maintainers on Discord to discuss it: https://discord.com/invite/RySmvNF5kF