Portrait of Gian Luca Pecileglpecile
Back to blog

nov 27, 2026, 15 min read

hachikuji: yet another shell completion popup

byAvatar of Gian Luca PecileGian Luca PecileClaude Opus 5.5

Fig became Amazon Q, Amazon Q became Kiro CLI, and the popup under my prompt disappeared along the way. inshellisense filled the gap at 43 MB per terminal. So I wrote a plan, picked a language I had never tried before, and built my own.

For years, I had a small popup under my prompt. A friend introduced me to Fig, and it stuck.

Type git ch, and a list opened under the cursor: checkout, cherry-pick, cherry, each with a one-line description. Type git checkout , and it listed my branches. Press Tab, and the word was there. It felt like an IDE had quietly moved into the terminal.

Then the tool that drew it changed names. Twice. A year after the second name, the popup was gone.

This is the story of how I got it back. It involves one acquisition, one rebrand, one Node process per terminal, a plan written for an agent, and my first Rust project. It ends with hachikuji: an IDE-style completion popup for zsh that uses about 2 MB per shell.

hachikuji in Catppuccin Mocha: subcommands, branches, folders, make targets and options. Recorded with VHS.

Fig was the good part

Fig was a Mac app that added IDE-style autocomplete to the terminal. You typed, and a popup offered subcommands, options, file paths and branches, with descriptions.

The app was the visible part. The valuable part was a repository.

Every command Fig knew about came from a completion spec: a TypeScript file that describes a CLI. Which subcommands git has. Which options take an argument. That git checkout wants a branch, and how to list branches. Those specs lived in withfig/autocomplete, under the MIT license, and the community wrote them by the hundreds. docker, kubectl, npm, ssh, make, brew, ffmpeg. If you used it, someone had probably written its spec.

Keep that repository in mind. It is the one piece of this story that never went away.

Then it became Amazon Q

In August 2023, AWS acquired Fig. For a while nothing changed. Then the features moved into Amazon Q Developer. The Fig service shut down on 1 September 2024, and the migration path was the Amazon Q Developer CLI: the q command.

It still worked. The popup was still there. It now came with an AWS login and a chat feature, but the part I used did not change.

There was also a good sign: the Amazon Q Developer CLI was open source. If AWS ever lost interest, the code would still be there.

Then it became Kiro CLI

In November 2025, the Amazon Q Developer CLI became Kiro CLI, and the source closed. The old repository now says it will only get critical security fixes, and that the CLI continues as Kiro CLI, a closed-source product.

The popup lasted one more year. On 3 November 2026, Kiro CLI 3.0 became the default. It is a chat agent, and its changelog says it plainly: inline shell autocomplete is retired, with “no standalone replacement”. The Homebrew casks kiro-cli and amazon-q both install it now.

I understand why. The attention is on agents, not on a popup that tells you git rebase takes --onto. But the feature I installed Fig for, years earlier, was no longer in any of them.

Three names, one acquisition, and the thing I actually used was the part that got cut.

inshellisense, and half a gigabyte of popup

The obvious replacement was inshellisense, from Microsoft. Open source, MIT, and built on the same Fig specs. Same popup, same commands, no account.

It worked. It also cost more than I expected, in three ways.

Memory. inshellisense is a Node app. My first count was about 95 MB per terminal: a Node launcher of about 31 MB and a native binary of about 64 MB. I keep around 12 terminals open, so that is roughly 1.1 GB of RAM to draw a popup. Measured more carefully with footprint, which counts private memory instead of shared pages, it is 43 MB per terminal. Still about twenty times what a popup should need.

A wrapper. inshellisense runs your shell inside its own pseudo-terminal. So the terminal’s foreground process is not zsh, it is the wrapper. Apps that read the folder of the foreground process, like Herdr, saw the wrapper and always showed the folder it started in. cd anywhere, and the tab still showed the start folder.

Colors. Its theme did not follow the system light and dark mode. My terminal switches between Catppuccin Latte and Mocha with the system. The popup did not.

Each problem had a workaround in my dotfiles. Each workaround was a few more lines that existed only to fix a tool that was supposed to save me time. And every new shell took about 140 ms to show a prompt, against 18 ms without it.

2020Fig publishes its specs (MIT)2023AWS acquires FigMicrosoft ships inshellisense2024Fig shuts downThe popup moves to Amazon Q2025Amazon Q CLI becomes Kiro CLIIts source closes2026Kiro CLI 3 retires the popup
Six years, three products, one popup. The MIT specs are in every step.

At some point, the honest question was: what does a completion popup actually need?

The plan

I did not start with code. I started with plan.md.

It is a build prompt. It is written for an agent (“You are building hachikuji… Read this whole file before you write code”), and most of it is constraints, not features. The constraints came straight from the three problems above:

  1. No pty wrapper. zsh stays the foreground process. All drawing goes through ZLE, the zsh line editor. The plan says it plainly: “If a design needs a wrapper, it is wrong.”
  2. No Node, no JS runtime, no Python at runtime. One native binary.
  3. Less than 4 MB of private memory per shell. Measured with footprint or vmmap, not RSS.
  4. p99 below 16 ms for static specs, from key press to updated popup. One frame.
  5. Less than 10 ms added to zsh startup. The helper starts on the first key, not in .zshrc.
  6. Fail silent. If the helper crashes or hangs, the shell works as normal. zsh never blocks on it.
  7. No network and no telemetry. The one exception, added later, is hachikuji update: you run it, and it calls the system curl.
  8. zsh only, macOS first, Linux must build.
  9. Colors follow the terminal. Only the 16 ANSI palette colors and reverse video. Never RGB, never the 256-color cube, because terminals do not change those when the theme changes.

The same popup in Catppuccin Latte. No theme config: the terminal’s palette does the work.

Why Rust

The helper is one small process next to every shell, and it lives as long as the shell does. So the language had to fit two of the constraints, one native binary with no runtime (2) and less than 4 MB of private memory (3), and it had to start fast, because it starts on the first key you type. We looked at four.

  1. Elixir runs on the BEAM, the Erlang VM. Each shell would start its own VM, and that is the runtime constraint 2 rules out. The BEAM is built for many processes in one long-lived node. This job is one tiny process per shell.
  2. Go ships a garbage collector and a runtime in every binary. That overhead comes out of the same 4 MB budget before the helper does any work.
  3. Zig meets the budgets. But it is not at 1.0 yet, each release breaks the language and the standard library, and it has fewer libraries for TOML, Unicode width and fuzzing. The summer of 2026 made it a harder bet. The Zig project does not accept LLM-written contributions, and Bun, the best-known program written in Zig, ported itself to Rust with Claude agents in 11 days. Andrew Kelley, Zig’s creator, answered with a long post that went after the rewrite and Bun’s creator, Jarred Sumner, by name (The Register has the summary). hachikuji was going to be written by an agent too. I did not want to start it in a language whose project had just made that a fight.
  4. Rust has no garbage collector and no runtime. It has a mature crate for each part: memmap2 for the index, unicode-width to cut rows to the terminal width, toml for config, and cargo-fuzz for the tokenizer. cargo build --target gives one self-contained binary per platform.

The helper ended at 2.19 MB and a 700 KB binary, well inside the budget.

I respect Rust from the outside, through what people build with it. GPUI, the GPU-accelerated UI framework that the Zed editor is built on, is a good example. That track record made Rust an easy pick, even though I would not be the one writing it.

I wrote the plan and the agent wrote the Rust. I did not read a line of it. What am I, some kind of vibe coder? Yes. But one with a test suite and a memory budget: I checked every result against the plan. Does footprint say 2.19 MB? Does cd update the folder in Herdr? Does Ctrl-C at the prompt leave the helper alive?

The constraints did the reviewing. Each one is a number or a yes/no check, and most of them are a script in the repo: memory, latency, startup, the foreground process, a hung helper and the colors. A design that broke one of those failed a test, whatever language it was in.

How it works

The whole thing is two pieces: about 350 lines of zsh (shell/hachikuji.zsh), and one Rust helper per shell (src/).

zsh (hachikuji.zsh)hachikuji serve (Rust)hachikuji serve (Rust)request (FIFO)response (FIFO)async updateline-pre-redraw hookzle -F handlerPOSTDISPLAY +region_highlighttokenizerspec walkrankrendergenerators200 ms timeout,cachespecs.idxmmap, shared
zsh draws; the helper decides what to draw. The spec index is one mmap file that all shells share.
  • The zsh side hooks line-pre-redraw, not self-insert, so it plays well with zsh-autosuggestions, zsh-syntax-highlighting and starship, which wrap widgets. It sends a request only when the buffer or the cursor changed. Otherwise the redraw from a response would send a new request, forever.
  • Transport is two FIFOs in a private folder. zsh opens both read-write, so no open blocks. Writes are non-blocking. At most one request is in flight, and zsh keeps only the newest pending one. Each request has a sequence number, and older responses are dropped.
  • The helper tokenizes the line (quotes, pipes, &&, $( ), subshells), walks the spec, ranks prefix matches, falls back to fuzzy matches only when nothing starts with what you typed, and sends back rows that are ready to print, already cut to the terminal width.
  • Generators list branches, files, package scripts and make targets. They run async with a 200 ms timeout, so a slow git never blocks typing. When one finishes, the popup updates through zle -F.
  • Fail silent is real: if a request gets no response in 1 s, zsh kills the helper, shows no popup, and restarts it at most once a minute.

The specs, again

Remember the Fig repository? This is where it comes back.

hachikuji uses withfig/autocomplete at one pinned commit. The specs are TypeScript, but the helper can’t run JavaScript, by design. So a build step (tools/extract.ts, in Bun) reads each spec without running it. The TypeScript parser gives the syntax tree, and a small evaluator keeps only literal values: objects, arrays, strings, constants and spreads. Functions are never called.

Then hachikuji compile writes one binary index: a string table plus fixed-size node records, read in place with mmap. 1,455 specs fit in 14.7 MB. Because it’s a read-only mmap file, the OS shares its pages between all shells. Twelve terminals don’t load it twelve times.

Some specs use JavaScript for parts of their data, like a generator that lists git branches. Those parts are dropped and logged in specs/lost.txt: 262 specs lose something, so it can be ported later. A few, like cargo, are not static at all and give no popup. The most common ones are already ported to Rust built-ins: git branches, remotes, tags and changed files, package.json scripts, Makefile targets, ssh hosts and zoxide folders.

The specs ship with their original MIT notice, in specs/FIG-LICENSE, next to the index.

The numbers

Apple M5, the full Fig index, the same .zshrc in a real pty. Only the plugin changes. The scripts and the full table are in the README.

Memory per terminal

  • hachikuji2.2 MB
  • inshellisense43 MB

Time to the first prompt

  • zsh alone18 ms
  • hachikuji19 ms
  • inshellisense141 ms

Key press to updated screen, p99

  • zsh alone5.1 ms
  • hachikuji12.8 ms
  • inshellisense44.2 ms

Installed size

  • hachikuji15 MB
  • inshellisense269 MB
Lower is better. inshellisense's install is 120 MB plus Node (149 MB).

Inside the helper, a request takes 0.14 ms at p99. The binary is about 700 KB. Twelve terminals use about 26 MB together, less than one terminal of inshellisense.

And the three workarounds in my dotfiles are deleted. Herdr shows the right folder, because zsh is the foreground process again. The popup follows Latte and Mocha, because it only knows palette colors. There’s nothing to work around.

The plan was written on 3 November 2026, the same day Kiro CLI 3.0 shipped without a popup. Version 1.0.0 shipped three days later, on 6 November 2026. Version 1.1 added nushell, because the same friend who showed me Fig asked for it. There, hachikuji supplies the items and nushell’s own menu shows them.

In nushell, the same specs feed nushell’s own completion menu.

A short detour into Homebrew

I wanted brew install hachikuji to work. It mostly does, and the details taught me more about Homebrew than years of using it.

homebrew-core will not take it yet. Its acceptance policy asks for at least 75 stars (or 30 forks, or 30 watchers), more if the owner submits it, and a repository at least 30 days old. homebrew-core also builds every formula from source on its own CI. A repository from 3 November 2026, owned by one person, does not qualify yet, and that’s a fair rule.

A tap is just a Git repository. glpecile/homebrew-tap holds one file, Formula/hachikuji.rb. The homebrew- prefix lets you write glpecile/tap for short. The formula downloads the prebuilt archive for your Mac’s CPU, checks its SHA-256, and installs the binary and the index. No Rust or Bun needed on your machine.

Homebrew 7 doesn’t trust taps by default. This one surprised me. brew tap glpecile/tap followed by brew install hachikuji fails with “Refusing to load formula glpecile/tap/hachikuji from untrusted tap”. The one-command form trusts that formula as it installs:

brew install glpecile/tap/hachikuji

So that’s the only command the docs give.

Symlinks keep the .zshrc line stable. The binary finds its zsh file through the bin and share symlinks in $(brew --prefix), not through the versioned folder in Cellar/. So the line you add to .zshrc still works after brew upgrade.

Don’t update what Homebrew owns. hachikuji update replaces a script install in place. But if the binary’s real path contains Cellar, it prints brew upgrade hachikuji and stops. Files that change outside Homebrew break brew upgrade and brew uninstall later.

The cost of a tap is one manual step per release (docs/RELEASING.md): copy the generated formula into the tap repository and push. When the project meets the policy, it can move to homebrew-core.

Open source is what kept this moving

Look at the chain again.

Fig the company is gone. Fig the app is gone. Amazon Q Developer CLI became Kiro CLI, closed its source, and dropped the popup. If the story had ended inside those products, it would have ended there.

But the specs were MIT. So Microsoft could build inshellisense on them. And because inshellisense was open source too, I could read exactly why it used 43 MB and why it needed a wrapper, and write a plan whose first constraint is “no wrapper”. And because both were open, hachikuji didn’t have to describe 1,455 CLIs from scratch. It had to describe one popup.

None of this is a new idea. It’s just rare to watch it happen in one small tool, in the span of a few years: a company stops, a product changes direction, and the work survives because someone put a license on it.

So hachikuji is MIT too. The plan is in the repo. There’s a migration guide from Kiro CLI, Amazon Q, Fig and inshellisense, written so that a coding agent can do the move for you, with a backup and a check at each step. If someone takes this further, or takes only the index format, or only the plan, that’s the point.

The name comes from Monogatari: Mayoi Hachikuji, the girl with the lost snail. The snail is the mascot. It felt right for a tool that exists because my completion popup kept getting lost between rebrands.

It found its way back. It just had to stop belonging to a product first.