Claude Code hook
Cloneguard
Guarding AI agents from Untrusted Content
Install
pip install cloneguardFound in the project README. Check it for setup steps after installing.
git clone https://github.com/prodnull/cloneguard.gitFrom the README
CloneGuard Your AI agent reads untrusted repos. CloneGuard watches what it does next. Hook-level defense for AI coding agents. Detects prompt injection, constrains suspicious tool calls, and emits structured audit logs -- before the agent executes. The agent cannot disable it because CloneGuard runs at the hook layer, outside the agent's control. Built for Claude Code and Gemini CLI. Standalone scanning works with any agent. Active development (v0.6.0) -- feedback and contributions welcome. See It In Action A repo with a hidden .clinerules payload — CloneGuard catches it on scan. More demos Behavioral sequence detection — reads .env, then tries to curl the data out. First step allowed, second step blocked. Package hallucination — agent tries to install a package that doesn't exist on PyPI. Quick Start That's it. CloneGuard is now scanning every tool call in Claude Code. No config files to write, no agent restart required. Want the semantic classifier (recommended): What It Catches - Prompt injection patterns -- 240 rules across 34 categories, from instruction override to reasoning hijack to MCP tool poisoning - Behavioral sequences -- credential file read followed by network exfiltration attempt (SEQ-001), config writes for privilege escalation (SEQ-005), and more - Package hallucination -- agent tries to install a package that doesn't exist on PyPI/npm. If an attacker had registered that name first, you'd be running their code - Sensitive file access -- detects reads of credentials, SSH keys, and environment files in suspicious context How It Works Four defense layers, each running before the agent can act: Detection signals: When a detection fires, CloneGuard can report it (default), constrain the tool call via OS-level sandbox, or…
How hooks work
- Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
- They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
- A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Details
- Repository
- prodnull/cloneguard
- Type
- Hooks
- Language
- Python
- License
- Apache-2.0
- Last updated
- 9 April 2026
- Listed in
- awesome-claude-code-hooks
FAQ
What is Cloneguard?
Guarding AI agents from Untrusted Content It is a hook for Claude Code, from prodnull/cloneguard on GitHub.
How do I install Cloneguard?
Run pip install cloneguard, then follow the setup in the README.
Is Cloneguard popular?
prodnull/cloneguard has 8 GitHub stars and 1 forks, and is included in 1 curated Claude Code list. It was last updated on 9 April 2026.
More hooks
code-conductor
17yeisonrestrepo/code-conductor
Governance layer of hooks that vets agent commands before they execute.
Claude Code Templates
25altmemy/claude-code-templates
Project templates for Claude Code — Next.js, Spring Boot, and Flutter, each with preconfigured agents, skills, rules, and hooks
Claude Homeassistant Plugins
28ESJavadex/claude-homeassistant-plugins
Claude Code Plugins, Skills, Agents Marketplace for Home Assistant
Claude Memory
27codenamev/claude_memory
Long-term, self-managed memory for Claude Code using hooks, MCP tools, and SQLite
Agentic Tools
26acedergren/agentic-tools
Comprehensive toolkit for AI-assisted development: Claude Code permissions (400+ tools), Git workflows, and automation hooks
Claude Skills
27randommonicle/claude-skills
Engineering guardrails for Claude Code: 51 skills, reviewer agents and hooks, most written after a real defect shipped. Installable as a plugin.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.