A whole coding agent, inside one browser tab
wasm-agent gives an LLM a computer to work on, and that computer is your browser tab. The shell, the file system, the TypeScript compiler and the place the code runs are all WebAssembly and JavaScript. No VM, no container, no build server. Close the tab and the computer is gone; reload it and your project is still there.
Why this is a big deal
Coding agents today run on a real Linux machine: a VM or container per session, reserved RAM and CPU whether the agent is thinking or not. Model prices fall roughly tenfold a year, while the machines the agents run on get more expensive. Soon the sandbox will cost more than the intelligence.
A browser tab (or a V8 isolate on an edge server) is a far cheaper sandbox: no kernel and no operating system per user, and it costs nothing while it waits for the next token. What stopped agents from working there was the toolchain. You need a file system, a shell and a compiler that run without a machine. The last piece arrived in October 2026: ts-rust, the TypeScript 7 compiler ported to Rust by agents, compiles to WebAssembly. Microsoft's own native compiler is written in Go, whose garbage-collected runtime makes a poor WebAssembly fit. With ts-rust, the whole edit, type-check, run loop fits in a tab.
tsc run, in the browserWhat is in the tab
Shell + file system
just-bash: bash syntax and ~80 commands (grep, sed, awk, jq, rg, diff, tar…) over an in-memory file system, saved in IndexedDB.
TypeScript 7 compiler
ts-rust compiled to wasm32-wasip1, running in a Web Worker. The real type checker, not a transpiler.
Runtime + preview
run executes ES modules and preview shows pages in a sandboxed iframe with an opaque origin: generated code cannot touch the app or your keys.
git
Commits and pulls over the GitHub or Forgejo HTTP API, straight from the tab.
The agent
Claude with your own key (public version) or our gateway's Qwen 3.8 Flash-Next (internal version), using bash and file-edit tools.
Works on a phone
Portrait layout with Chat, Files, Terminal and Preview tabs, tested on WebKit (iPhone) and Chromium (Android).
What you can build with it
Anything that is TypeScript plus the browser's own APIs: pages, tools, games, libraries with tests. There is no npm, so the agent writes small things itself instead of installing them, which keeps projects tiny and readable. Tap an idea to open the agent with that prompt filled in.
Tip and bill splitter
A puretip() function with tests and a live-updating page. The demo project: built, tested and committed in 91 s.Try it →
Markdown notes with live preview
A tiny markdown-to-HTML converter written from scratch (headings, lists, code, links), unit tests for each rule, and a split-pane editor that saves to localStorage.Try it →
Canvas game
Snake or Breakout on a<canvas>, with the game logic separated from drawing so the rules (collisions, scoring) are unit tested.Try it →
Kanban board
Columns, drag-and-drop cards, persistence in localStorage, and a typed state reducer with tests.Try it →
SVG chart generator
Paste CSV, get a clean bar or line chart as SVG, with axis tick logic and CSV parsing tested.Try it →
Regex and JSON workbench
A regex tester with match highlighting, and a JSON formatter, validator and path explorer.Try it →
A typed library with a test suite
Date helpers, a priority queue, an LRU cache or a semver parser: strict TypeScript, a hand-written assert helper, and a README with examples. Good for katas and interview prep.Try it →
Landing page or personal site
Plain HTML and CSS with a little TypeScript for interaction, ready to commit and deploy through the pipeline below.Try it →
Teaching and kids' projects
A multiplication-table quiz, a flashcards app, a physics toy: small enough to read every line, and the agent explains its changes.Try it →
From idea to the internet
On our tailnet, projects made here flow through a pipeline that uses the same WebAssembly toolchain on the server as in your tab:
- Idea. Describe it to the agent.
- Build. The agent writes, type-checks and tests it in the tab, then
git commits to the forge. - Deploy and test on the tailnet. wasm-ci builds the commit again with the same toolchain, runs the tests, deploys it to
wasm-ci.bunny-sunfish.ts.net/apps/<repo>/, opens it in a headless browser and reports ✓ or ✗ on the commit. The agent can wait for this withci wait. - Validate. A person opens the tailnet URL, tries it, and approves it on the run page.
- Deploy to the public web. The approved build goes to
k4c.dev. Static output like this also runs as-is on edge platforms built on V8 isolates and WebAssembly.
Two versions
| Public | Internal (tailnet) | |
|---|---|---|
| URL | k4c.dev/wasm-agent | wasm-agent.bunny-sunfish.ts.net |
| Model | Claude, your API key | Qwen 3.8 Flash-Next via our gateway, no key |
| git | GitHub or Forgejo, your token | Forgejo as wasm-agent-bot, no token |
| Keys | stay in your browser | none in the browser |
Honest limits
- No network or package installs inside the box: no npm, no fetch to other sites from
run, no Node APIs. Projects use the browser's APIs. runhas a 10 s limit; the agent sees console output but cannot see the rendered page (it logs what it needs to check).- Safari's workers have a small stack, so extremely deep types can overflow the compiler there.
- The agent is only as careful as its model; the pipeline's tests and human validation are there for a reason.
Source: k4c/wasm-agent on our forge. Built on just-bash (Vercel), ts-rust (pingdotgg) and QuickJS, inspired by Theo's "TS Rust" video.