Safety Guard

•
215k
•

Prevents destructive terminal commands and unauthorized file modifications to protect production environments and sensitive codebases.

Safety Guard serves as a critical safety net for Claude Code, specifically designed to mitigate the risks associated with autonomous agent execution and production-level development. By monitoring tool calls in real-time, it intercepts high-risk operations such as force-pushing Git branches, deleting databases, or recursive file removals, while also offering the ability to 'freeze' specific directories against unauthorized edits. Whether you are running an agent in full-auto mode or managing sensitive cloud infrastructure, this skill ensures that destructive actions are flagged for human approval and that code modifications remain strictly within authorized boundaries.

주요 기능

01PreToolUse Interception: Hooks into Bash, Write, and Edit tools to validate actions before they are executed.
02Security Logging: Maintains a detailed log of all blocked or flagged actions in a dedicated safety-guard log file.
03Guard Mode: Combines command monitoring and directory locking for maximum safety during autonomous sessions.
04Careful Mode: Detects and warns against dangerous commands like rm -rf, git push --force, and DROP TABLE.
05214,597 GitHub stars
06Freeze Mode: Implements directory-level write locks to prevent the agent from editing files outside of specific paths.

사용 사례

01Performing maintenance or migrations on production systems where accidental commands could cause downtime.
02Protecting sensitive project files like environment variables or core infrastructure code from unintended AI edits.
03Running AI agents in autonomous mode to ensure they stay focused on a specific module without touching global config.