Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By karanb192v1.3.7MITIn 1 marketplace
Blocks the agent from writing to the settings, hook scripts and installed plugin files that enforce your guardrails. Runs on every Bash, Edit and Write call and denies by default; CONFIG_GUARD_ALLOW=true is the escape hatch. Claims it makes no network calls.
Trending plugins
7-day copy clicks
Run automatically on Claude Code events. Claude doesn't decide.
2 cautions to review before installing
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Blocks writes to the configuration files that register guardrails, including the hook scripts and the installed Claude Code and Codex plugins.
A PreToolUse hook fires before every Bash, Edit, MultiEdit, and Write call and denies any mutation of the files that wire your guardrails: settings files that register hooks and permissions, the hook scripts themselves, hooks.json manifests, the installed plugin code under ~/.claude/plugins/, .mcp.json and ~/.claude.json, plugin config, and the subagent spawn cap's ledger. Reads always pass (agents legitimately read settings); only writes, in-place edits, moves, copies onto, symlink swaps, and deletes are stopped, plus the claude config set, claude mcp add, and claude plugin install CLI forms (with their plugins, i, remove and rm aliases and any global options before the subcommand) that rewrite agent config without naming a settings path. Creating a protected file that does not exist yet also counts as mutation: that was the CVE-2026-25725 persistence vector, and the Aug 2026 CHAINDROP npm worm hid its payload in .claude/settings.json the same way. Edit/MultiEdit/Write paths are resolved through symlinks before checking, so a write through ln -s ~/.claude /tmp/x is still caught.
/plugin marketplace add karanb192/claude-code-hooks # once per machine
/plugin install config-guard@claude-code-hooks
Restart Claude Code, done. (Or from a shell: claude plugin install config-guard@claude-code-hooks.)
codex plugin marketplace add karanb192/claude-code-hooks
codex plugin add config-guard@claude-code-hooks
Open /hooks in Codex and approve this plugin. Re-approve after every update; Codex skips unapproved or changed hooks. Do not install it alongside guard-pack, which includes this guard.
This entry point checks Bash and native apply_patch calls. Patch files are checked individually; unreadable patches are blocked. Shell patches must use a plain command with a quoted heredoc; apply_patch anywhere else in a command, such as behind timeout or eval, is blocked. Literal searches and commit messages mentioning apply_patch pass. See the shared adapter's limits, including shell sessions and dynamically constructed commands.
Export configuration variables before launching Codex. An ask-mode match becomes a block because Codex hooks cannot ask. Logs stay in ~/.claude/hooks-logs/ with host: "codex", including on Codex-only machines.
| Event | Matcher | What happens |
|---|---|---|
| PreToolUse | Bash|Edit|MultiEdit|Write | Checks the target path (Edit/MultiEdit/Write) or command string (Bash) against the protected set for the active safety level; returns permissionDecision: "deny" (or "ask" in ask mode) with the pattern id and reason, {} otherwise. |
Three safety levels, each including the previous. Native file paths are normalized and resolved; shell paths use text matching with the limits below.
| Level | Protects |
|---|---|
critical | The enforcement chain: .claude/settings.json, .claude/settings.local.json, managed-settings.json, anything under .claude/hooks/, any script that the user, project or managed settings register as a hook command (wherever it lives), hooks.json manifests, installed Claude Code plugins under ~/.claude/plugins/ (the plugin cache, marketplace clones, installed_plugins.json, known_marketplaces.json) or under a custom CLAUDE_CONFIG_DIR, the spawn cap ledger under ~/.claude/subagent-spawn-cap/, .codex/config.toml, .codex/plugins/ and the corresponding paths under a custom CODEX_HOME. Deleting or moving the Claude config dir (~/.claude, $HOME/.claude, $CLAUDE_CONFIG_DIR) or the Codex home itself also counts. |
high (default) | Plus the config supply chain: .mcp.json, ~/.claude.json (where claude mcp add writes user and local MCP servers), .claude-plugin/, .codex-plugin/, Claude config/mcp/plugin write commands, and codex plugin add|remove, codex plugin marketplace add|remove|upgrade, codex mcp add|remove, codex features enable|disable. List/get forms stay allowed. |
strict | Plus instruction files that steer the agent: CLAUDE.md, CLAUDE.local.md, AGENTS.md, AGENTS.override.md, .claude/rules/, .claude/agents/, .claude/commands/. |
All optional, set via environment variables:
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub karanb192/claude-code-hooks --plugin config-guardPlugins from other owners that cover similar ground