A modal terminal editor for coding-agent prompts.
Write long, precise prompts in a focused terminal UI. Reuse local prompt history, recover drafts after a crash, and add exact file or line references with @. Run zz standalone or use it as $VISUAL in tools that support an external editor.
The project is preparing its first public release. Build from source for now; prebuilt binaries and package-manager installs are next.
Inline prompt fields work for short requests. Larger coding tasks need editing, navigation, history, and a reliable way to point an agent at project context. General-purpose editors can do most of this, but they do not provide prompt-specific accept, cancel, recovery, history, and context workflows out of the box.
zz stays deliberately small:
- one soft-wrapped text buffer;
- modal editing with Vim, shell, and macOS shortcuts;
- transactional accept and cancel;
- local autosave and crash recovery;
- workspace and global prompt history;
- fuzzy project-file search with exact line ranges;
- no accounts, network client, or telemetry.
A Rust toolchain is currently required.
cargo install --git https://github.com/basuev/zz --lockedOr build a local checkout:
git clone https://github.com/basuev/zz.git
cd zz
cargo build --releaseRun zz without arguments to write the accepted prompt to stdout:
zz > prompt.txtPass a file to use zz as an external editor:
zz path/to/prompt.txtSet it as $VISUAL for a tool that supports external editors:
VISUAL=zz your-agent-commandIn fish:
set -gx VISUAL zz
your-agent-commandCompatibility depends on the external-editor contract of the calling tool. Agent-specific workflows will be documented only after they are tested against released versions.
- Press
ito enter Insert mode. - Write the prompt and use normal modal motions to edit it.
- Type
@at a token boundary to search workspace files. - Press
Enterto preview a file orTabto add the whole-file reference. - In preview, move with
j/k, pressvto start a selection, then pressEnterto add the selected line range. - Press
ZZto accept the prompt. - Press
ZQto cancel without changing the input file.
Examples of inserted references:
@src/editor.rs
@src/editor.rs:120-180
@src/
Path prefixes such as @src/editor scope the search immediately. Search respects .gitignore, .ignore, global Git excludes, and hidden-file rules. No full workspace index is built.
| Keys | Action |
|---|---|
ZZ |
Accept |
ZQ |
Cancel |
:w, :wq, :x |
Accept |
:q, :q! |
Cancel |
Ctrl+C |
Clear the buffer |
Ctrl+C, Ctrl+C |
Cancel and exit |
/patternand?patternsearch forward and backward.nandNrepeat the last search.f,F,t, andTmove to characters on the current line.;and,repeat the last character motion.iw,aw,i",a",i(, anda(select text objects..repeats the last change; a count repeats it multiple times.Ctrl+A,Ctrl+E,Ctrl+U,Ctrl+W, andCtrl+Kwork in Insert mode.- macOS Command and Option editing shortcuts work in supported terminals.
Press Ctrl+P or run :history to open fuzzy prompt history. Tab switches between workspace and global history.
Prompts are not sent over the network. Accepted prompt history and recovery drafts are stored in the operating system's application-data directory selected by the Rust directories crate. On Unix, zz restricts its data directories to mode 0700 and files to mode 0600.
History contains the full accepted prompt. Draft files contain unfinished prompt text and workspace paths. Treat this local data as sensitive. See docs/privacy.md for storage details and the current threat model.
| Platform | Status |
|---|---|
| macOS | Developed and tested locally |
| Linux | Expected to work; not yet continuously tested |
| Windows | Not yet claimed as supported |
Terminal behavior can vary. Please include the OS, terminal, shell, keyboard layout, and zz version in terminal-input bug reports.
The repository includes steady-state PTY and editor performance budgets for startup, input, rendering, context search, and large pastes:
cargo bench --bench performance -- --checkThe budgets are regression checks, not cross-project benchmark claims. Results depend on the machine, terminal, filesystem, and build profile.
Use GitHub Issues for reproducible bugs and focused feature proposals. Please do not include private prompts, secrets, or proprietary source code in reports.
