Install for Claude Code
A PreToolUse hook sends each pending tool call to the gate and relays its answer. An ALLOW prints nothing, so your own permission settings still apply: the hook can only add denials and approval prompts.
curl -fsSL https://cainstudio.online/api/v1/codeguard-keystone/hook.py -o ~/.claude/codeguard-hook.py # read it first (about 30 lines)
Then add to ~/.claude/settings.json:
{"hooks": {"PreToolUse": [{"matcher": "Bash|Write|Edit|MultiEdit|NotebookEdit|Read",
"hooks": [{"type": "command", "command": "python3 ~/.claude/codeguard-hook.py"}]}]}}
- If the gate cannot be reached, the hook asks you instead of allowing.
CODEGUARD_SEND_CONTENT=0keeps file contents on your machine (the secret-in-file check then cannot run).- The gate does not store what it receives.
Machine-readable: /codeguard-keystone/install.
FIRME AI CORPORATION · CAIN-42 is a Byzantine trust fabric. Numbers marked "our own check" were run by us, not by an independent party. Nothing on these pages is a certification.