{"slug": "an-experimental-web-browser-written-from-scratch-in-rust-by-an-ai-agent-claude", "title": "An experimental web browser written from scratch in Rust by an AI agent (Claude)", "summary": "An experimental web browser called swb, written from scratch in Rust, has its entire codebase designed, written and maintained by an AI agent (Claude), with the project owner setting goals and checking results. The browser uses general-purpose libraries for HTTP, TLS, HTML tokenizing, image decoding, WOFF/WOFF2 decoding, font shaping, 2D rasterization and windowing, while the CSS, style, layout, painting, page loading, JavaScript engine, DOM and other web APIs and user interface are written in the repository. Eight target pages match Chromium — senko.net, Hacker News, a Wikipedia article, a Craigslist posting, the Ars Technica and BBC front pages, the repository's GitHub page and an OpenStreetMap map — and 41,842 tests of swb's own JavaScript engine test262 subset pass, though workers, window.open and tabs, media playback, WebGL and CSS anchor positioning remain undone.", "body_md": "An experimental web browser, written from scratch in Rust.\n\nAn AI agent (Claude) designs, writes and maintains all of the code. The\nproject owner sets the goals and checks the results. See\n[docs/ground-rules.md](https://github.com/senko/swb/blob/main/docs/ground-rules.md).\n\n*swb shows the GitHub page of this repository, with JavaScript on.*\n\nswb uses general-purpose libraries (HTTP, TLS, HTML tokenizing, image decoding, WOFF and WOFF2 decoding, font shaping, 2D rasterization, windowing). The browser parts (CSS, style, layout, painting, page loading, the JavaScript engine, the DOM and the other web APIs, user interface) are written in this repository.\n\nswb is developed and tested on Linux (Wayland or X11). Other platforms are not tested.\n\nRequirements (Debian/Ubuntu package names):\n\n- Rust toolchain via [rustup](https://rustup.rs/) . The version is pinned in`rust-toolchain.toml` and installed automatically.\n- `libfontconfig-dev` ,`libxkbcommon-dev` ,`libwayland-dev` ,`pkg-config` .\n- A C compiler, `make` and`sh` (`build-essential` ): the build compiles\njemalloc, the memory allocator of the binaries, from source (ADR 0029).\n- [`just`](https://github.com/casey/just) (optional).\n\n```\ngit clone https://github.com/senko/swb.git\ncd swb\njust run https://senko.net/                    # build (release) and open a window\njust run --js https://github.com/senko/swb     # the same, with JavaScript on\n```\n\nWithout `just`: `cargo run --release -p swb -- https://senko.net/`. The\nbinary is `target/release/swb`.\n\nThe toolbar has back, forward and reload buttons, the JavaScript toggle\n(**JS**) and the address bar. In the address bar, an address without a\nscheme gets `https://`, and an absolute path opens a local file. On the\ncommand line, a relative file path also works.\n\n| Key | Action | \n|---|---|\n| Ctrl+L | Focus the address bar | \n| Alt+Left, Alt+Right, mouse back and forward buttons | Back, forward | \n| Backspace | Back (when no text field has the focus) | \n| F5, Ctrl+R | Reload | \n| Escape | Stop loading | \n| Tab, Shift+Tab | Move the focus between links and form controls | \n| Enter | Follow the focused link | \n| Ctrl+A, Ctrl+C | Select all text, copy the selection | \n| Ctrl+X, Ctrl+V | Cut, paste (in text fields and the address bar) | \n| Ctrl+Shift+J | Turn JavaScript on or off | \n| Ctrl+Q, Ctrl+W | Quit | \n\nJavaScript is off by default. The JS button and Ctrl+Shift+J apply to the\nnext page that loads; reload to apply the change to the current page.\n`--js` starts with JavaScript on. JavaScript needs a stack limit of at\nleast 8 MiB (`ulimit -s`). Below it, the button is gray and JavaScript\nstays off.\n\nHeadless mode (for tests and scripts):\n\n```\nswb --headless --screenshot page.png https://senko.net/\nswb --headless --full-page --screenshot page.png https://senko.net/\nswb --headless --with-chrome --screenshot window.png https://senko.net/\nswb --headless --dump-layout https://senko.net/\nswb --headless --js --eval 'document.title' https://senko.net/\nswb --headless --bench 20 https://senko.net/   # time each pipeline stage\n```\n\nRemote control: `swb --headless --remote-port 0` starts a WebSocket server\non 127.0.0.1 that tests and tools use to drive the browser (also with a\nwindow: `swb --remote-port 9222`). See [docs/automation.md](https://github.com/senko/swb/blob/main/docs/automation.md).\n\nSee `swb --help` for all options.\n\nEarly development.\n\n- Eight [target pages](https://github.com/senko/swb/blob/main/docs/targets.md) match Chromium:\nsenko.net, Hacker News, a Wikipedia article, a Craigslist posting, the\nArs Technica and BBC front pages, the GitHub page of this repository,\nand an OpenStreetMap map. All of them except senko.net also work with\nJavaScript on, with the interactions that the targets list names.\n- swb has its own JavaScript engine (`crates/js*` ); 41,842 tests of its[test262](https://github.com/tc39/test262) subset pass.\n- Not done: running scripts in workers (`Worker` exists but runs no\nscript),`window.open` and tabs, media playback, WebGL, CSS anchor\npositioning.\n\nThe [roadmap](https://github.com/senko/swb/blob/main/docs/roadmap.md) lists the milestones, what each one\nincludes, and the backlog. The [development log](https://github.com/senko/swb/blob/main/docs/devlog.md) has the\nlatest changes.\n\n```\njust check    # format check, clippy, all tests, license check\njust --list   # all commands\n```\n\n[docs/testing.md](https://github.com/senko/swb/blob/main/docs/testing.md) describes the tests and the tools that\ncompare swb with Chromium. [CLAUDE.md](https://github.com/senko/swb/blob/main/CLAUDE.md) has the instructions and\nthe workflow of the AI agents that write the code.\n\nswb's own source code is MIT-licensed. See [LICENSE](https://github.com/senko/swb/blob/main/LICENSE).\n\nSome of swb's source code and some of the material in swb binaries are third-party material that keeps its own license; the MIT License does not apply to it:\n\n- the Public Suffix List under the Mozilla Public License 2.0 (MPL-2.0, a\none-off exception,\n[ADR 0014](https://github.com/senko/swb/blob/main/docs/adr/0014-public-suffix-list-license-exception.md) );\n- stylesheets based on the WHATWG HTML Standard under CC BY 4.0;\n- code derived from Chromium and Skia under the BSD-3-Clause license (copies of swb's source code and binaries must include their license texts), and one file derived from Servo under the MPL-2.0;\n- the WebIDL files of `crates/web/idl/` , copied from WHATWG standards\n(BSD-3-Clause) and W3C specifications (W3C Software and Document\nLicense);\n- tables generated from the Unicode Character Database and Unicode CLDR (Unicode License v3).\n\nSee [THIRD_PARTY_NOTICES.md](https://github.com/senko/swb/blob/main/THIRD_PARTY_NOTICES.md) for the details and\nlicense texts.\n\nThe test data in `fixtures/` (snapshots of web pages, fonts) is\nthird-party material under its own licenses; see\n[fixtures/pages/README.md](https://github.com/senko/swb/blob/main/fixtures/pages/README.md) and\n[fixtures/fonts/README.md](https://github.com/senko/swb/blob/main/fixtures/fonts/README.md). It is not part of\nswb binaries. The fixtures for JavaScript (`fixtures/js/`) are local\nonly and not in the repository.", "url": "https://wpnews.pro/news/an-experimental-web-browser-written-from-scratch-in-rust-by-an-ai-agent-claude", "canonical_source": "https://github.com/senko/swb", "published_at": "2026-11-20 15:41:40+00:00", "updated_at": "2026-11-20 15:45:23.761533+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "artificial-intelligence", "ai-tools"], "entities": ["Claude", "swb", "Rust", "GitHub", "test262", "Chromium", "Hacker News", "Wikipedia"], "also_reported_by": [], "takeaway": "An AI agent (Claude) wrote and maintains the full swb browser in Rust, and its own JavaScript engine passes 41,842 tests of its test262 subset, with headless flags (--screenshot, --dump-layout, --eval, --bench) and a WebSocket remote-control port for driving it from tests.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/an-experimental-web-browser-written-from-scratch-in-rust-by-an-ai-agent-claude", "markdown": "https://wpnews.pro/news/an-experimental-web-browser-written-from-scratch-in-rust-by-an-ai-agent-claude.md", "text": "https://wpnews.pro/news/an-experimental-web-browser-written-from-scratch-in-rust-by-an-ai-agent-claude.txt", "jsonld": "https://wpnews.pro/news/an-experimental-web-browser-written-from-scratch-in-rust-by-an-ai-agent-claude.jsonld"}}