Claude Code hook
agent-guard
Secret-leak guardrails for Claude Code and Codex, also usable as git hooks and in CI.
Install
/plugin marketplace add JeongJaeSoon/agent-guardgit clone https://github.com/JeongJaeSoon/agent-guard.gitFrom the README
Agent Guard English · 한국어 · 日本語 A local-first guardrail that keeps AI coding agents from leaking your secrets. Blocks risky .env reads, masks secret-like output, and scans changes before they reach Git. No hosted account, no telemetry. Agent Guard is a local-first guardrail for Claude Code, Codex, Git hooks, GitHub Actions, and direct shell use. It blocks common secret-exposure paths before a supported tool runs, redacts supported tool output, and scans changed files after mutations. It uses gitleaks and portable shell; it has no hosted account, telemetry collector, or developer service. It is a defense-in-depth boundary. Keep GitHub Secret Scanning, Push Protection, review, and normal credential management in place. Agent Guard is not a vault, DLP system, EDR, or credential rotator. ![Agent Guard in Claude Code: the agent's Bash cat and Read of a .env holding a private key are blocked, and the user's own ! cat .env prints the key as [REDACTED] (shell integration enabled)](docs/demo.gif) Keep secrets out of Git A key that lands in a commit lives in history long after you delete the file. Agent Guard puts a gitleaks scan in front of the commit routes it hooks, so a detected API key, token, or .env value is stopped before it enters history, with CI behind it as a backstop: The plugin scans what the commit would contain. That covers the index and also the tracked changes Git stages by itself for git commit -a, --patch, or a pathspec such as git commit , --include, or --only, and the untracked files that --interactive can add. When an argument is only known at run time, such as git commit $FLAGS, or the same command runs git add first, the plugin scans every tracked change and untracked file, including ignored files after git add -f. Shell code the command line…
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
- JeongJaeSoon/agent-guard
- Type
- Hooks
- Language
- Shell
- License
- MIT
- Last updated
- 3 November 2026
- Topics
- ai-agentsclaude-codeclaude-code-plugincodexdevsecopsgithub-actionsgitleakspre-commit-hooksecret-scanning
FAQ
What is agent-guard?
Secret-leak guardrails for Claude Code and Codex, also usable as git hooks and in CI. It is a hook for Claude Code, from JeongJaeSoon/agent-guard on GitHub.
How do I install agent-guard?
Run /plugin marketplace add JeongJaeSoon/agent-guard inside Claude Code, then follow the setup in the README.
Is agent-guard popular?
JeongJaeSoon/agent-guard has 38 GitHub stars and 0 forks. It was last updated on 3 November 2026.
More hooks
CC Hooks Ts
39sushichan044/cc-hooks-ts
Define Claude Code hooks with full type safety.
Claude Code Zero
53LeeJuOh/claude-code-zero
Complete Claude Code plugin marketplace — agents, skills, hooks, commands, rules, MCPs.
Evolving Lite
50primeline-ai/evolving-lite
A self-evolving Claude Code plugin. Context routing, memory bootup, smart delegation, self-correction — out of the box.
Jev Axi
46shiftynick/jev-axi
Agent-ergonomic CLI for TypeSafe's Jev: fast calibrated judgments (pick, rate, check, rank, triage, guard) from the shell
Claude Warden
60johnzfitch/claude-warden
Security hooks and monitoring for Claude Code — quiet overrides, SSRF protection, MCP compression, OTEL tracing
Claude Ignore
47li-zhixin/claude-ignore
A Claude Code PreToolUse hook that prevents Claude from reading files that match patterns in .claudeignore files, similar to how .gitignore works.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.