Chat
Chat mode keeps a model session open for iterative work.
Start a session
zo --chat
zo --chat /sonnet 'Help me understand this API'
zo --chat --files read --web 'Research and compare the approaches used here'An initial prompt is optional. The selected model, reasoning effort, web setting, and tool modes are fixed when the session starts.
Exit by typing exit, quit, or q, or by pressing Ctrl-C or Ctrl-D.
Interactive input
- Press Enter to submit.
- Use Alt-Enter, Ctrl-O, or Ctrl-J to insert a newline.
- Press Tab after
@,!, or@!to complete file paths. - File markers are parsed fresh in every turn.
> @src/main.rs Explain this entry point
> Update @!src/main.rs with a clearer error
> Now simplify the explanationOutput paths granted during a chat remain available for later turns. Workspace file tools, shell tools, and web search also remain enabled for the session when selected on the original command.
Initial STDIN
Piped data becomes part of the first message; later input is read from the terminal:
git diff | zo --chat 'Let us review these changes'Context limits
zo retains complete user, assistant, and tool turns up to limits.max_session_bytes, which defaults to 4 MiB of serialized messages. Before each request it removes the oldest complete turns when necessary, retaining the system prompt and current turn. It warns when trimming occurs.
Each newly submitted turn also uses the 1 MiB default aggregate input limit. If the current turn alone cannot fit the session limit, zo rejects it instead of truncating it.
These are byte-based safety limits, not model token limits. Override them for one session with --max-input-bytes and --max-session-bytes.
Retries
If a stream fails, chat offers to retry the pending turn without duplicating the user message. When partial text was already displayed, the prompt warns that regenerated text may repeat. Completed tool results remain in history, so continuing does not rerun those side effects.
A single continuation is bounded to 32 tool-call rounds. If the model needs more, interactive chat offers another bounded batch; --non-interactive returns the error instead of prompting.
Prompt history
Set a history file to preserve interactive input lines between runs:
history_file = "~/.zo/history.txt"This restores readline prompt history, not earlier model conversations or their context.
Files & Workspace Tools → · Shell Tools & Policies → · Configuration →