Quick Setup
Install Rampart service
Start the background policy server and save the authentication token:This installs a systemd (Linux) or launchd (macOS) service that:
- Runs on port 9090 by default
- Saves a bearer token to
~/.rampart/token - Starts automatically on boot
- Enables the web dashboard at http://localhost:9090/dashboard/
Wire Claude Code hooks
Install the Rampart hook into Claude Code settings:This modifies
~/.claude/settings.json to add:- PreToolUse hook: Evaluates every tool call before execution
- PostToolUseFailure hook: Prevents Claude from retrying denied commands
Safe to run multiple times — won’t duplicate hooks or overwrite existing settings.
How It Works
Claude Code fires PreToolUse for every tool. Rampart returns:"permissionDecision": "allow"→ Tool executes normally"permissionDecision": "deny"→ Tool is blocked, reason shown to user"permissionDecision": "ask"→ Claude shows native approval prompt
What Gets Protected
The hook intercepts all Claude Code tools using a wildcard matcher ("matcher": ".*"):
Configuration Details
The setup command installs this configuration to~/.claude/settings.json:
Example Session
Terminal output when Claude attempts dangerous operations:Policy Customization
Create custom rules for Claude Code workflows:~/.rampart/policies/custom.yaml
Monitoring
- Live Dashboard
- Terminal (TUI)
- Audit Logs
Open http://localhost:9090/dashboard/ in your browser:
- Active tab: Live stream of tool calls with approve/deny buttons
- History tab: Browse past tool calls, filter by decision
- Policy tab: Test commands before Claude runs them
Troubleshooting
Hook not firing
-
Check rampart is in PATH:
-
Verify settings.json was updated:
-
Check service is running:
Permission denied errors
If all commands are denied:-
Check token is accessible:
-
Verify policy loaded:
-
Test policy directly: