What problem does it solve?
Blocks destructive git and filesystem commands before execution to protect uncommitted work.
Core Features & Use Cases
- PreToolUse guard: Intercepts Bash commands and blocks dangerous operations using a safe allowlist of patterns.
- CLI integration: terrraphim-agent guard provides runtime decision results for integration hooks.
- Fail-open semantics: If the guard is unavailable or patterns fail, commands are allowed to avoid workflow disruption.
Quick Start
Install terraphim-agent from GitHub releases, then configure a PreToolUse Bash hook in your project.
Copy the guard script to your repository at .claude/hooks/git_safety_guard.sh and reference it in .claude/settings.local.json:
{
"hooks": {
"PreToolUse": [{
"matcher": "Bash",
"hooks": [{
"type": "command",
"command": ".claude/hooks/git_safety_guard.sh"
}]
}]
}
}
Validate behavior by piping commands through terraphim-agent guard, e.g.:
echo "git reset --hard" | terraphim-agent guard --json
echo "git checkout -b feature" | terraphim-agent guard --json