Web access analytics and control for Claude Code.
Requires Python 3.10+.
pip install krabb
krabb initThat's it. Every Claude Code tool call (WebFetch, WebSearch, Bash, Read, Write) is now logged locally.
- Logs every tool call to a local SQLite database at
~/.krabb/krabb.db - Enforces a domain blocklist — block specific domains from being accessed by Claude Code
- Exposes a local dashboard at
localhost:4242to browse events and manage the blocklist
krabb dashboardkrabb init Install hook + start daemon
krabb status Show daemon status and stats
krabb logs [--limit N] [--tool T] Show recent events
krabb dashboard Open dashboard in browser
krabb blocklist list List blocklist patterns
krabb blocklist add <pattern> Add a pattern
krabb blocklist remove <pattern> Remove a pattern
krabb hook Run hook server (foreground)
krabb uninstall Remove hook from Claude settings
Configuration is stored in ~/.krabb/krabb.db in the config table. Default values:
| Key | Default | Description |
|---|---|---|
default_decision |
allow |
Default action for unmatched tools |
hook_port |
4243 |
Port for the hook HTTP server |
dashboard_port |
4242 |
Port for the dashboard |
log_bash |
true |
Log Bash tool calls |
log_reads |
true |
Log Read/Write tool calls |
| Pattern | Matches |
|---|---|
example.com |
example.com and all subdomains |
*.example.com |
Subdomains only (not example.com itself) |
/regex/ |
Python regex matched against the full URL |
When the blocklist is empty (default), all domains are allowed. Add a domain to block it — everything else remains allowed. You can also paste full URLs; krabb extracts the domain automatically.
krabb registers a PreToolUse hook in ~/.claude/settings.json. The hook is a shell command that pipes Claude Code's tool-use payload to a local HTTP server via curl. The server:
- Logs the event to SQLite
- For web tools (WebFetch/WebSearch): checks the URL against the blocklist
- Returns
allowordenyto Claude Code
Everything runs locally. No data leaves your machine.
- Clone the repo
pip install -e ".[dev]"pytest tests/ -vruff check krabb/
PRs welcome. Please include tests for new functionality.
MIT — see LICENSE.