Beta The beta of Hanabi · Linux & macOS

Hanabito

One agent. Many masks.

A fast, statically bounded AI agent for the terminal. One binary, one JavaScript tool, every edit undoable, and whichever model you want behind it.

curl -fsSL https://hanabi.to/install.sh | sh

 Hanabito  Working…
fix-journal-crc

You
The journal test fails after a torn write. Find out why.

Hanabito
Thinking: check how reopen handles the unsynced tail…
→ js await hanabi.search("core", "truncate")
← result core/journal.zig:212: fn truncateTail(…)
→ js edit("core/journal.zig", old, new)
← result { id: 'e14', path: 'core/journal.zig' }

The tail was truncated before its CRC was checked. It's
fixed, and zig build test passes.
──────────────────────────────────────────────────────
>  
local · DeepSeek-V4-Flash · ≤12% (15k/128k) · ≈84 tok/s · TTFT 0.3s
Illustration of the TUI. The transcript, tool calls and footer follow the real layout.

Light enough to leave running

Keep one open in every terminal. Your editor, browser and build keep the machine, and nothing runs while Hanabito waits.

Memory never grows
It reserves 10.3 MiB once at startup and never allocates again, however long the session runs. Context streams from disk instead of piling up in RAM.
Nothing beside it
A single executable. On Linux it is fully static: no runtime, no shared libraries, any distribution.
Quiet when idle
No redraw timer. It wakes only when something is due and redraws only the rows that changed.
Idle RAM
6.8MiB
Resident memory (RSS) of the TUI sitting ready at the prompt, code included: what top shows.
Working RAM
7.4MiB
Peak resident memory (VmHWM) over a scripted session: two rounds of js tool calls that search and read the Hanabito source and write a file, then a streamed answer.
Binary
3.7MiB
Stripped, statically linked ReleaseSafe executable: musl libc and TLS are built in, so it needs no shared libraries. Debug info ships separately as hanabito.debug.
First frame
1.3ms
From entering main to the first complete frame on screen. The provider check that follows takes another 0.4 ms.

zig build -Doptimize=ReleaseSafe at 9d78b68 on Linux x86-64, 120×40 terminal. One chat_completions provider on localhost, default limits. Median of 5 launches each. Idle RSS read from /proc after 3 s; working peak read from /proc after the session ends; timings from --verbose. Measured 2026-10-29.

Cheaper and faster to solve

On all 500 tasks of SWE-bench Verified, with the same model behind both, Hanabito solved as many as pi and spent less of everything to get there.

Less to read
Tool results are sized to what the model needs, keeping both the head and tail when trimmed. Nearly half as many result bytes come back, so context peaks 57% lower on the median task and every turn re-sends less.
Less to write
Chaining calls in one turn and keeping reasoning brief cuts turns and reaches the fix with 15% fewer output tokens.
Same results
420 tasks solved against 414. Neither is significantly ahead, so the savings cost nothing in success.
Input tokens
34% less
541M input tokens against pi's 815M over the same 500 tasks: 1.29M per solved task against 1.97M (median task: 186k against 679k).
Output tokens
15% less
8.43M output tokens against 9.91M, reasoning included: 20.1k per solved task against 23.9k (median task: 6.2k against 12.5k).
Time
10% less
109 hours of agent time against 120, on one model server, running in matched pairs at the same time (median task: 4.4 min against 8.8 min).
Tasks solved
420/ 500
pi solved 414. Each solved 13–19 tasks the other missed (McNemar p = 0.38), so the two are level on success; the difference is in what it costs.
HanabitopiOver all 500 tasks; pi’s bar is full length.
Input tokens
541M
815M
Output tokens
8.43M
9.91M
Agent time
109 h
120 h
Peak context, median task
16.6k
38.6k
Agent memory (RSS), median
7.3 MiB
110 MiB

SWE-bench Verified, all 500 tasks, one attempt each, graded with the official harness. Hanabito v0.2.0 against pi 1.7.0 in codemode, which also gives the model a single JavaScript tool. DeepSeek-V4.1-Flash (temperature 0.6, top_p 0.95) on one self-hosted server, 8 matched pairs in parallel, containers without internet access, a 180-minute cap per task. On the 360 tasks never touched while tuning or validating Hanabito, the gap holds: 294 solved against 288, 33% less input, 12% less output. Agent memory is the median resident size of each agent's own process, sampled every 5 seconds for 20 minutes across 14 running tasks. Measured 2026-11-30.

One call does the whole step

Most agents wait a round trip for every action. Hanabito gives the model one tool, JavaScript, so a search-and-edit across ten files is one program and one round trip. The loop runs in the sandbox, and the matches never pass back through the model.

Work composes
Top-level declarations persist between calls, so each step builds on the last.
Sandboxed
QuickJS with no I/O except the hanabi.* API: no fetch, no modules, no process. Files outside the workspace are out of reach.
Four tools · two round trips
tools: read_file, search, edit_file, shell

→ search("max_clients = 4", "core")
  the model reads every match, then…
→ edit_file(match1.path, "= 4", "= 8")
→ edit_file(match2.path, "= 4", "= 8")
→ edit_file(match3.path, "= 4", "= 8")
One tool · one round trip
tools: js

→ js
const changes = [];
const { matches } = await hanabi.search("core", "max_clients = 4");
for (const m of matches) {
  const line = m.line.replace("= 4", "= 8");
  changes.push(await edit(m.path, m.line, line));
}
return changes; // each edit's id, ready to revert

Let it try. Take it back.

Every file edit and local git change records its inverse. /undo puts the files and the conversation back together and continues on a new branch, so you can let the agent attempt things.

Nothing is lost
The abandoned branch stays in the journal, and the model can still search it.
No false promises
Undo is refused once something irreversible, like a shell command, has run.
kept in the journal /undo, then a new branch

It touches only what you allow

A mask is an identity with its own prompt, tools, skills and shell ceiling. A tool the mask leaves out isn't refused; for the model, it doesn't exist.

Switch mid-task
/mask keeps the conversation and changes the tools: build with one mask, review with another.
Decline by default
Sessions start strict. The approval panel's default choice is Decline, and a declined command stays refused for the session.
Fenced to the workspace
Paths outside it, .. and symlinks are refused.

Builder

  • files
  • search
  • edit
  • history
  • shell on approval

Reviewer

  • files
  • search
  • edit
  • history
  • shell
An illustration. You decide what each mask allows.

Any model. Your keys.

Hanabito speaks the three APIs nearly every provider offers, including local servers. Requests go straight from your machine to the provider: there is no Hanabi account and no proxy.

Switch mid-conversation
/model converts the context to the new API's format on disk, so a local and a frontier model can share one conversation.
Keys stay in your environment
Read from an environment variable and never written to the journal.
Rides out outages
Resets, 429s and 5xx errors are retried with backoff, and only before anything streams, so an answer never arrives twice.
  • OpenAI Chat Completions
  • OpenAI Responses
  • Anthropic Messages
> /model local DeepSeek-V4-Flash
  applies from the next turn; context converted on disk

Work that survives

Each session is an append-only journal with a CRC32 on every record. Resume replays it: transcript, model, mask and usage, exactly as you left them.

Torn writes are caught
An unsynced tail is truncated on reopen. Corrupt data fails with a clear error and the file is left untouched.
Resume in one line
On exit, Hanabito prints the command that brings you back.
$ hanabito
  … an afternoon of work, then Ctrl+C
Resume with: hanabito --resume fix-journal-crc

$ hanabito --resume fix-journal-crc
  transcript, model, mask and usage, replayed from the journal

Install

curl -fsSL https://hanabi.to/install.sh | sh
hanabito --check-config
hanabito --prompt "Why does the journal test fail?"

Configuration, your own tools and preludes are covered in the documentation.

Not yet

It's a beta. Interfaces and storage formats may change. Some gaps worth knowing about: