← Pipeline

claude-builders-bounty Issue #3: Pre-tool-use Hook ($100)

Drafted
Reward: $100Platform: githubRail: opire (likely)Competition: ~769 claimants (high — but most likely low quality stubs)AI fit: highOpen issue ↗
Log time
Record payment (→ marks Paid)
Decision / notes
Read-only — unlock operator mode (top right) to edit.

Risk

| Risk | Assessment | |---|---| | Competition | HIGH (769 claimants) but most are likely grep wrappers; production-quality hook with tested edge cases stands out | | Opire payment | ✅ Opire confirmed online at 11:55Z | | Build effort | DONE — deliverable complete this tick |

Deliverables (0)

None yet — MINT attaches the PR/claim text + code here once it builds.

Timeline

No events yet.

Full proposal (drafted by MINT)

# Proposal Draft — claude-builders-bounty Issue #3: Pre-tool-use Hook ($100)

> **Status**: ✅ DELIVERABLES COMPLETE — requires operator review and approval before submission
> **DO NOT SUBMIT without operator approval** (per gig-earner guardrails)
> **Updated**: 2026-06-04T12:20:41Z (G5 leaf, tick=639) — hook built + tested (5/5 PASS)

---

## Bounty Details

| Field | Value |
|---|---|
| Issue | https://github.com/claude-builders-bounty/claude-builders-bounty/issues/3 |
| Title | [BOUNTY $100] HOOK: Pre-tool-use hook that blocks destructive bash commands |
| Reward | $100 USD — powered by Opire (✅ ONLINE as of 2026-06-04T11:55Z) |
| Claim mechanism | Post `/opire try` comment on issue, then submit a PR |
| Competition | ~769 claimants (high — but most likely low quality stubs) |
| Deliverable path | `autonomy/projects/gig-earner/submissions/issue3-hook/` |

## Why MINT Has a Unique Edge

MINT uses Claude Code hooks extensively (autonomy-tick runs inside hooks, safety guards
implemented as hooks). MINT understands the exact hook API format and delivered a
production-quality implementation — not just a skeleton.

## What Was Built (tick=639)

**Files:**
- `destructive_guard.py` — 110-line Python 3.8+ hook (stdlib only, zero dependencies)
- `settings-snippet.json` — copy-paste hook config for `.claude/settings.json`
- `hooks-config.json` — optional custom patterns config
- `README.md` — setup guide with test commands

**Test results (5/5 PASS):**
```
✅ rm -rf /tmp/test  → BLOCKED ("recursive rm is destructive")
✅ ls -la            → ALLOWED
✅ git reset --hard  → BLOCKED ("git reset --hard discards local changes")
✅ Read tool call    → ALLOWED (non-Bash tools pass through)
✅ DROP TABLE        → BLOCKED ("DROP TABLE is irreversible")
```

## What it blocks

| Category | Examples |
|---|---|
| Recursive deletes | `rm -rf`, `rm -fr`, `rm -r /` |
| Git history nukes | `git reset --hard`, `git clean -f`, `git push --force` |
| Database DDL | `DROP TABLE`, `DROP DATABASE`, `TRUNCATE TABLE` |
| Disk-level writes | `dd if=... of=/dev/sdX`, `mkfs` |
| Fork bombs | `:(){ :|:& };:` |
| Dangerous chmod | `chmod 777 /etc`, `chmod 777 /usr` |

## Operator Gate Required

1. **Post `/opire try`** comment on issue #3 (https://github.com/claude-builders-bounty/claude-builders-bounty/issues/3)
2. **Fork repo** (claude-builders-bounty/claude-builders-bounty)
3. **Copy files** from `submissions/issue3-hook/` into the PR
4. **Submit PR** to claude-builders-bounty/claude-builders-bounty

**Estimated operator effort: 5-10 minutes**

## Acceptance Criteria Assessment

The issue requires:
- [x] Hook blocks destructive bash commands — ✅ DONE (rm -rf, git reset --hard, DROP TABLE, etc.)
- [x] Works with Claude Code's pre-tool-use hook mechanism — ✅ uses `{"decision": "block", "reason": "..."}` format
- [x] Configurable patterns — ✅ `hooks-config.json` for custom rules
- [x] README with setup instructions — ✅ includes test commands
- [x] Tested — ✅ 5/5 tests PASS (run `echo '...' | python3 destructive_guard.py`)

## Risk Assessment

| Risk | Assessment |
|---|---|
| Competition | HIGH (769 claimants) but most are likely grep wrappers; production-quality hook with tested edge cases stands out |
| Opire payment | ✅ Opire confirmed online at 11:55Z |
| Build effort | DONE — deliverable complete this tick |

## Verdict

**Ready to submit.** Recommend after issue #5 (best odds) and issue #4 (existing advantage).
Or submit all three in parallel — operator effort is minimal per submission.

---

*Queued 2026-06-04T11:44Z by G5 leaf (tick=635) — deliverables completed 2026-06-04T12:20:41Z (tick=639)*