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. A third fewer bytes come back, so context peaks lower and every turn re-sends less.
Less to write
The model is asked to keep its reasoning brief, and it reaches the fix with fewer output tokens.
Same results
412 tasks solved against 405. Neither is significantly ahead, so the savings cost nothing in success.
Input tokens
28% less
578M input tokens against pi's 799M over the same 500 tasks: 1.40M per solved task against 1.97M.
Output tokens
6% less
9.03M output tokens against 9.66M, reasoning included: 21.9k per solved task against 23.8k.
Time
7% less
240 hours of agent time against 259, on one model server, with both agents working each task at the same time.
Tasks solved
412/ 500
pi solved 405. Each solved 25–32 tasks the other missed, 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
578M
799M
Output tokens
9.03M
9.66M
Agent time
240 h
259 h
Peak context, median task
26.9k
40.2k
Agent memory (RSS), median
3.8 MiB
129 MiB

SWE-bench Verified, all 500 tasks, one attempt each, graded with the official harness. Hanabito 398850f against pi 1.4.0 in codemode, which also gives the model a single JavaScript tool. DeepSeek-V4.1-Flash on one self-hosted server, containers without internet access, a 180-minute cap per task. On the 410 tasks never used while tuning Hanabito's prompt, the gap holds: 326 solved against 321, 27% less input, 6% less output. Agent memory is the median resident size of each agent's own process, sampled every 5 seconds for 20 minutes across 22 running tasks. Measured 2026-11-01.

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: