Configuration
VS Code settings
Configure Cortex in VS Code Settings (search for “Cortex”). Settings live under the cortex.* namespace — they are not a project config.json.
| Setting | Default | Description |
|---|---|---|
cortex.opencodeBinary | "opencode" | Path to the OpenCode CLI binary |
cortex.opencodePort | 4096 | Local port for opencode serve |
cortex.agent | "build" | Default OpenCode primary agent (e.g. build, plan) |
cortex.providerID | "opencode" | Preferred OpenCode provider id |
cortex.modelID | "big-pickle" | Preferred model id within that provider |
cortex.modelMode | "auto" | auto / turbo / manual model selection |
cortex.routing.useAllConnectedProviders | false | If true, Auto/Turbo may use any OpenCode-connected provider; if false, only cortex.providerID |
cortex.context.topK | 8 | Number of local context chunks injected per prompt |
cortex.context.maxChars | 12000 | Max characters of retrieved context per prompt |
cortex.context.embeddings | "hash" | Embedding backend: hash (offline) or minilm |
cortex.context.chunkMode | "symbols" | Index split mode: symbols (LSP) or lines |
cortex.locale | "en" | Cortex UI language (independent of VS Code display language) |
Models via OpenCode
Cortex uses OpenCode as the agentic provider. You choose among the models available on your OpenCode subscription. OpenCode billing is managed outside Cortex and is unrelated to the Cortex license.
- Connect — Use Cortex: Connect Provider or Cortex: Manage Tokens / Logins to authenticate with OpenCode
- Model picker — Select any model available in your OpenCode account from the chat UI
- Defaults — Set cortex.providerID, cortex.modelID, and cortex.modelMode in VS Code Settings for preferred defaults
OpenCode may also use its own config (for example ~/.config/opencode/opencode.json) for agent permissions and defaults. That is OpenCode configuration, separate from Cortex VS Code settings.
Context sources
Cortex automatically gathers context from:
- Active file — the file you are editing
- Selection — highlighted text
- Lexical search — keyword matching across the project
- Embeddings — hash embeddings by default; optional MiniLM for related code
- Rules / memory — .cortex rules and memory files
- @ mentions — files, folders, terminals, and agents from the chat UI