Repository navigation
A worker's conversation as a chat: a 💬 Chat tab beside its terminal, the one a phone opens on - #378
Open
rivshughes wants to merge 1 commit into
Open
rivshughes wants to merge 1 commit into
rivshughes wants to merge 1 commit into
Conversation
…the one a phone opens on A Claude Code worker's terminal is a poor way to read what it's been doing on a phone: a screen-sized window onto a TUI, with the history behind it. The chat tab shows the conversation itself instead: what you told it, what it said back (as markdown) and each tool it used, as a row that opens to show what ran and what came back, in a page that scrolls like any chat. It's read off the transcript Claude Code keeps for the session (the file its hooks name, see providers/claude.ts), tailed while anyone has the tab open: the server parses the user and assistant records into chat items, sends the latest 80 on attach, each new one as it's written, and a tool's result as a patch of the row it belongs to. Earlier… pages further back. A /clear names a new transcript, which starts the chat over. The box at the bottom sends a prompt the way the terminal's does (worker.prompt, with the 🎤), ⏹ interrupts, and when the worker wants permission its choices show above the box as buttons (Yes, Always, No), the same keys the keypad sends. A question with choices of its own still wants the terminal, which is the next tab. On the 2D view the chat is the tab that opens; on a computer the terminal is, as before. Other providers' workers keep a terminal only. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
muguetdev
pushed a commit
to muguetdev/agent-office
that referenced
this pull request
Oct 27, 2026
…the one a phone opens on (from Agent Office AgentSystemLabs#378) A Claude Code worker's terminal is a poor way to read what it's been doing on a phone: a screen-sized window onto a TUI, with the history behind it. The chat tab shows the conversation itself instead: what you told it, what it said back (as markdown) and each tool it used, as a row that opens to show what ran and what came back, in a page that scrolls like any chat. It's read off the transcript Claude Code keeps for the session (the file its hooks name, see providers/claude.ts), tailed while anyone has the tab open: the server parses the user and assistant records into chat items, sends the latest 80 on attach, each new one as it's written, and a tool's result as a patch of the row it belongs to. Earlier… pages further back. A /clear names a new transcript, which starts the chat over. The box at the bottom sends a prompt the way the terminal's does (worker.prompt, with the 🎤), ⏹ interrupts, and when the worker wants permission its choices show above the box as buttons (Yes, Always, No), the same keys the keypad sends. A question with choices of its own still wants the terminal, which is the next tab. On the 2D view the chat is the tab that opens; on a computer the terminal is, as before. Other providers' workers keep a terminal only. Ported to the fork: the tab sits beside 💻 Terminal and 📝 Code in termtabs.ts, the terminal keeps 📋 Copy, 📎 and Hide, every word is in en, pt-BR and ko, and the server only follows a worker for someone who may go to its floor (checked again on every poll). The transcript is read with a UTF-8 decoder, so a character cut by a read comes through whole.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A 💬 Chat tab on a Claude Code worker's terminal window: the conversation itself rather than a picture of the TUI. Your prompts as bubbles, what the worker said back rendered as markdown, and each tool it used as a collapsible row (what ran, what came back, ✓/✗/⏳), in a page that scrolls like any chat. On the 2D view (
/lite) the chat is the tab a worker opens on; on a computer the terminal still is, with the chat a tab away. Workers on other providers keep a terminal only.Why: on a phone the terminal is a screen-sized window onto a TUI with the history behind it, hard to read and (until #311) impossible to scroll.
How
src/shared/protocol/transcript.ts(new domain, registered inprotocol.ts):ChatItem(you/agent/tool/note),transcript.attach/detach/morefrom the browser,transcript.items(reset/append/prepend/patch) andtranscript.noneback.src/server/transcript.ts:TranscriptLogtails the session's JSONL (the path the Claude Code hooks already givetracker.transcript), reading only what's new, and turnsuserandassistantrecords into items. Sidechain (subagent), meta and bookkeeping records are skipped, slash commands read as typed (/clear, not the tags around it), a tool'stool_resultfills in the call it belongs to, and inputs/results are cut to a size that suits a phone. Defensive throughout: the format is Claude Code's.src/server/ws/handlers/transcript.ts: who follows which worker; one 1 s poll while anyone does (statSyncsize check, so an idle worker costs a stat a second and nothing else); a new transcript path (a/clear) resets the chat.FeatureHooksdrop a browser's follows when it leaves the floor or closes.WorkerManager.transcriptOf(id): the one accessor the handler needs.manager.tsis at its size ceiling, soowners()is folded onto one line to pay for it (net −1 line).src/client/ui/transcript.ts+.css: the pane. Native scrolling, stays at the bottom while you're reading the latest, keeps your place when older items are prepended, re-renders a tool row in place when its result arrives (keeping it open if you'd opened it). The composer sendsworker.prompt(withdictateField's 🎤), ⏹ sends Esc, andneeds_inputshows the worker'sactivitywith 1 · Yes / 2 · Always / 3 · No for a permission prompt (plain 1/2/3 and a "Terminal" button for anything else), all throughterm.inputas the keypad does.termtabs.ts: achatoption and astarttab;show()is returned so the pane can jump to the terminal.terminal.ts: builds the pane for Claude workers, routestranscript.*messages to it, refreshes it with the worker, detaches on close.docs/features.md(a bullet of its own),docs/controls.md.Checks
npm run typecheck,npm test(619 passing, including newtests/transcript.test.ts: items, incremental reads and result patches, what's skipped, prompt cleaning, tool gists),npm run build;tests/size.test.tsgreen (manager.ts1028 ≤ 1029)./liteagainst a live office: the Chat tab opens by default with the latest items at the bottom, Earlier… prepends 80 more without moving what you're reading, tool rows open to their input and result, tab switching detaches and re-attaches. Also used on a real iPhone over HTTPS.Not included: AskUserQuestion's choices as buttons (they're a TUI menu; the tab points you to the terminal), and transcripts of other providers.
🤖 Generated with Claude Code