Configuration
Start with one working model connection, then add only the settings you need. ZettCode reads ~/.zettcode/config.toml at startup. You do not need to create every section: omitted optional settings keep their defaults.
This page uses DeepSeek as a concrete example. By default ZettCode connects through the OpenAI-compatible API; an entry that sets anthropic = true uses Anthropic's Messages API instead. Either way there is no provider setting.
Files and when they apply
| File | Purpose | When a change takes effect |
|---|---|---|
~/.zettcode/config.toml | Model connections and optional features | Restart ZettCode. |
~/.zettcode/.ztrc | Extra command-line arguments, one per line | Read on the next start. |
~/.zettcode/plugin-cli.json | Cache of plugin command-line declarations | Filled in the background; commands that end immediately (prompt, doctor, --dry-run, daemon spawn) fill it synchronously. Used from the next start. |
~/.zettcode/theme.toml | One set of custom colours, laid over the palette in force | Restart; /theme selects a palette during a run. |
~/.zettcode/themes/<name>.toml | Your own palettes, picked by name | Picked up the next time /theme is used. |
~/.zettcode/mcp.json | External tool servers | Restart after changing server definitions. |
AGENTS.md in or above the workspace | Project rules and test commands | Read again for the next request. |
~ means your home directory. On Windows this is normally C:\Users\<your-name>. The workspace is separate from configuration: start with zettcode -w /path/to/project, or run zettcode from the project directory.
~/.zettcode/.ztrc presets command-line arguments: one argument per non-blank line, read before the reader's own, so a later command-line word wins. Blank lines and lines starting with # are ignored. Only options belong here; a line the parser reads as a command makes the file ignored rather than making the reader's own command a second positional. --full can be turned back off with --no-full. This is a place for a plugin or a wrapper to set a flag you always want; plugin-declared options are presets here too. It is not a shell script — quotes are not interpreted, and a path with spaces stays on one line as one argument. It applies to a session start; daemon, broker, gateway and plugin are routed before the session parser, so the file does not affect them.
To try a different configuration without replacing your normal file:
ZETTCODE_CONFIG="$HOME/.zettcode/deepseek.toml" zettcode -w /path/to/project$env:ZETTCODE_CONFIG = "$HOME/.zettcode/deepseek.toml"
zettcode -w C:\projects\api
# Remove the override when finished.
Remove-Item Env:ZETTCODE_CONFIGThe selected file replaces the default config; the two are not merged. Relative workspace paths resolve from the directory where you launch ZettCode.
Models
An entry is one connection, and the file holds as many as you have. /model lists them for the conversation you are in — where each came from, the API it speaks, whether it takes images — and /model <name> switches without opening the list:
Adding models with /config
You do not have to edit the file to add a model. /config opens a panel over the conversation:
Models
~/.zettcode/config.toml
▸ 1. DeepSeek Pro (current) deepseek-v4-pro · chat · https://api.deepseek.com
2. DeepSeek Flash deepseek-flash · chat · https://api.deepseek.com
+ Add a model choose the API, then the modelAdd a model asks which API the endpoint speaks — chat for chat completions, responses for the Responses API, anthropic for the Messages API — and then shows the form below. Nothing else is known in advance: the address is optional, and leaving it empty uses the API's own. Plugin-provided models appear in /model and are not added here; see Plugins.
A model is added on one form, not a question at a time:
Every line is a box with its label on the top border, bright green while the cursor is in it, so it reads as something to type into; a click anywhere on a box, its border included, puts the cursor there. The form needs about 32 rows; on a terminal too short for that, the lines are drawn one row each instead, the text on a band of its own, and work the same.
Tab (or ↓) moves to the next line and Shift-Tab (or ↑) to the previous one, going round at the ends; Enter saves all of it; a hint under the form explains the line the cursor is in. Only the model id is required. The token may be empty: a local server (Ollama, LM Studio, vLLM) wants none, and the environment's OPENAI_API_KEY is used when there is one. A line that cannot be saved — an address that is not http or https, a temperature out of range — is named above the form, the cursor goes to it, and everything you typed stays.
The token is typed as bullets and never shown again — not in the panel, not in /config list, not in the line that says the model was added. Escape goes back one step: from the form to the list of APIs, from the list to the models, and only from the models panel does it close. Nothing is written until you press Enter on the form, so going back never costs anything.
Choose a model in the panel and every setting of it is on one page, the name on the left and its value on the right:
GPT-4o
› Token unchanged
API ◉ chat ○ responses ○ anthropic
Address https://proxy.example.com/v1
Model id * gpt-4o
Shown name GPT-4o
Images ●───────── text only
Web search ━━━━━━━━━● on
Search tool the default: web_search
Temperature the provider's default
Context window 128,000 tokens
Compress at 80 (% of the window)
Use this model save any change, then switch to it now
Remove delete it from the fileWhat is typed is a line to type in; Images and Web search are the same sliding switch as in /statusline (← / → or Space turns it over); API is a choice among chat, responses and anthropic, with the chosen one marked (← / → moves it). ↑ / ↓ (or Tab) move between rows, going round at the ends, and a click puts the cursor in a row. A line under the page explains the row you are on.
Enter saves every row at once and closes the page; Escape closes it and writes nothing. Only what you changed is written — a row you left alone keeps the way the file spells it — and an empty row removes its key, so the default applies. The token row starts empty because the current token is never shown: leave it empty to keep it. A row that cannot be saved (an address that is not http or https, a window under 1,000 tokens, web search on DeepSeek's chat endpoint) is named under the title and the cursor goes to it; everything you typed stays.
The two rows at the bottom are things to do: Use this model saves what you changed and switches to the model, and Remove deletes it (it asks first, and Keep it is the answer Enter gives). On a screen too short for every row the page scrolls to keep the row you are on in view.
Some rows are about what the model can carry, and each takes effect in the running session at once:
| Row | What it sets | How to write it |
|---|---|---|
| Images | Whether the model accepts images (multimodal). Off, a picture is refused here and the model reads files with read_file, which returns text only, instead of read. | A switch; it starts on the current answer. |
| Web search | Whether the provider searches the web for the model (web_search); Search tool is the exact tool type it is sent as (web_search_name). See Web search. | A switch, and a line to type the type in; empty takes the default for the API. |
| Context window | How many tokens the model can carry (context_window), which /context measures against. | 128000, 128,000, 128k, 1m or 1.5m. Under 1,000 is refused, because it is nearly always a window written in thousands — write 200k. Empty uses 128,000. |
| Compress at | The share of the window at which the conversation is summarized before the next request (compact_percent). | A percentage above 0 and up to 100: 80 or 80%. Empty uses 80. |
The window and the share together decide when compaction happens — at 200k and 75% that is 150,000 tokens — and the panel says what they come to when you set them. The add form offers these too: Images and Web search are switches already on the default — ← / → or Space turns one over — and Context window and Compress at show their defaults as placeholders. Leave a line alone to keep it, or set it here afterwards (--context and --compact do the same on one line).
The same thing on one line, asking only for what the line leaves out:
/config add --model deepseek-chat --token sk-... --url https://api.deepseek.com
/config add --api chat --url https://llm.example/v1 --model my-model --token sk-... --name "My model"
/config add --api anthropic --model claude-sonnet-4-5 # opens the form for the rest
/config remove 3 # or the name: /config remove "My model"
/config add --api chat --url https://llm.example/v1 --model big --token sk-... --context 1m --compact 60
/config list # the models, what they take and where they compress, never a token| Option | Meaning |
|---|---|
--model ID | The model id the endpoint calls it. |
--token KEY | The credential. Left out, the form has a hidden token line, which may stay empty. |
--url URL | The address. Left out, the API's own is used. |
--api chat|responses|anthropic | Which API; a line that names none means chat completions. |
--name SHOWN | The name in the header and /model (display_model). |
--multimodal | The model accepts images. |
--context TOKENS | The context window: 200000, 200k, 1m. |
--compact PERCENT | Summarize at this share of the window: 75 or 75%. |
--temperature T | The sampling temperature, from 0 to 2 (0 to 1 for anthropic). |
--web-search | Let the provider search the web for the model; refused for DeepSeek unless the API is anthropic. |
--search-tool TYPE | The tool type the search is sent as (implies --web-search); left out, the API's default. |
Prefer the panel for a token
A line you type stays in the composer's in-memory history, so pressing Up shows it again until you quit. Leave --token off and type the token into the hidden prompt instead.
What /config does to the file:
- It changes only the
[[models]]entries. Your comments, other tables, and layout stay exactly as written, and the result is checked before it is saved: if it would not hold exactly the models meant, or would change anything else, nothing is written. - A model you add is available at once — no restart. Adding is not choosing: the model in use stays. Removing the one in use switches to its neighbour and says so.
- The file keeps its permissions. A new file is created readable by you alone, since it holds keys.
/configreads the file each time, so models you added by hand since starting show up in it.- Comments inside a model you edit are not kept (those above it and everywhere else are).
- A file that writes its models another way — an inline
models = [ … ]array — is left alone with a message to edit it by hand, and the last remaining model cannot be removed.
A working DeepSeek example
Create an API key on the DeepSeek platform. Create ~/.zettcode/ if it does not exist, and save this as config.toml:
[[models]]
model = "deepseek-v4-pro" # API model id, not a friendly label
display_model = "DeepSeek Pro" # name in the header and /model picker
token = "sk-..." # replace with your DeepSeek API key
base_url = "https://api.deepseek.com" # API root, not the chat website
responses_api = false # Chat Completions, not /responses
multimodal = false # Pro is text-only
context_window = 1000000 # token limit; check the endpoint's reference
compact_percent = 80 # summarize at 80% of that limitThe example follows DeepSeek's current model reference. Model ids, context limits, and image support can change; a third-party gateway may expose different limits. Use the values your actual endpoint publishes. Setting a larger window here does not make the remote model accept more tokens.
Keep credentials private
sk-... is a placeholder. Never commit your real key to Git or include it in a screenshot, exported conversation, or bug report. A chat subscription or login is not an API key. On macOS/Linux you can restrict file access with chmod 600 ~/.zettcode/config.toml.
Every model key
| Key | Type | Default | What to put here |
|---|---|---|---|
model | string | Required | Exact model id accepted by the API, such as deepseek-v4-pro. Non-empty; the only key a model has to have. |
display_model | string | Model id | Your readable label, such as DeepSeek Pro. It is not sent as the model id. This is the name /model takes and a session records, so no two entries may be shown by one name — including an id that stands in as another entry's name. A file with a shared name is refused when it is read, saying which name it is. |
token | string | OPENAI_API_KEY, else none | API key for this endpoint. A non-empty file value takes precedence over the environment. An anthropic entry reads ANTHROPIC_API_KEY instead. May be left out: a local server (Ollama, LM Studio, vLLM) wants no key, and the model is called without one. A server that does want one answers 401. |
base_url | string | The vendor's address | Where the client appends its route. Set it explicitly for DeepSeek or another non-OpenAI endpoint. Defaults to https://api.openai.com/v1, or to https://api.anthropic.com for an anthropic entry. |
anthropic | boolean | false | true calls Anthropic's Messages API instead of an OpenAI-compatible one. Cannot be combined with responses_api or chat. |
responses_api | boolean | false | false uses Chat Completions; true uses Responses. Choose a protocol the endpoint supports. Not available for an anthropic entry. |
chat | boolean | false | true says outright that the endpoint speaks Chat Completions, which is what an entry with neither of the other two already does. It is for the reader of the file; it cannot be combined with anthropic or responses_api. |
temperature | number | the provider's own | Sampling temperature sent with every request, from 0 (the most deterministic) to 2; an anthropic entry stops at 1. Left out, none is sent. Some reasoning models reject a temperature, so set it only for a model that takes one. |
multimodal | boolean | false | Enable only for a model and endpoint that accept image input. |
web_search | boolean | false | Let the provider search the web for this model. The endpoint runs the search; ZettCode fetches nothing. DeepSeek is accepted only with anthropic = true. See Web search. |
web_search_name | string | the API's own | The exact tool type the endpoint expects for that search, for a provider that names it differently. Left out, the default for the API is sent. |
context_window | integer | 128000 | Positive context-window size in tokens, not characters or the output limit. |
compact_percent | number | 80 | Automatic compaction threshold: greater than 0, at most 100. Decimals such as 75.5 are allowed. |
max_tokens | integer | 64000 | Tokens one reply may spend: the output budget the request carries (max_tokens, or max_output_tokens on the Responses API). It is what a long answer runs out of — the reply then stops mid-sentence and says the provider said max_tokens. 0 sends no budget at all and leaves the endpoint's own default in force, which is the escape for a provider that refuses one. See How long one reply may be. |
reasoning_efforts | array of strings | every level | The reasoning levels this model accepts, from off, minimal, low, medium, high, xhigh, max, ultra. List them when the endpoint rejects the rest; see Reasoning levels a model takes. |
base_url is where the client appends its route — /chat/completions, /responses, or /v1/messages for an anthropic entry — so the route is not part of it. Writing the route out is a common reading, so an entry that ends with one has just that part removed: either way the request reaches …/v1/messages once, not twice. What precedes the route is kept as written, so a gateway that serves the API under a prefix keeps that prefix. DeepSeek's example does not need /v1; other services often do. Copy the address your provider calls the API root rather than guessing from its website URL.
When multimodal is false, image submission is refused locally with an error, and the model reads files with read_file, which returns text only, in place of read, which also returns pictures. Setting it to true does not add vision to a text-only model. See Pictures and pastes.
Web search
web_search = true on a model entry lets the provider search the web for it. The search is hosted: the endpoint runs it and the model answers from the results, so ZettCode fetches nothing itself and needs no search key. What the endpoint calls the tool differs by API, so each has a default and an entry can override it with web_search_name:
| The entry speaks | Sent as by default |
|---|---|
| Chat Completions or the Responses API | web_search |
Anthropic's Messages API (anthropic = true) | web_search_20260318 |
| DeepSeek over its Anthropic-compatible endpoint | web_search_20250305 |
[[models]]
model = "claude-sonnet-4-5"
anthropic = true
web_search = true
[[models]]
model = "deepseek-v4-flash"
base_url = "https://api.deepseek.com/anthropic"
anthropic = true
web_search = true
web_search_name = "web_search_20250305" # optional: this is already its defaultDeepSeek is searched only over its Anthropic-compatible endpoint. An entry with web_search = true on a DeepSeek model (its id or its address says so) that is not anthropic = true is refused with that reason when the file is read, when you add it with /config, and over the server's HTTP API. The setting follows the model in use, so /model takes effect on the next request.
A gateway may serve a search its vendor does not, so nothing else is refused up front: if the endpoint does not know the tool type, the request fails with its own message, and web_search_name is how you give it the one it does.
A search is answered inside the endpoint's own reply, and it sometimes ends without a result — the provider closes the reply before the tool reports one, as Anthropic does when a search loop reaches its limit. That call is shown as The provider did not report what this call returned, and its row is not marked completed: the call ended without a result, and the answer above it says whatever the model made of it. The row belongs to the live run only: the provider's block cannot be stored, because the next request would be refused for a call with no result, so a reopened session shows the answer alone.
Reasoning levels a model takes
Not every endpoint accepts every reasoning level, and an unsupported one can fail the whole request. An entry names the levels its model takes:
[[models]]
model = "deepseek-v4-pro"
token = "sk-..."
base_url = "https://api.deepseek.com"
context_window = 1000000
compact_percent = 80
reasoning_efforts = ["low", "high", "max"]Leave the key out and every level is offered. When it is set:
/effortshows only those levels, and typing another (/effort ultra) is refused with the list the model does take, so nothing changes without your noticing.- Switching models with
/modelmoves the level in force to the nearest one the new model takes, so a request is never sent with a level its endpoint would reject. Switching back does not restore it. - A subagent (the
tasktool) runs on the model of the request that started it, at its profile's default level (explorelow,codingmedium,reasoninghigh) moved to the nearest the model takes. The model can also passreasoning_effortto thetasktool to choose how hard that child thinks; only the levels this model takes are offered to it.
A tie between two levels goes to the cheaper one.
How long one reply may be
A reply is cut off when it reaches the endpoint's output limit, and the limit is the endpoint's own unless the request names one: several thousand tokens on most chat services, which is a fraction of what a long patch, a whole file or a careful review needs. ZettCode sends one for every model, and max_tokens says how large it is:
[[models]]
model = "gpt-5"
token = "sk-..."
max_tokens = 32000The default is 64,000 tokens. When a reply stops at the limit, the conversation says so in one line — The reply reached the model's output limit and is cut off, with what the provider said — and /continue asks the model to carry on from there.
- It is the output budget: it bounds one reply, not the conversation.
context_windowbounds what the model carries, and the two are separate — a budget larger than the window is sent as the window, because a reply longer than the context that has to hold it is not a request any endpoint can serve. The entry keeps the number you wrote; only what goes out is bounded. The budget shares that window with the prompt: a value close to the window leaves nothing for the conversation, and the endpoint will refuse the request even though the budget is under it. - The field the budget travels in is the endpoint's, not ours:
max_tokenson Anthropic's Messages API and on the OpenAI-compatible services (DeepSeek, GLM, a local server),max_completion_tokenson OpenAI's own address, which its reasoning models demand, andmax_output_tokenson the Responses API. - The budget is spent by reasoning as well as by text on models that count thinking towards it, so a model that reasons at
ultrawith 8,000 tokens of budget gives the answer whatever is left. 0sends no budget and leaves the endpoint's own default in force, for a service that refuses one or counts the prompt against it. An endpoint that rejects a budget larger than its own limit answers with an error naming that limit, and lowering this number is the fix.
What a child agent can do
The task tool starts a child with its own context and session log. There are three kinds, and they are not equally capable on purpose:
| Child | Tools |
|---|---|
explore | read, glob, grep. It only reads. |
reasoning | None. It reasons from what the task says. |
coding | The same as the main agent: read, write_file, edit, bash, and your skills and MCP servers. |
The coding child has everything the main agent has except task (a child cannot start another child), the just-in-time harness, ask_user (it works through its task and does not interrupt you; whatever it needs has to be in the task the parent writes), todo_write (its plan would be drawn for nobody), and list_sessions / send_message. Set subagent_messaging = true under [harness] to give it the last two. It also has no glob or grep, for the same reason the main agent has none: it searches with rg, grep and find in its shell.
Its shell is under your permission level, exactly as the main agent's is. At ask, a command the child wants to run is put to you in the same panel, and the answer goes back to the child; at safe it runs in the sandbox; at full it runs; at deny it is refused. /permission applies to a child already working, from its next command.
Anthropic models
anthropic = true calls Anthropic's Messages API rather than an OpenAI-compatible one. Everything else about an entry works the same, and the /model picker names the API each row speaks:
[[models]]
model = "claude-sonnet-4-5" # API model id, not a friendly label
display_model = "Claude Sonnet 4.5" # name in the header and /model picker
token = "sk-ant-..." # replace with your Anthropic API key
anthropic = true # Messages API, through Anthropic's SDK
# base_url = "https://api.anthropic.com" # uncomment for a gateway or proxy
context_window = 200000 # this model's window; check its model page
compact_percent = 80 # summarize at 80% of that limit
multimodal = true # Claude accepts imagesbase_url defaults to https://api.anthropic.com, and token falls back to ANTHROPIC_API_KEY rather than OPENAI_API_KEY. A gateway that speaks the Messages protocol but lives elsewhere needs its own root here.
anthropic and responses_api are not layers: the Responses API belongs to OpenAI-compatible endpoints, and the Messages API has no such mode. An entry that sets both is refused at startup instead of quietly picking one.
/effort reaches Anthropic as a thinking budget, so medium and above buy reasoning before the answer; off disables it. As with any other model, this window and this key are the endpoint's business, not ZettCode's: it does not verify either before your first request.
Keeping the key out of the file
Remove the token line from the model table, then launch from a terminal with the key in its environment:
export OPENAI_API_KEY="your-deepseek-api-key"
zettcode$env:OPENAI_API_KEY = "your-deepseek-api-key"
zettcodeThe variable is named OPENAI_API_KEY even for DeepSeek. ZettCode does not read DEEPSEEK_API_KEY or expand ${VARIABLE} inside TOML strings; the one entry that reads a differently named variable is an anthropic one, which falls back to ANTHROPIC_API_KEY. An environment variable set this way applies to that terminal and its child processes, not to all future terminal windows. These commands can also enter your shell history; use your usual secret-management method on a shared machine.
If several model entries omit token, they all receive the same environment key. For endpoints with different credentials, give each entry its own token or use separate config files.
Configuring more than one model
Each [[models]] starts a new model entry. Its settings do not inherit from the previous entry, so repeat the endpoint, key, and limits when needed:
[[models]]
model = "deepseek-v4-pro"
display_model = "DeepSeek Pro"
token = "sk-..."
base_url = "https://api.deepseek.com"
context_window = 1000000
compact_percent = 80
multimodal = false
[[models]]
model = "deepseek-flash"
display_model = "DeepSeek Flash"
token = "sk-..."
base_url = "https://api.deepseek.com"
context_window = 1000000
compact_percent = 80
multimodal = trueDeepSeek's current Flash model accepts images; Pro does not. If your gateway does not expose Flash's vision capability, keep multimodal = false there too.
The first entry is selected at startup; when the file lists none, the first model a plugin offers is used instead, so a vendor API key in the environment is enough for the first run. Inside ZettCode, run /model and choose an entry, or type /model DeepSeek Flash. Switching changes later requests; it does not start a new session or interrupt a request already running. Entries added with /config are available at once; after editing the file by hand, restart to load new entries.
Choosing the compaction threshold
For context_window = 1000000 and compact_percent = 80, the automatic trigger is about 800,000 tokens. At 60, it is about 600,000 tokens. A lower threshold leaves more room for a large tool result or the next reply, but may summarize earlier and incur more model calls. 100 leaves no safety margin; it is usually better to keep some room.
These are estimated thresholds, not a guarantee that every request fits: the provider's counting and a large incoming result can differ from the estimate. /compact summarizes immediately when you want to make room yourself. See Models and context for what gets preserved.
Optional features
Complete config with the defaults made explicit
This is a single complete file, not a fragment to append to an existing model entry. Replace the key, then remove sections you do not need. Every optional setting below is at its default value.
[[models]]
model = "deepseek-v4-pro"
display_model = "DeepSeek Pro"
token = "sk-..."
base_url = "https://api.deepseek.com"
anthropic = false # true would call Anthropic's Messages API
responses_api = false
multimodal = false
context_window = 1000000
compact_percent = 80
max_tokens = 64000 # tokens one reply may spend; 0 uses the endpoint's own
[transcript]
max_entries = 1024 # displayed blocks, not terminal lines
mouse_scroll_speed = 1 # rows one wheel event scrolls
tips = true # a small tip under Processing
[agents_md]
enabled = true # use project instructions
[ask_user]
enabled = true # allow the model to ask for your input
[skills]
enabled = true
roots = [] # extra directories before the scope's own
scope = "both" # "both", "workspace" or "global"; see Skills and MCP
[mcp]
enabled = true
config = "~/.zettcode/mcp.json" # server definitions, not this TOML file
scope = "both" # "both", "workspace" or "global"
[compaction]
self = false # let the model compact its own context; /plugins or a session's own choice overrides
[plugins]
enabled = true # load installed third-party plugins
disable = [] # entry-point names to skip
[update]
enabled = true # background PyPI version checks
[ui]
# theme = "nord" # start in a palette by name (see Colours); unset follows the terminal
# pet = "cat" # which pet stands over the conversation (see The pet); unset is the cat
# pet_position = [1.0, 0.5] # where it stands, across and down from 0 to 1; written when you drag it
[statusline]
# Every part of the header and status line is shown. Name one to hide it; /statusline edits these.
# ctx = false
# speed = false
[sessions]
enabled = true # let sessions message each other; `false` joins no broker
[shell]
network = false # let commands run at the `safe` level reach the network; see Approvals
[harness]
subagent = true # offer the `task` tool and its child profiles
subagent_max_iterations = 512 # model calls one child may make for one task
subagent_messaging = false # give the `coding` child list_sessions and send_message too
todowrite = false # offer `todo_write`, which draws the plan panel
jit = true # the model may write and run small Python tools; false turns it off; /pluginsPut these top-level sections outside the model table, as shown. In TOML, keys belong to the most recent table heading; an enabled key immediately under [[models]] would be an invalid model key.
Optional settings reference
| Table / key | Default | Effect and constraints |
|---|---|---|
transcript.max_entries | 1024 | Positive integer. Limits visible conversation blocks; older blocks leave the scrollback, but saved history and model context are not deleted. |
transcript.mouse_scroll_speed | 1 | Rows one mouse-wheel event scrolls the conversation, from just above 0 to 20; a fraction such as 0.5 is a row every second event, and 3 is three rows a notch. Whatever the value, one frame moves the view at most half a screen. |
transcript.tips | true | Show a small tip under the Processing row once a request has run for five seconds. false turns them off. |
agents_md.enabled | true | Read AGENTS.md from the workspace and its ancestors. See Project instructions. |
ask_user.enabled | true | Allow the question panel with single-choice, multiple-choice, and typed answers. false removes that tool; it does not prevent all questions in normal prose. |
skills.enabled | true | Discover skill names/descriptions and allow their instructions to be loaded when needed. |
skills.roots | [] | Array of directory strings. Extra roots are searched in order before the scope's own directories; the first matching skill name wins. |
skills.scope | "both" | Where skills live: "both" (the default) reads <workspace>/.zettcode/skills and ~/.zettcode/skills together, the project's first so its version of a skill wins inside it; "workspace" reads only the project's, "global" only yours. See Skills and MCP. |
mcp.enabled | true | Enable MCP tools when a server config exists. A missing default file means no servers are loaded. |
mcp.config | ~/.zettcode/mcp.json | Path to the user's JSON server configuration. Use an absolute path or ~ to make its location unambiguous. |
mcp.scope | "both" | Which server files to read: "both" (the default) merges the user's file and <workspace>/.zettcode/mcp.json, the project's entry winning a name; "workspace" or "global" reads just one. A workspace file is a command a checkout asks you to run, so set "global" if you do not want a repository's servers started. |
compaction.self | false | Whether a session lets the model compact its own context unless it chose otherwise. /plugins shows it as the self-compaction switch; a session's own choice is set from code or over HTTP. See Self-compaction. |
statusline.<part> | true | Set a part of the header or the status line to false to hide it; every part not named is shown, except pet, turn-calls and turn-tools, which are hidden until you set them to true. The parts are app, session, handle, workspace, model, effort, state, mode, self-compact, tokens, cache, speed, ctx, keys, the items of the line a request ends on (turn-time, turn-clock, turn-tokens, turn-cache, turn-calls, turn-speed, turn-tools; a plugin may add others named turn-<something>) and pet (the small companion over the conversation, see The pet); an unknown name is an error. /statusline edits the table for you. See Choosing what is shown. |
plugins.enabled | true | Load installed third-party plugins. Built-in UI functionality remains available when false. |
plugins.disable | [] | Array of plugin entry-point names to skip, not necessarily their pip package names. |
plugins.enable | [] | Default-off plugin entry-point names to load; a plugin chooses its own default (memory is off). |
update.enabled | true | Check PyPI in the background and offer newer releases on a later start; does not automatically install them. |
sessions.enabled | true | Register with the background session broker so this session can be messaged with @name and can message others; the model gets list_sessions and send_message. See Talking between sessions. |
harness.subagent | true | Offer the task tool, so the model can delegate to a child agent with its own context and session log. |
harness.subagent_max_iterations | 512 | Model calls one child agent may make for one task. A child exploring or editing a real codebase makes dozens (the library's own default of 18 ended such tasks halfway); this is a ceiling against one that never stops, not a target. Children are also given your project's AGENTS.md. |
harness.subagent_messaging | false | Give the coding child list_sessions and send_message as well. Off by default: a child works on one task for one session, and talking to the other sessions is that session's own business. See What a child agent can do. |
harness.todowrite | false | Offer todo_write, whose checklist the shell draws in its plan panel. Keeping a plan costs turns, so it is off unless asked for. |
harness.jit | true | Start with the just-in-time harness on: the model may write small Python tools of its own, keep them in ~/.zettcode/harness/<workspace>/<session id>/, and run them. What it writes runs in a child process of its own — a crash or a hang stays out of the window — and, at every level below full, inside the boundary safe uses, so it is on by default; false starts every run with it off. At full it has your own access; on a machine with no sandbox the harness says so once per session, so the code the model writes is never unbounded without a word. /plugins turns it on or off for the next start; /harness gen turns it on for this run and has the model build tools for the workspace, and /harness reset turns it off for this run, so later requests have none of its tools, and leaves this session's tools where they are. A change that changes the boundary — to or from full — closes that child, the next request starts a new one, and the model's own tools are gone until it runs repo_load again; ask and safe share the same boundary, so moving between them costs nothing. A repository declares itself in a MANIFEST beside its __init__.py — a name, a version, a description, and optionally the tools it declares — and is loadable only with one; a BAN_TOOLS file beside it names tools it may not define. /harness opens a read-only panel with this session's repositories, read from those files without importing anything, so what it shows is the declaration, not what the code defines. |
harness.use | "" | The name of a library harness every session works in instead of its own folder; /harness use writes it. A name with no folder falls back to each session's own. |
shell.network | false | Let a command that runs in the safe sandbox use the network. Off by default; full always has it, and so does a machine with no sandbox. See Approvals. |
Example: keep less scrollback, add project-local skills, and disable remote tool servers for a run configured from this file:
[transcript]
max_entries = 256
[skills]
roots = [".zettcode/skills", "~/team-skills"]
[mcp]
enabled = falseMerge this fragment into your existing file by editing the corresponding sections; do not define the same table twice. The relative skill path resolves against the workspace, so with zettcode -w ~/projects/api it means ~/projects/api/.zettcode/skills.
Colours
Without a choice, ZettCode tries to detect the terminal's background and selects a matching dark or light palette; those two leave the page background to the terminal.
Palettes by name
Every other palette has a name, and the name is a file. Sixteen ship with the program:
| Dark | Light |
|---|---|
catppuccin-mocha, tokyo-night, nord, gruvbox-dark, rose-pine, kanagawa, dracula, one-dark, solarized-dark, github-dimmed, ayu-mirage | catppuccin-latte, rose-pine-dawn, gruvbox-light, solarized-light, github-light |
/theme nord switches to one for the current run. Typing /theme and a space opens the menu of every palette, and the menu previews: as you move the highlight with ↑ ↓ the whole interface, the conversation in front of you included, is repainted in that palette. Enter keeps it; Esc, or deleting the draft, puts back the one you had. These palettes paint their own page background, so they look the same in any terminal. So do dark and light when you pick them by name; only the automatic choice at startup leaves the page to your terminal.
The choice is remembered. /theme nord writes theme = "nord" under [ui] in config.toml (one line; the rest of the file is untouched), so the next start opens in it. Walking the menu with the arrows remembers nothing; only Enter, or typing the name, does. If config.toml cannot take the line (it does not exist, or it spells [ui] in a way that cannot be edited safely) the palette is still switched on, and you are told it will not last.
To start in one, name it in config.toml:
[ui]
theme = "nord"The frame painted before the shell is built is already in that palette, so a light one does not flash dark first. A palette only a plugin offers cannot be named that early; it arrives with the shell, one frame later.
Adding your own
Put a file in ~/.zettcode/themes/ and its name is the palette's name: ~/.zettcode/themes/sunset.toml is /theme sunset, and it is in the menu the next time you open it, with no restart. The file is the same format as theme.toml below, plus an optional one-line description shown beside the name:
description = "warm and low-contrast"
base = "dark" # what any colour you leave out comes from
[ui]
surface_alt = "#3a322b" # leave `background` out to keep the terminal's own page
accent = "#e0a458"A file with the name of a shipped palette replaces it, which is how to adjust one: copy it, change what you dislike, keep the name. dark and light cannot be replaced. A name is one word (letters, digits, ., _, -). A file that cannot be read is still listed, and says why when you pick it.
The shipped palettes are listed with every component drawn in each of them in docs/internal/palettes.html, which make palettes generates. The page is a build product and is not in the repository: regenerate it after changing a palette or the theme code.
One file over any palette
For a persistent custom palette, create ~/.zettcode/theme.toml. This is a separate file: do not paste these sections into config.toml.
base = "dark" # dark or light; defaults to dark
[ui]
accent = "#a7c080"
accent_bright = "#83c092"
surface_side = "#393a44" # background for /btw messages
surface_peer = "#313244" # background for messages between sessions
# background = "#232a2e" # leave commented to use the terminal background
[tools]
read = "#89b4fa"
shell = "#fab387"
web-search = "#89b4fa" # a search the endpoint ran; its own role, spelled with a hyphen
ask-user = "#89b4fa" # a question put to you, which is the one row that waits for a person
[code]
keyword = "#e58fa8"
string = "#9bddad"
comment = "#6d7a70"
number = "#d8b46a"
function = "#7fb7d8"
builtin = "#b8a6e0"
inline = "#9bddad" # Markdown `inline code`Only named colours change; the rest come from base, or from the palette [ui] theme names when there is one (the file is laid over it). A theme file takes precedence over automatic light/dark detection. /theme can still choose a palette during that run; it does not rewrite any file.
| Section | Colour keys |
|---|---|
ui | background, surface, surface_alt, surface_side, surface_peer, text, muted, subtle, accent, accent_bright, warning, error, diff_added, diff_removed, diff_added_fill, diff_removed_fill, diff_added_emphasis_fill, diff_removed_emphasis_fill, border, focus, selection |
tools | read, search, image, write, delete, shell, plan, subagent, message, web-search, ask-user |
code | inline, text, keyword, string, comment, number, function, builtin, operator, punctuator |
diff_added and diff_removed colour the lines of an edit's diff and the +N -M beside a file. Left out, they follow accent and error, so changing those changes the diff too; set them to colour the diff on its own. diff_added_fill and diff_removed_fill are the bands behind those lines; left out, each is its line colour mixed into the page, so the band follows the palette. diff_added_emphasis_fill and diff_removed_emphasis_fill are the deeper bands behind the words a changed line actually rewrote; left out, each is its line colour mixed further into its band, so the words a one-word change rewrote stand out from the rest of the line. A marked word keeps the colour of its line and the mark adds no weight of its own, so the band is the whole of the mark: a band set to the line colour itself leaves no room for it to go deeper, and the words stop being marked.
Colours use quoted six-digit hex strings such as "#83c092". Do not use "green", three-digit hex, or the TOML string "None" for transparency; omit background to keep the terminal's background. Check both text and background contrast after changing a surface colour.
Environment
| Variable | Effect |
|---|---|
ZETTCODE_CONFIG | Select a different complete config file. |
OPENAI_API_KEY | Key for model entries without a non-empty token. |
ANTHROPIC_API_KEY | Key for anthropic entries without a non-empty token. |
TIKTOKEN_CACHE_DIR | Where the token counter keeps the vocabulary it downloads once. Defaults to ~/.zettcode/cache/tiktoken; the OS temp directory would be emptied sooner or later, and refilling it takes seconds. |
ZETTCODE_REDUCED_MOTION | Set to 1 to suppress decorative sweep motion. |
ZETTCODE_BROKER_DIR | Where the session broker keeps its files. Defaults to ~/.zettcode/broker. |
ZETTCODE_BROKER_IDLE | Seconds the broker stays after the last session leaves. Defaults to 30. |
HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY | Standard proxy settings used by the model's HTTP client. |
Session storage stays in ~/.zettcode/sessions, grouped by workspace. Do not add store, session, provider, theme, or reasoning_effort to this config: they are not supported keys. Use -r or /resume for a session, /effort for reasoning, and theme.toml for colours.
Checking the connection
Config validation checks spelling, types, and required values at startup. It does not contact the API to verify a key or model id. The model connection is created when you first use it, so zettcode --dry-run is not an API health check.
If your first message fails:
- Confirm the selected
modelis an id your endpoint offers. - Check
base_urlagainst the provider's API example, including whether it requires/v1. - Check the key belongs to that endpoint and the account has API access/balance.
- Check the chosen API protocol and image support match the endpoint.
To test DeepSeek outside the TUI, set OPENAI_API_KEY as above, then run:
curl https://api.deepseek.com/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{"model":"deepseek-v4-pro","messages":[{"role":"user","content":"Reply with OK."}]}'$headers = @{ Authorization = "Bearer $env:OPENAI_API_KEY" }
$body = @{
model = "deepseek-v4-pro"
messages = @(@{ role = "user"; content = "Reply with OK." })
} | ConvertTo-Json -Depth 5
Invoke-RestMethod -Uri "https://api.deepseek.com/chat/completions" `
-Method Post -Headers $headers -ContentType "application/json" -Body $bodyThis sends a small, billable API request. Do not post the authorization header or your shell history in an issue.
Common configuration mistakes
| Symptom | What to check |
|---|---|
No models configured | Add a [[models]] entry, or set a vendor key the models plugin can use (OPENAI_API_KEY, ANTHROPIC_API_KEY, DEEPSEEK_API_KEY, ZAI_API_KEY). The terminal starts either way and /config writes the first; a machine with neither refuses a request with this sentence. |
Missing token for model ... | Supply token, or set the variable of that API in the launching terminal: OPENAI_API_KEY, or ANTHROPIC_API_KEY for an anthropic entry. A placeholder is non-empty and only fails later at the API. |
Unknown config keys ... | Use only the keys listed here. For example, model_name should be model. |
must be bool / must be int | Use true, not "true"; use 1000000, not "1000000". |
Invalid config file ... | Check quotes, table headings, and duplicate keys. TOML syntax errors include parser location information. |
cannot use both APIs | An entry set anthropic and responses_api. Keep one: they are different protocols, not two halves of one. |
HTTP 401 / HTTP 403 in an error | The server refused the token. Check token for that entry, or the variable of its API. The message the server gave is shown after the status. |
HTTP 404 in an error | The model id or the address is wrong for that endpoint. Check model and base_url. |
HTTP 429 / HTTP 5xx in an error | The provider is limiting or failing, not ZettCode. The request was already retried a few times before it was reported. |
Processing with nothing from the model for … | The model has said nothing for a while. A long silence from a reasoning model is normal; press Esc to stop if it is not. |
| API rejects the model or protocol | Check the endpoint's supported model ids and its protocol: responses_api, or anthropic for the Messages API. The UI label is not the API id. |
| Image input is refused | Select a vision-capable model and enable multimodal only for that entry. |
Restart after correcting config.toml. For session, display, and MCP problems, continue with Problems and questions.