System prompt
Override or extend the built-in instructions.
Drop a SYSTEM.md in $ZOT_HOME to replace the built-in identity and zot-docs guidance for every run. Per-invocation, --system-prompt still wins; delete the file to revert to the default.
Custom prompts still receive appended instructions and generated context, including AGENTS.md, skills, auto-swarm guidance when enabled, and the date, working directory, and Platform: <goos>/<goarch> footer. On Windows the footer also notes that the bash tool runs cmd.exe, not a POSIX shell. Use --no-context-files to omit AGENTS.md instructions for one run.
Use --append-system-prompt (repeatable) to layer extra instructions on top without blowing the default away.
Separate compaction guidance
By default, /compact and automatic compaction use side mode: a separate request with its own summarization system prompt and no tools. SYSTEM.md, --system-prompt, --append-system-prompt, and AGENTS.md do not configure that separate system prompt.
Opt into in_place mode with "compaction_mode": "in_place" in $ZOT_HOME/config.json, then restart zot. This mode retains the active system prompt, including ordinary overrides and extension replacements, plus tools, reasoning settings, and the structured message prefix. A final instruction requests only a summary. See Sessions for provider cache limitations, fallback behavior, and provider-hosted tool caveats.
In both modes, a nonblank $ZOT_HOME/COMPACT.md replaces the built-in summary template, including its format requirements. Missing or blank files retain the default. Repeatable --append-compaction-prompt values add instructions after the selected template. Restart zot after editing COMPACT.md. Zot does not execute local tools while summarizing, so the summarizer cannot read local referenced documents.
Extension replacements
Extensions can subscribe to before_agent_start to inspect and replace the complete assembled prompt before the first model call. Unlike SYSTEM.md or --system-prompt, this replacement happens after generated context and appended instructions have been added. The host uses the returned string exactly, including an empty string, without appending anything else.
The result stays stable across ordinary follow-up messages and tool-loop steps. Model/session changes, conversation clears, and explicit prompt rebuilds trigger a new preparation pass from the base prompt. If a reset occurs while an extension is responding, the stale preparation is discarded and retried against the current base.
Subscribed extensions can see and replace every system instruction, including private context-file content. This does not alter tool permissions. See Extensions for the protocol, Go SDK hook, timeout behavior, and size limits.