Design decisions
Why things are the way they are. Add an entry when a choice would otherwise have to be rediscovered.
TypeScript on Bun, one binary
The official ACP and MCP SDKs and the provider libraries are most mature in TypeScript, and
bun build --compile gives a single file with no runtime to install. Cost: the Bun runtime is about 100 MB of the
binary, whatever we add (our code and dependencies weigh about 2 MB). Startup is about 50 ms.
Terminal library: pi-tui
Tried against OpenTUI on the same streaming chat before writing anything else.
| pi-tui | OpenTUI | |
|---|---|---|
| Screen | main screen: the terminal's own scrollback, selection and copy keep working | alternate screen, scrolling owned by the app |
| Code | pure TypeScript | a native library per platform (and per libc) |
| Cross-compiling | nothing to do | each target needs its native package |
| First paint | about 100 ms | about 200 ms |
| Memory at rest | about 53 MB | about 74 MB |
| Components | editor with completion, Markdown, lists, images | more (diff, code highlighting) |
pi-tui won on the first three lines: a coding agent's transcript belongs in the terminal's scrollback, and one code base for every platform keeps releases simple. Colored diffs, which OpenTUI ships, took a few lines to write.
Providers: AI SDK packages, behind our interface, at the low level
We use the provider packages (@ai-sdk/anthropic, openai, google, openai-compatible) through their
language-model interface (doStream) and nothing of the higher-level SDK: the loop, the retries and the tool
execution are ours. That gives four maintained wire protocols for a 200-line adapter, and each can be swapped for a
client of our own later (OpenCode and Pi both ended up there) without touching the core.
ACP: the official SDK
The acp front end is built on @agentclientprotocol/sdk and tested against the SDK's own client, so conformance
follows the SDK. What ACP 1 lacks goes in _meta["maxxing-code"] (see ACP).
ripgrep: used when installed, not embedded
Embedding ripgrep means one more binary per platform inside ours and a download step in the build. grep and
glob use the installed rg and fall back to a built-in search with the same results. Revisit if the fallback
proves too slow on large repositories.
MAXXING.md, and every file other agents already use
MAXXING.md is the native instruction file. CLAUDE.md and AGENTS.md are read with the same rules, as are
.claude/ folders and .mcp.json, so that an existing project works on day one and stays usable by the other
tools. When several files exist they are all read; duplicates (symlink, import, identical copy) are read once.
Sessions: a JSONL tree
One append-only file per session, entries linked by id / parentId. Fork, undo and compaction append instead of
rewriting, so nothing is ever lost and a torn last line is the worst a crash can do. No database.
Permissions: declared by tools, decided in one place
A tool only says what a call is about to do (access()); modes and rules are applied by core/permissions.ts.
Deny rules hold in every mode, bypass included. Compound shell commands are split and each part must pass.
Timeouts move commands to the background
Killing a build or a test suite at an arbitrary timeout wastes the work and confuses the model. At the timeout the command keeps running, its output goes to a log file, and the model is told where to look.
Not there
Subscription logins, LSP, plugins and hooks, native Windows, a desktop app, session sharing, an HTTP server, a sandbox on macOS. Each can come later; none is needed to be good. (Sign-in for remote MCP servers came in 0.2.)
Maxxing Code