A local completion path designed around typing
ShellClaw sends the current command line to a Rust daemon over a local Unix socket. The daemon checks private command memory, falls back to a 0.5B model when needed, and returns only a validated suffix. Zsh renders that suffix as native ghost text without putting it into your command buffer.
ZLE hook
Line, cursor, working directory, session ID, and deadline.
Rust daemon
SQLite FTS5 recall first. Local Qwen inference through llama.cpp when memory has no valid match.
POSTDISPLAY
Newest valid response only. Ctrl+Space moves the suffix into the real buffer.
One request, five boundaries
Each boundary keeps interactive typing responsive and makes stale or malformed output easy to discard.
- 01
Capture a snapshot
The hook records the current line and cursor rather than handing the daemon control of the terminal.
- 02
Recall familiar commands
SQLite FTS5 ranks local history using the command prefix and working-directory context.
- 03
Generate only when needed
A fine-tuned Qwen2.5-Coder 0.5B model produces a short suffix when recall cannot answer.
- 04
Cancel stale work
Newer input invalidates older requests. Concurrent socket responses are matched by session and request ID.
- 05
Render, never execute
The hook checks the line fingerprint and suffix shape before displaying gray POSTDISPLAY text.
Failure should feel like normal Zsh
Socket errors, SQLite locks, inference timeouts, empty output, and stale responses all become “no suggestion.” The shell remains usable.
- TransportNewline-delimited JSON-RPC over a local Unix socket.
- PermissionsSocket permissions are set to
0600. - ConcurrencyPersistent connections support cancellation and concurrent responses.
- ValidationSuggestions are single-line suffixes tied to the current input hash.
Read the implementation
The protocol types and daemon boundaries are available in the repository.