Per-tool setup guides for integrating tirith with AI coding tools. Each tool has automatic protection via one command.
Claude Code has two independent protection layers: a PreToolUse hook that automatically intercepts every Bash tool call, and an optional MCP server for on-demand tools.
Project scope (default):
With MCP server:
Global (all projects):
Preview changes:
If you prefer manual setup, add this to .mcp.json:
| Variable | Default | Effect |
|---|---|---|
| TIRITH_BIN | tirith (from PATH) | Override tirith binary path |
| TIRITH_HOOK_WARN_ACTION | deny | deny blocks warnings, allow passes them |
| TIRITH_FAIL_OPEN | unset | Set to 1 to allow commands when tirith is missing or errors |
Test by asking the AI agent to run a suspicious command:
Expected: blocked by tirith before execution. Then try a safe command like ls -la — it should run normally with no interference.
Note: The hook is fail-closed by default. If tirith is missing, times out, or errors, commands are blocked. Set TIRITH_FAIL_OPEN=1 to switch to fail-open.