Claude Code can call AgentGuard before risky tool use.
To write the template automatically in the current project:
agentguard init --agent claude-codeThis creates .claude/hooks/agentguard-protect.sh and .claude/settings.local.json.
Configure a PreToolUse hook that pipes Claude Code hook JSON to agentguard protect:
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "AGENTGUARD_AGENT_HOST=claude-code AGENTGUARD_ACTION_TYPE=shell AGENTGUARD_TOOL_NAME=Bash agentguard protect"
}
]
}Recommended matchers:
Bash→shellRead→file_readWrite,Edit,MultiEdit→file_writeWebFetch,WebSearch→network
allowandwarnexit0require_approvalis returned as Claude Code's nativeaskresponse when availableblockexits2
Cloud-connected runs still enforce locally. AgentGuard does not require a Cloud approval page for runtime confirmation.