Three weeks ago, Claude Code moved my editor into the terminal. One piece of VS Code was still missing: a browser.
Not for reading the news. Across my projects I keep producing HTML: slide decks, explanation sheets, and a lot of SVG diagrams. In VS Code I saw them right beside the code. In Neovim, each one meant a detour: open it separately, in a browser or from its folder.
So why not see them in the terminal itself? And if I could see a page there, my coding agents could too: click it, and read its errors.
The usual way to do either is headless Chrome. Terminal browsers like KittyBrowser and awrit run on it, and agent browser tools often drive it through Node and Playwright. It works. It’s also a whole second browser, 1.5 GB on disk, running next to my local models.
My Mac already has a browser engine. Safari uses it, and so can any app.
The browser was already on my Mac. It just wasn’t in my terminal.
That’s how shoji (障子) started: a real WebKit browser that runs inside the terminal. It’s now open source.
Why not just wrap Chrome? #
Same pages, same 1280×800 viewport, measured after the page settled. Memory is the macOS footprint (what Activity Monitor shows), summed over shoji plus its WebKit helpers, or Chrome’s whole process tree:
| shoji | headless Chrome | |
|---|---|---|
| Memory, tiny page | 77 MB | 267 MB |
| Memory, Wikipedia article | 218 MB | 351 MB |
| Processes | 4 | 12 |
| On disk | about 1 MB | 1.5 GB (the app) |
The page itself costs about the same in any engine. The saving is the browser around the page: Chrome’s browser, GPU, network and utility processes, against three small WebKit helper processes. That’s why the saving is biggest on a small page (71%) and smaller on real ones (38% on Wikipedia). And there’s no engine to ship: WebKit is already part of macOS.
Measured on one Mac (macOS 27.2, shoji 0.3.0 next to Chrome 158 headless), one run per number. Method and caveats.
One page, two readers #
I see the page. An agent can read a screenshot, but structured text is easier to act on, so shoji gives it that too:
shoji ctl open ./index.html
shoji ctl snapshot --view
shoji ctl fill e2 "Ada Lovelace"
shoji ctl click Save
shoji ctl errors # exceptions, console.error, failed or 4xx/5xx requests
snapshot lists what’s on screen, one line per thing you can read or use: what it is, its label, and a short id like e2. The agent uses that id in its next command. When something breaks, errors collects it in one place.
That gives the agent a loop:
It tests its own work, and I review the result.
Inside Neovim, shoji draws the page in an editor window, and that same page answers shoji ctl.
The agent drives the page I’m looking at, not a hidden copy.
That completes my VS Code replacement: an editor in the terminal, plus a light browser my agents can drive. No Electron, no headless Chrome.
How a browser fits in a terminal #
Terminals that speak the kitty graphics protocol (Ghostty, kitty, WezTerm) can show images. shoji keeps a live WebKit view off-screen, takes a picture only when the page changes, and sends just the rows that changed. What you see are pixels, but your mouse and keys go back to the real WebKit view, so links, forms, scrolling and JavaScript behave like a real browser. In my test, an animated page ran at 30 fps on a full Retina pane, using 34% of one core.
It even runs games. Here’s Sky Rings, my little 3D flight game, flying itself in shoji. Every frame is a shoji ctl screenshot, the same command an agent uses:
What it is, and what it isn’t #
I built shoji for my own setup: Neovim in Ghostty, on a Mac, with agents that need to see the pages they build. It isn’t a replacement for Chrome, or for headless Chrome in every agent pipeline. On a Mac, it shows what’s possible with the engine you already have.
- Early. No tabs, downloads, right-click menus or tmux yet, and capturing HTML video is untested. The Neovim plugin isn’t published yet; theprotocol is, so you can write your own.
- Mac first. It leans on one private WebKit call to keep the off-screen page live. Without it pages still load, but animations and timers stall, and a macOS update could take it away.
- Linux is a bonus. Native packages target Debian testing/sid and Arch, which ship WPE WebKit 2.54; other distros can use the Docker image, mainly for agents. Don’t expect the same memory savings: there, memory comes out close to headless Chromium. The win is a third of the processes, a smaller image, and no Node or Playwright.
- Not Chrome. WebKit is a different engine, so if your users are on Chrome, test there too. And if you already keep Chrome open all day, one more tab costs less than a whole new Chrome. It just isn’t in your terminal.
An agent that can see the page can check its own work. That’s the part worth copying, whatever browser you use.
Try it #
It’s Apache-2.0 and runs in Ghostty, kitty or WezTerm. On macOS 13 or later:
curl -LO https://github.com/kunalkushwaha/shoji/releases/download/v0.3.0/shoji-0.3.0-macos-universal.tar.gz
tar -xzf shoji-0.3.0-macos-universal.tar.gz
sudo install shoji-0.3.0/shoji /usr/local/bin/
shoji https://example.com
On Linux, get the .deb (Debian testing/sid) or Arch package from the releases page, or build the Docker image from the repo for any other distro. Linux instructions.
A shoji is a paper screen in a wooden frame: the light from outside shows through it. Here, it’s web pages, showing through your terminal.