● مجتمع
kenryu42
⚡ فوري
Claude Code Safety Net
بواسطة kenryu42 · kenryu42/claude-code-safety-net
A hooks-driven safety net for Claude Code — interceptors catch rm -rf, git reset --hard, force pushes, and uncommitted destructive edits.
Installs as a Claude Code plugin with PreToolUse hooks. Each potentially destructive operation is intercepted and either confirmed or refused based on rules. Includes rules for git, file system, npm, and arbitrary bash.
لماذا تستخدمه
الميزات الأساسية
- PreToolUse hook interceptors
- Categorized rules (git / fs / pkg / bash)
- Auto-block force-push to main
- Detect uncommitted-work-overwriting edits
- Soft-warn vs hard-block modes
- Rules editable per project
عرض مباشر
كيف يبدو في الممارسة
جاهز
حالات الاستخدام
استخدامات عملية: Claude Code Safety Net
متى تستخدمه: You've been bitten by an agent overwriting uncommitted changes.
الخطوات
-
Wire hooks
Run the included setup; settings.json gets PreToolUse entries.✓ تم النسخ
→ Hooks active
-
Test
Ask Claude to git reset --hard; expect block.✓ تم النسخ
→ Block triggered
النتيجة: Destructive ops require explicit override.
التركيبات
اجمعها مع خوادم MCP أخرى لتحقيق نتائج x10
Pairs naturally with any agent doing repo edits
Combine claude-code-safety-net with filesystem: Pairs naturally with any agent doing repo edits✓ تم النسخ
التكلفة والحدود
تكلفة التشغيل
- حصة API
- N/A
- الرموز لكل استدعاء
- 0
- التكلفة المالية
- Free
- نصيحة
- Start in soft-warn mode; promote to hard-block after a week of clean runs
الأمان
الصلاحيات والأسرار ونطاق الأثر
الحد الأدنى من الصلاحيات: hooks-read hooks-write
تخزين بيانات الاعتماد: None
نقل البيانات الخارجي: None
استكشاف الأخطاء
الأخطاء الشائعة وحلولها
Hooks not firing
Confirm settings.json was actually updated; restart Claude Code
False positives on benign git ops
Tune the per-project rules file
البدائل
Claude Code Safety Net مقابل البدائل
| البديل | متى تستخدمها | المقايضة |
| pegasi-ai/reins | You want broader agent guardrails | Heavier setup |
| Manual review | Solo, low-stakes repo | Doesn't scale |