一个命令钩子,用于在本地编码代理(如 Claude Code、Codex CLI 和 Devin CLI)执行危险 shell 命令(sudo、项目外的破坏性操作)时将其拦截。

Stars

43

7 天增长

暂无数据

Fork 数

3

开放 Issue

0

开源协议

暂无数据

最近更新

2026-07-10

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

解决了编码代理执行 shell 命令时的安全问题;轻量级,易于集成到现有钩子中。

适合谁使用

  • 使用执行 shell 命令的 AI 编码代理的开发者
  • 希望防止意外破坏性操作的团队
  • Claude Code、Codex CLI、Devin CLI 的用户
  • 注重安全的开发者

典型使用场景

  • 防止代理运行期间使用 sudo
  • 阻止在项目目录外执行 rm/mv 等操作
  • 保护系统分区免遭意外格式化
  • 为自动化编码工作流添加安全层

项目优势

  • 安装简单:仅需一个脚本和 jq
  • 明确支持三种主流编码代理
  • 清晰的退出状态码(2 为阻止,0 为允许)便于集成
  • 开销低——仅在命令匹配时运行钩子

使用前须知

  • 仅适用于支持 PreToolUse 钩子的代理
  • 依赖 jq
  • 不阻止项目目录内的危险命令
  • 拦截规则对某些工作流可能过于严格(例如可能需要允许的 sudo 操作)

README 快速开始

Usage

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

jamesob
精选
jamesob GitHub avatar

local-llm

A comprehensive guide for building and configuring a high-end local machine to run state-of-the-art LLMs, with detailed hardware choices, BIOS tuning, and Docker-based model serving.

AI 与机器学习大语言模型
1,660
bjan
精选
bjan GitHub avatar

claudemux

Claudemux is a lightweight, dependency-minimal message bus that lets multiple Claude Code sessions communicate in real-time over tmux, enabling one session to ask another a question and receive the answer without manual intervention.

AI 与机器学习AI 智能体
9
AARomanov1985
AARomanov1985 GitHub avatar

Audio-Cassette-Simulation

A set of bash scripts using ffmpeg to simulate vintage cassette tape audio profiles with noise, wow/flutter, bandwidth limits, and EQ.

Shell
373