# Settings

> The keys of zelk's config.json and a project's .zelk/settings.json.

{/* Generated from Defaults and the project settings file in cmd/zelk/internal/host (TestReferenceSettings). Don't edit: change the code, then run make reference. */}

Settings are the run options you keep for every launch, so you don't give the same flags each time. The terminal UI's Settings saves them, or you write them yourself in `$XDG_CONFIG_HOME/zelk/config.json` (`~/.config/zelk/config.json`):

```json
{"sandbox": "bwrap", "network": "off", "deny": ["Bash(rm *)"], "max_turns": 50}
```

zelk writes the file readable by you alone, on Windows too, where it names only your account in the file's ACL. A flag given on the command line wins over its setting for that launch. A key zelk doesn't know is an error, so a typo is never silently ignored. Settings are read only from your own configuration directory, never from a repository, because they include permission rules. An administrator's [managed policy](/internals/managed-policy/) can limit what they may choose.

## Keys

Each key stands in for a flag; the description is the flag's own.

| Key | Type | Flag | Description |
|---|---|---|---|
| `search_model` | string | `-search-model` | model for native WebSearch (default: fast model for the provider family) |
| `effort` | string | `-effort` | reasoning effort: low, medium or high (default the model's) |
| `reviewer_effort` | string | `-reviewer-effort` | the auto-mode reviewer's reasoning effort: low, medium or high (default none: the model's own) |
| `max_turns` | number | `-max-turns` | the most model turns a run may take (0: no limit) (default `250`) |
| `bash` | string | `-bash` | the bash to run commands with; on Windows the default is the bash.exe of Git for Windows, and a path here replaces it and, unless -powershell is given too, turns PowerShell off. MXC does not support -bash (default `/bin/bash`) |
| `powershell` | boolean | `-no-powershell` | On unless `false`, which does what the flag does: on Windows, run commands in Git Bash only, without the PowerShell tool. Unavailable with MXC |
| `sandbox` | string | `-sandbox` | the launcher that confines commands: none, bwrap (Linux), seatbelt (macOS) or mxc (Windows, set up with zelk sandbox setup). An unattended auto-mode run defaults to bwrap on Linux and uses mxc on Windows when set up (default `none`) |
| `network` | string | `-network` | network for sandboxed commands and, under a sandbox, the web tools and HTTP MCP servers: off, full or allowlist (default off under a sandbox) |
| `network_allow` | list of strings | `-network-allow` | allowed domain[:port] or \*.domain[:port] for bwrap or mxc subprocesses (repeatable; selects allowlist) |
| `sandbox_read_only` | list of strings | `-sandbox-read-only` | a host path bwrap shows sandboxed commands read-only, beside the toolchains it finds; ~/ for the home directory, whose credential files stay hidden (repeatable) |
| `env` | list of strings | `-env` | a variable to pass to commands, besides the base set (repeatable) |
| `allow` | list of strings | `-allow` | an allow rule, such as 'Bash(npm test \*)' (repeatable) |
| `ask` | list of strings | `-ask` | an ask rule (repeatable) |
| `deny` | list of strings | `-deny` | a deny rule, such as 'Bash(rm \*)' (repeatable) |
| `human` | list of strings | `-human` | a rule only a human may approve, such as 'Bash(git push \*)' (repeatable) |
| `protect` | list of strings | `-protect` | an extra protected path pattern (repeatable) |
| `memory` | boolean | `-no-memory` | On unless `false`, which does what the flag does: run without cross-conversation memory (notes kept under the state directory's memory/) |
| `deferred_tools` | boolean | `-no-deferred-tools` | On unless `false`, which does what the flag does: keep all MCP schemas directly visible |
| `deferred_tool_tokens` | number | `-deferred-tool-tokens` | MCP schema token estimate threshold for ToolSearch/CallTool (0: 10% of known context window) |
| `context_window` | number | `-context-window` | the context window, in tokens, of a model whose provider reports none, as OpenAI's API and OpenCode don't: with it sessions compact before a prompt is refused as too long (0: unknown) |
| `scheduling` | boolean | `-scheduling` | offer user-authorized scheduling tools: one-shot and recurring messages into the conversation, while it is open |
| `cache` | string | `-cache` | prompt caching for the openai-compat provider: on, off, or auto (on for Claude models, which cache only on request) (default `auto`) |
| `skill_cache` | string | `-skill-cache` | publish recorded skill scripts in an existing private workspace-relative cache (requires bwrap, seatbelt or mxc) |
| `checkpoints` | boolean | `-checkpoints` | keep checkpoints: the old version of each file the agent edits, so the rewind menu can restore code (new sessions) (default `true`) |
| `language_servers` | boolean | `-lsp` | check each file the agent edits with the language server for it found on PATH (gopls, typescript-language-server, basedpyright or pyright, rust-analyzer, clangd, lua-language-server, yaml-language-server), and tell it the errors (default `true`) |
| `cleanup_days` | number | `-cleanup-days` | remove sessions idle for longer than this many days, with their checkpoints, at least 1 (default `30`) |
| `otel` | boolean | `-otel` | export traces and metrics over OTLP; the standard OTEL\_EXPORTER\_OTLP\_\* variables say where and how |
| `otel_capture` | list of strings | `-otel-capture` | content -otel records on spans: prompts, tool-inputs, tool-outputs or provider-bodies (comma-separated or repeatable) |
| `browser` | boolean | `-browser` | give the agent a headless Chrome of its own (set it up with zelk browser setup), one per session; under -sandbox bwrap, seatbelt or mxc it runs in the sandbox with the commands' network |
| `browser_local` | string | `-browser-local` | ports on this machine's loopback, as 3000,5173, that the sandboxed browser may reach though its network is off or allowlisted: a dev server's (requires -browser and -sandbox bwrap or seatbelt) |
| `user_browser` | boolean | `-user-browser` | give the agent your own browser (Chrome, Brave or Edge), signed in as you, through zelk's extension: it works only in tabs you share or it opens, acts without asking only in tabs you trusted, and never types passwords (set it up with zelk browser extension, then zelk browser pair, or pair in the terminal UI's Settings) |
| `user_browser_pace` | string | `-user-browser-pace` | how input goes in your browser: person (a pointer that travels, keys a tenth of a second apart, pauses between actions, as yours would) or fast (at once) (default `person`) |
| `credential_store` | string | `-credential-store` | where new credentials are kept: file, in zelk's config directory, or keychain, the system's (the Secret Service on Linux, the login keychain on macOS, the Credential Manager on Windows); credentials already kept stay where they are until zelk credentials move (default `file`) |

## status_line

The terminal UI's status line: a command whose output shows above the footer, fed the session's state as JSON on standard input. No flag sets it.

| Key | Type | Description |
|---|---|---|
| `type` | string | `command`, the one kind; leaving it out means the same. |
| `command` | string | The command to run, with the session's state as JSON on its standard input. Required. |
| `padding` | number | How many columns its lines are indented by, from 0 to 20. |
| `refresh_interval` | number | Run it again this often, in seconds, as well as when the session changes. 0 runs it only then. |
| `timeout` | number | How long, in seconds, one run may take before it is stopped, up to 60. 0 means 5. |

## Project settings

A repository can carry permission rules in `.zelk/settings.json`, with these keys only. Its deny, ask and human rules and its protected paths only narrow what zelk may do, so they apply at once. Its allow rules widen it, so they apply only once you trust that exact file.

| Key | Type |
|---|---|
| `allow` | list of strings |
| `ask` | list of strings |
| `deny` | list of strings |
| `human` | list of strings |
| `protect` | list of strings |
