Skip to content

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.

{
"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 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
  • contextWindow, reservedOutputTokens, and safetyMargin must be non-negative integers; the first two must be positive.
  • contextWindow must exceed reservedOutputTokens + safetyMargin.
  • model and approvalModel must be non-empty strings; maxSteps must be a positive integer.
  • env values must be strings; plugins elements must be strings.
  • thinkingLevel must be one of default/off/minimal/low/medium/high.
  • Anthropic with an enabled thinking level requires reservedOutputTokens > 1024.
  • dataDir (data directory) does not come from config: it is derived from XDG_DATA_HOME, defaulting to ~/.local/share/coden.
  • Session IDs, workspace hashes, and interface modes are decided at runtime.
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)
  1. CLI flags
  2. CODEN_* environment variables
  3. project config
  4. user config
  5. 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.

{
"provider": "openai",
"model": "gpt-5-mini",
"env": {
"CODEN_OPENAI_API_KEY": "sk-..."
}
}

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
  • 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%, requiring reservedOutputTokens > 1024).
  • Main-agent requests only; compaction and Smart Approval are unaffected.