Skip to content

Captures for agents on another machine - #65

Draft
kitlangton wants to merge 1 commit into
mainfrom
feat/remote-agents
Draft

kitlangton wants to merge 1 commit into
mainfrom
feat/remote-agents

Conversation

@kitlangton

Copy link
Copy Markdown
Owner

Captures for Agents on Another Machine

Problem

Scrawl records on your Mac and writes each capture to ~/Library/Application Support/scrawl/captures/<id>.scrawl/. When you press ⌘V or ⌥⇧V into Ghostty while running Claude Code, Codex, or OpenCode over ssh kitbox.exe.xyz, Scrawl pastes /Users/kit/Library/Application Support/scrawl/captures/<id>.scrawl/contact-sheet.png and a summary.md header pointing to /Users/kit/Library/.... The agent runs on the remote Linux VM, where /Users/kit/Library/... does not exist, so its file tool fails with ENOENT.

Scrawl already has an "agentHost" setting in src/handoff.rs that streams a bundle over tar | ssh, but it only runs when queuing an OpenCode API prompt (send_bundle_to_session), never on clipboard copy (⌘V) or paste (⌥⇧V), and it unpacks into the Mac's /Users/<you>/Library/... path, which fails on Linux remotes where $HOME is /home/<you>.

Options

Option Setup Privacy Latency Agents supported
a. Copy bundle over SSH and paste the remote path Set "agentHost": "kitbox.exe.xyz" in ~/.config/scrawl/config.json (uses existing ~/.ssh/config and keys; needs only sh and tar on the remote). Stays between your Mac and your SSH host. ~0.5 s on a warm ControlMaster socket (~1.2 s cold) for contact-sheet.png, frames/, summary.md, and scrawl.json; video streams in the background. All of them: Claude Code, Codex, OpenCode TUI in a remote terminal, plus remote OpenCode servers.
b. Send to a remote OpenCode HTTP API with images attached Expose the remote OpenCode server (opencode serve) and configure its URL and session. Stays on your machines. ~1–2 s per send. OpenCode only. Does not help Claude Code or Codex in an SSH terminal, and the agent still cannot read frames/frame-XX.png or scrawl.json unless the bundle is on the remote disk.
c. Upload to a URL and paste https:// links Configure an S3/R2 bucket or hosted relay account. Screen recordings and voice transcripts leave your machines. 1–3 s upload plus agent download. Spotty. Terminal agents attach local image paths directly to the vision prompt, whereas https:// URLs are read as plain text unless the agent fetches them with a tool.
d. Inline PNG bytes in the clipboard None. Local only. Instant. Fails over SSH. Terminal emulators only send text across an SSH pty, not NSPasteboardTypePNG, and remote xclip/wl-paste checks the remote display rather than the Mac clipboard.

Recommendation

Extend Scrawl's existing "agentHost" SSH sync so it works for every capture handoff (⌘V, ⌥⇧V, the Paste chip, and scrawl send) and unpacks into ~/.scrawl/captures/<id>.scrawl on the remote machine instead of the Mac's /Users/.../Library/... path. In the same tar | ssh call, the remote shell prints its resolved directory (/home/exedev/.scrawl/captures), so Scrawl rewrites summary.md, the clipboard, the ⌥⇧V image path, and OpenCode file:// attachments with the exact path on the remote filesystem while streaming heavy video in the background.

What You Configure and See

Add "agentHost" (and an optional "agentPath", which defaults to "~/.scrawl/captures") to ~/.config/scrawl/config.json, or set SCRAWL_AGENT_HOST:

{
  "agentHost": "kitbox.exe.xyz"
}

When a capture finishes, Scrawl copies contact-sheet.png, frames/*.png, scrawl.json, and summary.md to kitbox.exe.xyz:~/.scrawl/captures/<id>.scrawl/ over a multiplexed SSH connection and puts the remote path on your clipboard:

[scrawl 0:14 · Brave “Checkout” · /home/exedev/.scrawl/captures/scrawl-1792500000000-1234-1.scrawl]
- #1 (0:03) “The pay button clips on narrow screens.”

Pressing ⌥⇧V in Ghostty pastes /home/exedev/.scrawl/captures/<id>.scrawl/contact-sheet.png first (attaching [Image #1] in Claude Code, Codex, or OpenCode TUI) and the summary second. If the SSH host is unreachable, Scrawl logs the error and falls back to the local Mac path so the capture is still usable locally.

@grmkris

grmkris commented Oct 29, 2026 •

Copy link
Copy Markdown

gm, text below generated by ma ai agent, but i think it is fine.. can we brianstorm some cool solution for this?

Thanks for this, it's exactly my setup. I work across several VPSs over SSH (Claude Code and Codex in tmux/tern/iterm2/superllgical's rexy), so per-host agentHost config gets awkward for me.

Could Scrawl optionally paste the contact sheet as an image instead of a path? Terminals like Tern already upload pasted clipboard images to the remote host and rewrite the path, so it would just work over SSH on any machine with no setup per server. Right now Tern has nothing to upload, because Scrawl pastes the path as text.

Maybe a paste mode setting, like "paste": "path" | "image"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants