Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

Commit d0acf3b

Browse files
committed
docs: add VHS demo gif and tighten README
1 parent 6499e78 commit d0acf3b

3 files changed

Lines changed: 79 additions & 34 deletions

File tree

README.md

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,16 @@
1313
When you run multiple Claude Code sessions in parallel, every
1414
PreToolUse permission prompt fires in a different terminal.
1515
`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.
1818

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">
3520

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.
5026

5127
## Install
5228

@@ -135,8 +111,11 @@ the broker HTTP API.
135111

136112
`approval-hub` listens on `127.0.0.1` only and authenticates every
137113
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.
139118

140119
## License
141120

142-
MIT — see [LICENSE](LICENSE).
121+
MIT. See [LICENSE](LICENSE).

assets/demo.gif

382 KB
Loading

demo/demo.tape

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Output assets/demo.gif
2+
3+
Set Shell "bash"
4+
Set FontSize 14
5+
Set Width 1180
6+
Set Height 640
7+
Set Padding 20
8+
Set TypingSpeed 35ms
9+
Set Theme "Catppuccin Mocha"
10+
11+
Hide
12+
Type `export TOKEN=$(jq -r .token "$HOME/Library/Application Support/approval-hub/config.json")`
13+
Enter
14+
Type "clear"
15+
Enter
16+
Show
17+
18+
Type "# approval-hub: one TUI for every Claude Code permission prompt"
19+
Sleep 700ms
20+
Enter
21+
Sleep 600ms
22+
23+
Type "# queue two PreToolUse requests from two parallel Claude sessions"
24+
Enter
25+
Sleep 400ms
26+
27+
Type `curl -sS -X POST http://127.0.0.1:17456/decide -H "Authorization: Bearer $TOKEN" -d '{"session_id":"sess-web","cwd":"~/dev.to","hook_event_name":"PreToolUse","tool_name":"Bash","tool_input":{"command":"npm install"}}' >/dev/null &`
28+
Enter
29+
Sleep 700ms
30+
31+
Type `curl -sS -X POST http://127.0.0.1:17456/decide -H "Authorization: Bearer $TOKEN" -d '{"session_id":"sess-api","cwd":"~/api","hook_event_name":"PreToolUse","tool_name":"Edit","tool_input":{"file_path":".env.local"}}' >/dev/null &`
32+
Enter
33+
Sleep 900ms
34+
35+
Type "clear"
36+
Enter
37+
Sleep 300ms
38+
39+
Type "approval-hub attach"
40+
Enter
41+
Sleep 2200ms
42+
43+
Type "j"
44+
Sleep 600ms
45+
Type "k"
46+
Sleep 600ms
47+
48+
Type "a"
49+
Sleep 1500ms
50+
51+
Type "d"
52+
Sleep 1500ms
53+
54+
Type "q"
55+
Sleep 600ms
56+
57+
Type "clear"
58+
Enter
59+
Sleep 200ms
60+
61+
Type "# learned rules persist across sessions"
62+
Enter
63+
Sleep 400ms
64+
Type "approval-hub list"
65+
Enter
66+
Sleep 2500ms

0 commit comments

Comments
 (0)