@justack/claude-hook
v0.1.0
Published
Claude Code hook for human-in-the-loop approvals via Justack
Downloads
102
Maintainers
Readme
@justack/claude-hook
Human-in-the-loop tool approvals for Claude Code. Routes dangerous tool calls to a human reviewer via Justack for approval before execution.
How it works
Registers as a Claude Code PreToolUse hook. When Claude tries to use a tool (Bash, Write, Edit, MCP tools), the hook:
- Evaluates the tool call against configurable rules
- Auto-approves safe commands (e.g.
ls,git status) - Sends dangerous/unknown commands to your Justack inbox for approval
- Blocks until you approve or deny — with optional feedback and argument modification
Installation
npm install -g @justack/claude-hookOr run directly with npx (no install needed):
npx @justack/claude-hook initQuick start
1. Get a Justack API key
Sign up at justack.dev and create an API key from the dashboard.
2. Initialize the hook
cd your-project
npx @justack/claude-hook initThe wizard will:
- Prompt for your API key (
jstk_...) or readJUSTACK_API_KEYfrom env - Prompt for the reviewer's email address
- Validate credentials against the Justack API
- Create
.justack/config.jsonwith default rules - Add
.justack/to.gitignore - Register the hook in
.claude/settings.json
3. Use Claude Code as normal
The hook runs automatically. When Claude triggers a dangerous action, you'll get a notification in your Justack inbox with the full tool call details, diffs, and an approve/deny prompt.
Default rules
| Tool | Mode | Behavior |
|------|------|----------|
| Bash | pattern | Auto-approves safe commands, flags dangerous ones, asks for unknown |
| Write | all | All file writes require approval |
| Edit | all | All file edits require approval |
| mcp__* | all | All MCP tool calls require approval |
Safe patterns (auto-approved): ls, cat, git status, git diff, git log, pnpm install, tsc, eslint, etc.
Dangerous patterns (require approval): rm, git push, sudo, curl -X POST, npm publish, node, python, etc.
Configuration
The config lives at .justack/config.json in your project root:
{
"apiKey": "jstk_...",
"recipientEmail": "[email protected]",
"rules": {
"Bash": {
"mode": "pattern",
"dangerous": ["rm ", "git push", "..."],
"safe": ["ls", "git status", "..."]
},
"Write": { "mode": "all" },
"Edit": { "mode": "all" },
"mcp__*": { "mode": "all" }
}
}Rule modes
all— Every call to this tool requires approvalnone— Auto-approve everything (skip this tool)pattern— Match againstdangerousandsafesubstring lists. Unknown commands require approval.
Tool names support glob patterns (e.g. mcp__* matches all MCP tools).
Environment variables
| Variable | Description |
|----------|-------------|
| JUSTACK_API_KEY | API key (used by init if set, avoids interactive prompt) |
License
MIT
