Engineering case study

0.5B for terminal autocomplete

A terminal completion system does not ask a model to hold a conversation. It asks for one short, context-bound suffix under a tight deadline, then lets the user accept or ignore it.

zsh Local

~ shellclaw status

shellclaw: running

Ctrl+Space accepts the gray suffix

Start with the output contract

ShellClaw deliberately narrows generation before model size enters the discussion.

  • One lineNo newline, carriage return, or NUL is accepted.
  • Suffix onlyThe daemon does not rewrite the full command.
  • Current inputEvery suggestion is tied to a fingerprint of the line being edited.
  • User reviewPOSTDISPLAY stays separate from the command buffer until Ctrl+Space.

The model is one part of the answer

Retrieval and interaction design reduce the amount of generative work needed on every keystroke.

Fast path

Recall what worked before

SQLite FTS5 searches executed commands using the current prefix and directory context. The measured 2,000-entry path is below 1 ms on the release test machine.

Model path

Complete unfamiliar prefixes

When recall has no valid match, Qwen2.5-Coder 0.5B generates a short continuation through llama.cpp with Metal acceleration.

Interaction path

Make rejection nearly free

Users can ignore a weak suggestion by continuing to type. Stale work is cancelled and late responses are discarded.

Asynchrony protects the typing loop

The daemon can retrieve memory, run inference, and send concurrent responses without blocking Tokio I/O tasks or the Zsh editing widget.

  1. 1User types a prefix.
  2. 2The hook sends a deadline-bound request.
  3. 3New input cancels older work.
  4. 4Only the newest matching response can render.

Known boundaries

This case study describes a working architecture, not a universal quality claim.

A benchmark page comes after the benchmark.

ShellClaw does not yet publish a full test set with cold start, hot latency, p50, p95, memory, and quality measurements. Those results should not be inferred from the memory fast-path number.

Try the complete local system

Install on an Apple Silicon Mac, inspect the source, and report command patterns that need work.