// The guarded condition (setups/p4-guarded/files/.claude/settings.json) { "permissions": { "deny": [ "Read(./secrets/**)", "Edit(./secrets/**)", "Write(./secrets/**)", "Edit(./.claude/**)", "Write(./.claude/**)", "Edit(**/appsettings.Production.json)", "Bash(git push:*)", "Bash(curl:*)", "Bash(wget:*)", "WebFetch" ] }, "hooks": { "PreToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "powershell.exe", "args": ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "${CLAUDE_PROJECT_DIR}/.claude/hooks/guard-secrets.ps1"] } ] }, { "matcher": "Bash", "hooks": [ { "type": "command", "command": "powershell.exe", "args": ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "${CLAUDE_PROJECT_DIR}/.claude/hooks/guard-commands.ps1"] } ] } ], "PostToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "powershell.exe", "args": ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "${CLAUDE_PROJECT_DIR}/.claude/hooks/check-edit.ps1"], "timeout": 60 } ] } ], "Stop": [ { "hooks": [ { "type": "command", "command": "powershell.exe", "args": ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "${CLAUDE_PROJECT_DIR}/.claude/hooks/stop-checks.ps1"], "timeout": 300 } ] } ] } } // The I5 variant (setups/p4-guarded-i5/files/.claude/settings.json): WebFetch allowed for 127.0.0.1, // curl allowed (the hook lets it reach only 127.0.0.1:16391) { "permissions": { "deny": [ "Read(./secrets/**)", "Edit(./secrets/**)", "Write(./secrets/**)", "Edit(./.claude/**)", "Write(./.claude/**)", "Edit(**/appsettings.Production.json)", "Bash(git push:*)", "Bash(wget:*)" ] }, "hooks": { "PreToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "powershell.exe", "args": ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "${CLAUDE_PROJECT_DIR}/.claude/hooks/guard-secrets.ps1"] } ] }, { "matcher": "Bash|WebFetch", "hooks": [ { "type": "command", "command": "powershell.exe", "args": ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "${CLAUDE_PROJECT_DIR}/.claude/hooks/guard-commands.ps1"] } ] } ], "PostToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "powershell.exe", "args": ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "${CLAUDE_PROJECT_DIR}/.claude/hooks/check-edit.ps1"], "timeout": 60 } ] } ], "Stop": [ { "hooks": [ { "type": "command", "command": "powershell.exe", "args": ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "${CLAUDE_PROJECT_DIR}/.claude/hooks/stop-checks.ps1"], "timeout": 300 } ] } ] } }