kenryu42/cc-safety-net — A coding agent CLI hook that acts as a safety net, catching destructive git and filesystem commands…
Description and use
**Brief Summary (2‑3 sentences)**
kenryu42/cc‑safety‑net is a TypeScript‑based CLI hook that intercepts potentially destructive git and filesystem commands, acting as a safety net for AI‑driven coding agents such as Codex, Claude Code, OpenCode, Gemini CLI, Copilot CLI, Kimi Code and Pi. By surfacing a simple “pre‑execute” checkpoint, it lets developers prototype AI‑assisted workflows without risking accidental data loss. With over 1.4 k stars and recent activity, it is positioned as a production‑ready open‑source component for AI‑enhanced developer tools.
**Value**
- **Risk mitigation:** Prevents accidental
git reset --hard,rm -rf, or similar commands issued by autonomous agents, safeguarding codebases and CI pipelines. - **Fast AI integration:** Provides a ready‑made safety layer so teams can plug in large‑language‑model (LLM) coding assistants without building their own guardrails from scratch.
- **Broad compatibility:** Supports the major coding‑assistant CLIs, making it a one‑stop solution for heterogeneous AI toolchains.
**Practical Adoption Path**
- **Install** the npm package and add the
cc-safety-nethook to the project’spackage.jsonscripts or CI configuration. - **Configure** allowed command patterns (whitelist) and define custom remediation actions via the provided JSON/YAML policy file.
- **Integrate** with existing AI agents by invoking the hook in the agents’ command‑execution pipeline (e.g., wrap
gitorfscalls). - **Test** in a staging environment, iterating on the policy until false positives are minimized.
- **Promote** to production, optionally coupling the hook with monitoring/alerting to log blocked commands.
**Production Readiness**
- **Activity & Community:** 1,409 stars, 64 forks, recent commits (as of 2026‑06‑23), and active issue discussions indicate a healthy maintainer presence.
- **Maturity:** The core functionality is stable, with clear CLI/API boundaries and TypeScript typings, easing integration and automated testing.
- **Security Posture:** No known critical vulnerabilities; however, a final review of the license (MIT‑style) and any third‑party dependencies is advisable before enterprise rollout.
- **Scalability:** Designed as a lightweight hook, it adds negligible overhead and can be deployed across multiple developer machines or CI agents.
Overall, cc‑safety‑net offers a mature, low‑friction safety layer that can be adopted quickly in AI‑augmented development pipelines and is ready for serious production pilots.
Problem
kenryu42/cc-safety-net helps add AI capability without starting from a blank model stack.
Outcome
High for an OSS candidate: recent activity, adoption, and ecosystem signals are strong enough for a serious pilot.
Workflow
- prototype AI features
- build RAG or agent workflows
- evaluate model tooling
Evidence
A coding agent CLI hook that acts as a safety net, catching destructive git and filesystem commands before they execute. Supports Codex, Claude Code, OpenCode, Gemini CLI, Copilot CLI, Kimi Code and Pi.
- Record date: 2026-09-10T18:25:58.158Z