/ الدليل / الملعب / Claude Code Safety Net
● مجتمع 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.

لماذا تستخدمه

الميزات الأساسية

عرض مباشر

كيف يبدو في الممارسة

جاهز

التثبيت

اختر العميل

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "claude-code-safety-net": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/kenryu42/claude-code-safety-net",
        "~/.claude/skills/safety-net"
      ],
      "_inferred": true
    }
  }
}

افتح Claude Desktop → Settings → Developer → Edit Config. أعد التشغيل بعد الحفظ.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "claude-code-safety-net": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/kenryu42/claude-code-safety-net",
        "~/.claude/skills/safety-net"
      ],
      "_inferred": true
    }
  }
}

يستخدم Cursor نفس مخطط mcpServers مثل Claude Desktop. إعدادات المشروع أولى من الإعدادات العامة.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "claude-code-safety-net": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/kenryu42/claude-code-safety-net",
        "~/.claude/skills/safety-net"
      ],
      "_inferred": true
    }
  }
}

انقر على أيقونة MCP Servers في شريط Cline الجانبي، ثم "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "claude-code-safety-net": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/kenryu42/claude-code-safety-net",
        "~/.claude/skills/safety-net"
      ],
      "_inferred": true
    }
  }
}

نفس الصيغة مثل Claude Desktop. أعد تشغيل Windsurf لتطبيق التغييرات.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "claude-code-safety-net",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/kenryu42/claude-code-safety-net",
        "~/.claude/skills/safety-net"
      ]
    }
  ]
}

يستخدم Continue مصفوفة من كائنات الخادم بدلاً من خريطة.

~/.config/zed/settings.json
{
  "context_servers": {
    "claude-code-safety-net": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/kenryu42/claude-code-safety-net",
          "~/.claude/skills/safety-net"
        ]
      }
    }
  }
}

أضف إلى context_servers. يعيد Zed التحميل تلقائيًا عند الحفظ.

claude mcp add claude-code-safety-net -- git clone https://github.com/kenryu42/claude-code-safety-net ~/.claude/skills/safety-net

أمر من سطر واحد. تحقق باستخدام claude mcp list. احذف باستخدام claude mcp remove.

حالات الاستخدام

استخدامات عملية: Claude Code Safety Net

Install the safety net into Claude Code

👤 Claude Code users ⏱ ~15 min intermediate

متى تستخدمه: You've been bitten by an agent overwriting uncommitted changes.

الخطوات
  1. Clone
    git clone into ~/.claude/skills/safety-net✓ تم النسخ
    → Skill directory present
  2. Wire hooks
    Run the included setup; settings.json gets PreToolUse entries.✓ تم النسخ
    → Hooks active
  3. Test
    Ask Claude to git reset --hard; expect block.✓ تم النسخ
    → Block triggered

النتيجة: Destructive ops require explicit override.

التركيبات

اجمعها مع خوادم MCP أخرى لتحقيق نتائج x10

claude-code-safety-net + filesystem

Pairs naturally with any agent doing repo edits

Combine claude-code-safety-net with filesystem: Pairs naturally with any agent doing repo edits✓ تم النسخ

الأدوات

ما يوفره هذا الـ MCP

الأداةالمدخلاتمتى تستدعيهاالتكلفة
hook-driven (see docs) No callable tools; activates via PreToolUse hooks 1 call

التكلفة والحدود

تكلفة التشغيل

حصة 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/reinsYou want broader agent guardrailsHeavier setup
Manual reviewSolo, low-stakes repoDoesn't scale

المزيد

الموارد

📖 اقرأ ملف README الرسمي على GitHub

🐙 تصفح القضايا المفتوحة

🔍 تصفح أكثر من 400 خادم MCP و Skills