A command hook that blocks risky shell commands (sudo, destructive operations outside project) for local coding agents like Claude Code, Codex CLI, and Devin CLI.

Stars

43

7-day growth

No data

Forks

3

Open issues

0

License

No data

Last updated

2026-07-10

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

Addresses safety concerns when agents execute shell commands; lightweight, easy to integrate with existing hooks.

Who it is for

  • Developers using AI coding agents that execute shell commands
  • Teams wanting to prevent accidental destructive operations
  • Users of Claude Code, Codex CLI, Devin CLI
  • Security-conscious developers

Use cases

  • Prevent sudo usage during agent runs
  • Block rm/mv outside project directory
  • Protect system partitions from accidental formatting
  • Add a safety layer for automated coding workflows

Strengths

  • Simple installation: one script plus jq
  • Explicit support for three major coding agents
  • Clear exit status (2 for block, 0 for allow) for integration
  • Minimal overhead – hook runs only when command matches

Considerations

  • Only works with agents supporting PreToolUse hooks
  • Requires jq as a dependency
  • Does not block dangerous commands within the project directory
  • Blocking criteria may be too restrictive for some workflows (e.g., allowed sudo might be needed)

README quick start

Usage

Related repositories

Similar projects matched by category, topics, and programming language.

jamesob
Featured
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 & Machine LearningLarge Language Models
1,660
bjan
Featured
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 & Machine LearningAI Agents
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