4 Commits

Author SHA1 Message Date
Jonas H
1f483ad3d1 Hot-reload onto a rebuilt binary with ctrl-r
Restarting to pick up a code change costs the three things this app
exists to hold: the proxy port, the embedded claude pane, and the live
feed. So ctrl-r does not restart — it execs the binary now on disk into
this same process. execve keeps the pid, the open fds and the child
processes, so the listener socket, the pty and its claude child all
simply carry on; the feed travels in a JSON snapshot.

Build nothing, watch nothing. A build is the user's business, and a
running instance must not decide on its own when to become different
code. Rebuild outside, then press ctrl-r in each instance.

Drain before the exec. It destroys the tokio tasks relaying in-flight
responses, so the proxy stops accepting and finishes what it has first.
The socket stays open throughout (App::listener_fd is a dup), so
requests made during the swap queue in the kernel backlog and are served
by the new image — verified end to end: nothing refused, nothing cut.

Treat the snapshot as advisory. It is written by the old binary and read
by the new one, whose types usually just changed — that is the normal
case, not the edge case. The fd numbers stay in plain fields and the
feed is decoded per session behind a sanitiser, so a schema change costs
the feed and never the port or the pane.
2026-08-27 11:46:15 +02:00
Jonas H
a72eafc42a claude cloak rename 2026-06-15 10:31:35 +02:00
Jonas H
60df921dbb Add embedded claude pane (option B spike): PTY + wezterm-term module
- src/term.rs: self-contained module spawning `claude --session-id <uuid>`
  with ANTHROPIC_BASE_URL pointed at our proxy, inside a portable-pty;
  wezterm-term models the screen (and answers terminal queries), a small
  renderer paints cells into the ratatui buffer.
- Toggle with alt-c; off by default, hiding keeps the session alive.
- Modifier-split input: plain keys go to claude, alt-keys drive the feed
  (alt-q quit, alt-j/k scroll, alt-f filter, alt-n/p session).
- Dynamic pane height: the tap flags AskUserQuestion/ExitPlanMode in the
  embedded session (matched via --session-id) before Claude Code renders
  the prompt → pane grows 35%→60%; shrinks when the tool_result echoes
  back in the next request.
- wezterm-term isn't on crates.io: pinned git rev of the monorepo.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 08:16:53 +02:00
Jonas H
3f49e11b21 Initial commit: pass-through proxy TUI for Claude Code streams
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 07:59:05 +02:00