Skip to content

Config Schema

The runtime primarily reads v1 config fields and adapts them into the core v2 config layer. Prefer swust-code.jsonc or .swust-code/swust-code.jsonc for user configuration.

Common Fields

FieldTypeDescription
$schemastringEditor completion URL, currently written as https://opencode.ai/config.json
modelstringDefault model in provider/model format
small_modelstringSmaller model for title generation and light tasks
default_agentstringDefault primary agent
usernamestringDisplayed username
permissionstring or objectTool permission rules
agentobjectAgent configuration
providerobjectCustom providers and model overrides
mcpobjectMCP server configuration
commandobjectCustom slash commands
skillsobjectCLI/TUI v1 skill sources, shaped as { paths, urls }
instructionsstring[]Additional instruction files or globs
pluginarrayExternal plugins
formatterboolean or objectFormatter configuration
lspboolean or objectLSP configuration
tool_outputobjectTool output truncation thresholds
compactionobjectContext compaction behavior
sharemanual, auto, disabledSession sharing policy

Permissions

json
{
  "permission": {
    "bash": "ask",
    "edit": "allow",
    "read": "allow",
    "external_directory": {
      "*": "ask"
    },
    "doom_loop": "ask"
  }
}

Permission values are allow, ask, and deny. A field can be a direct string or an object keyed by resource pattern.

Agents

json
{
  "default_agent": "build",
  "agent": {
    "build": {
      "model": "anthropic/claude-sonnet-4-6",
      "permission": {
        "bash": "ask",
        "edit": "allow"
      }
    },
    "explore": {
      "mode": "subagent",
      "model": "openai/gpt-4o-mini"
    }
  }
}

Built-in agents include build, plan, general, explore, compaction, title, summary, dream, and distill.

Skills

The current CLI/TUI path reads the v1 shape:

json
{
  "skills": {
    "paths": [".swust-code/skills", "/absolute/path/to/skills"],
    "urls": ["https://example.com/.well-known/skills/"]
  }
}

The core v2 config layer represents skills as a string array. The migration layer expands v1 paths and urls into that array. For user-facing config files, prefer the v1 object shape above.