Configuration Reference
This page records current fields, defaults, and override rules. Configuration examples do not recommend committing secrets: an env object containing credentials belongs only in protected, ignored locations and remains subordinate to genuinely exported environment variables.
Configuration Reference
Section titled “Configuration Reference”Complete example
Section titled “Complete example”{ "language": "zh", "provider": "openai", "model": "gpt-5-mini", "approvalModel": "gpt-5-mini", "approvalStrictness": "medium", "maxSteps": 80, "contextWindow": 128000, "reservedOutputTokens": 8192, "safetyMargin": 4096, "thinkingLevel": "default", "plugins": [], "env": { "CODEN_OPENAI_API_KEY": "sk-..." }, "hooks": {}}Field table
Section titled “Field table”| Field | Type | Default | Meaning |
|---|---|---|---|
language |
"zh" | "en" |
zh |
user scope only; ignored at project scope |
provider |
"openai" | "anthropic" |
openai |
model provider |
model |
non-empty string | gpt-5-mini |
model identifier |
approvalModel |
non-empty string | falls back to model |
Smart Approval review model |
approvalStrictness |
"soft" | "medium" | "hard" |
medium |
review conservativeness |
maxSteps |
positive integer | 80 |
maximum model steps |
contextWindow |
positive integer | 128000 |
context window |
reservedOutputTokens |
positive integer | 8192 |
per-request output budget |
safetyMargin |
non-negative integer | 4096 |
input-budget safety margin |
thinkingLevel |
one of six levels | default |
thinking level |
plugins |
string array | [] |
additional local plugin paths/directories; three sources concatenated |
env |
string map | {} |
variables injected into the process environment |
hooks |
event map | {} |
hook config; user + project scopes merged |
Validation rules
Section titled “Validation rules”contextWindow,reservedOutputTokens, andsafetyMarginmust be non-negative integers; the first two must be positive.contextWindowmust exceedreservedOutputTokens + safetyMargin.modelandapprovalModelmust be non-empty strings;maxStepsmust be a positive integer.envvalues must be strings;pluginselements must be strings.thinkingLevelmust be one ofdefault/off/minimal/low/medium/high.- Anthropic with an enabled thinking level requires
reservedOutputTokens > 1024.
Non-configurable field
Section titled “Non-configurable field”dataDir(data directory) does not come from config: it is derived fromXDG_DATA_HOME, defaulting to~/.local/share/coden.- Session IDs, workspace hashes, and interface modes are decided at runtime.
Related references
Section titled “Related references”Configuration Reference
Section titled “Configuration Reference”Config file locations
Section titled “Config file locations”| Scope | Path | Loaded |
|---|---|---|
| user | ~/.config/coden/config.json (overridable via $XDG_CONFIG_HOME) |
at startup |
| project | <workspace>/.coden/config.json |
at startup (project overrides user, except language) |
Five-layer override (high → low)
Section titled “Five-layer override (high → low)”- CLI flags
CODEN_*environment variables- project config
- user config
- defaults
Exceptions: language reads the user scope plus --lang; plugins concatenates three sources; env merges project-over-user without overwriting shell exports; hooks merge user-first.
Minimal config
Section titled “Minimal config”{ "provider": "openai", "model": "gpt-5-mini", "env": { "CODEN_OPENAI_API_KEY": "sk-..." }}Full fields
Section titled “Full fields”Types, defaults, and validation are in the configuration field reference. Behavior deep dives:
| Topic | Page |
|---|---|
| override order and merging | Precedence |
| scopes and trust | User and Project Scopes |
| environment variables and credentials | Environment Variables, OpenAI Configuration, Anthropic Configuration |
| language and thinking | Language and Thinking Levels |
| data security | Data Security |
Thinking-level notes
Section titled “Thinking-level notes”- Levels:
default(sends no parameter),off,minimal,low,medium,high. - OpenAI maps to
reasoning_effort(off→minimal); Anthropic maps to thinking budgets (1024 / 25% / 50% / 75%, requiringreservedOutputTokens > 1024). - Main-agent requests only; compaction and Smart Approval are unaffected.