|
13 | 13 | When you run multiple Claude Code sessions in parallel, every |
14 | 14 | PreToolUse permission prompt fires in a different terminal. |
15 | 15 | `approval-hub` aggregates them into a single TUI so you can resolve |
16 | | -every request from one place — and the learned rules apply to future |
17 | | -requests across all sessions. |
| 16 | +every request from one place. Learned rules apply to future requests |
| 17 | +across every session on the same machine. |
18 | 18 |
|
19 | | -```text |
20 | | -+- approval-hub ---------------------------------------------+ |
21 | | -| pending (2): | |
22 | | -| > [a1b2c3d4] Bash: npm install 10:01:23 | |
23 | | -| [e5f6g7h8] Edit: .env.local 10:01:25 | |
24 | | -| | |
25 | | -+------------------------------------------------------------+ |
26 | | -| session_id: a1b2c3d4... | |
27 | | -| tool: Bash | |
28 | | -| command: npm install | |
29 | | -| cwd: ~/proj/foo | |
30 | | -| matcher: Bash(npm:*) | |
31 | | -| | |
32 | | -| y once n deny a persist d deny-persist t ttl ? help q | |
33 | | -+------------------------------------------------------------+ |
34 | | -``` |
| 19 | +<img src="assets/demo.gif" alt="approval-hub demo" width="900"> |
35 | 20 |
|
36 | | -## Highlights |
37 | | - |
38 | | -- **One TUI for every session.** Each session's PreToolUse hook posts |
39 | | - to a local broker; the broker pushes pending requests over SSE to a |
40 | | - single Bubble Tea TUI. |
41 | | -- **Matcher learning.** `a` / `d` records a permission rule |
42 | | - (`Bash(npm test:*)`, `Edit(.env)`) so subsequent matching requests |
43 | | - resolve in about 30 ms without prompting. |
44 | | -- **TTL rules.** `t` grants a one-hour pass instead of a forever rule. |
45 | | -- **Fails safe.** Kill the broker and Claude Code's hook receives a |
46 | | - connection error; Claude Code falls back to its built-in prompt. |
47 | | - Nothing breaks. |
48 | | -- **Local-only.** `127.0.0.1` listener, bearer token stored in `0600` |
49 | | - files, no network exposure. |
| 21 | +Two parallel Claude Code sessions queue PreToolUse requests; one TUI |
| 22 | +resolves them. `a` persists a learned `Bash(npm:*)` allow rule, `d` |
| 23 | +persists an `Edit(.env.local)` deny rule, and the next matching request |
| 24 | +from any session resolves from the store without prompting. `t` grants |
| 25 | +a TTL rule instead of a forever one. |
50 | 26 |
|
51 | 27 | ## Install |
52 | 28 |
|
@@ -135,8 +111,11 @@ the broker HTTP API. |
135 | 111 |
|
136 | 112 | `approval-hub` listens on `127.0.0.1` only and authenticates every |
137 | 113 | request with a `crypto/rand` 32-byte bearer token stored in `0600` |
138 | | -files. See [SECURITY.md](SECURITY.md) for the threat model. |
| 114 | +files. If the broker is not running, Claude Code's hook gets a |
| 115 | +connection error and falls back to its built-in prompt, so no session |
| 116 | +is blocked by a daemon outage. See [SECURITY.md](SECURITY.md) for the |
| 117 | +threat model. |
139 | 118 |
|
140 | 119 | ## License |
141 | 120 |
|
142 | | -MIT — see [LICENSE](LICENSE). |
| 121 | +MIT. See [LICENSE](LICENSE). |
0 commit comments