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 | Preferred port for opencode serve; if another workspace owns it, Cortex uses the next free port |
cortex.agent | "build" | Default OpenCode primary agent (e.g. build, plan) |
cortex.providerID | "opencode" | Deprecated offline mirror — default model is OpenCode opencode.json `model` |
cortex.modelID | "big-pickle" | Deprecated offline mirror — prefer OpenCode config / chat picker |
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 the OpenCode default model provider |
cortex.models.optimizeFor | "balance" | Auto routing cost vs quality: cost / balance / intelligence |
cortex.models.zenBillingEnabled | false | Unlock paid Zen models in the picker (off by default — no surprise charges) |
cortex.models.byokEnabled | false | Unlock BYOK provider models (OpenAI, Anthropic, etc.) |
cortex.context.topK | 8 | Number of local context chunks injected per prompt |
cortex.context.maxChars | 16000 | Max characters of retrieved context per prompt |
cortex.context.embedWeight | 0.45 | Weight (0–1) for embedding similarity vs lexical match when ranking context |
cortex.context.embeddings | "hash" | Retrieval mode: hash = Performance (fast, offline); minilm = Quality (semantic MiniLM). Quality downloads a native runtime once into ~/.cache/cortex-minilm (not in the VSIX); send stays locked until ready (usually ≤~30s on first index); vectors persist in .cortex/index; later opens only warm the model; file edits re-embed only changed files. Onboarding/chat show a hardware fit tip (Quality adds ~150 MB; concurrency capped on tighter PCs) |
cortex.context.chunkMode | "symbols" | Index split mode: symbols (LSP) or lines |
cortex.context.include | [] | Optional include globs (relative to workspace). Empty = all indexable files |
cortex.context.exclude | [] | Extra exclude globs on top of gitignore |
cortex.context.extensionPriority | {".ts":1,".tsx":1,".js":0.8,".jsx":0.8,".py":0.9} | Per-extension score multipliers for retrieval ranking (higher = preferred) |
cortex.autocomplete.enabled | true | Ghost-text autocomplete via a fast no-tools OpenCode agent |
cortex.autocomplete.debounceMs | 350 | Debounce (ms) before requesting an autocomplete suggestion after typing pauses |
cortex.locale | "en" | Cortex UI language (independent of VS Code display language) |
cortex.chat.pinEditorTab | true | Pin the Cortex chat editor tab and keep it first in its group |
cortex.chat.maxOpenTabs | 5 | Max chat tabs kept open and restored on startup (0 = unlimited) |
cortex.chat.maxHistorySessions | 100 | Max chats listed in History (newest first; 0 = all fetched) |
cortex.ui.showHeaderVersion | true | Show muted extension version next to the Cortex title (turn off for demos) |
cortex.ui.showReasoningSummaries | true | Show thinking / reasoning summary blocks in the chat timeline |
cortex.ui.shellToolPartsExpanded | true | Expand shell/bash tool output blocks by default in the chat timeline |
cortex.ui.editToolPartsExpanded | true | Expand edit/write/patch tool cards by default in the chat timeline |
cortex.permissions.autoAccept | false | Automatically accept OpenCode permission prompts with a one-time allow |
cortex.appearance.uiFont | "" | Optional CSS font-family for Cortex chat UI; empty uses the VS Code UI font |
cortex.appearance.codeFont | "" | Optional CSS font-family for monospace / code in Cortex chat; empty uses the editor font |
cortex.notifications.agent | false | Show a VS Code notification when the agent finishes a turn |
cortex.notifications.permissions | false | Show a VS Code notification when a permission prompt appears |
cortex.notifications.errors | true | Show a VS Code notification on chat errors |
cortex.sounds.agent | "none" | Sound when the agent finishes a turn (none or a Web Audio preset) |
cortex.sounds.permissions | "none" | Sound when a permission prompt appears |
cortex.sounds.errors | "none" | Sound on chat errors |
cortex.theme.id | "follow" | Chat color theme: follow (OpenCode tui.json), cortex, or an OpenCode desktop theme id (GitHub catalog + cache) |
cortex.theme.mode | "system" | Light/dark variant for OpenCode themes; system follows the VS Code color theme kind |
cortex.theme.remoteRef | "dev" | Git ref on anomalyco/opencode used to list official desktop themes |
cortex.policy.t0MaxChars | 2000 | Max characters for Tier T0 (immutable safety / neverDo / hooks) |
cortex.policy.t1MaxChars | 12000 | Max characters for Tier T1 (always-apply rules, AGENTS.md, user rules) |
cortex.policy.t2MaxChars | 8000 | Max characters for Tier T2 (glob-scoped rules, skills, requestable catalog) |
cortex.policy.includeCursorRules | true | Load .cursor/rules into the Policy Brain |
cortex.policy.includeCortexRules | true | Load .cortex/rules into the Policy Brain |
cortex.skills.autoInvoke | true | Auto-inject matching SKILL.md bodies when the turn matches |
cortex.skills.topK | 2 | Max skills fully injected per turn when auto-invoke is on |
cortex.hooks.enabled | true | Run .cortex/hooks.json and built-in changelog gate |
cortex.hooks.strict | false | If true, a failing prePrompt hook denies the turn |
Keyboard shortcuts
VS Code keybindings (not OpenCode Desktop). Customize in Keyboard Shortcuts:
| Shortcut | Action |
|---|---|
Ctrl/Cmd+Alt+C | Open chat (right editor panel) |
Ctrl+Alt+I / Cmd+Alt+Shift+I | Inline Edit |
Ctrl/Cmd+Alt+\ | Trigger ghost-text completion |
Ctrl/Cmd+Alt+T | Send terminal selection to chat |
Command Palette
All Cortex commands are available from the VS Code Command Palette (Ctrl/Cmd+Shift+P). Search for “Cortex”:
| Command | Description |
|---|---|
Cortex: Open Session | Open the chat panel (right editor group) |
Cortex: New Session | Start a new chat session |
Cortex: Stop Generation | Abort the current agent turn |
Cortex: Send Terminal Selection to Session | Send the selected terminal text to chat |
Cortex: Reindex Workspace | Rebuild the local codebase index |
Cortex: Trigger Inline Completion | Request a ghost-text completion now |
Cortex: Inline Edit (Ctrl+Alt+I) | Inline edit the current selection / file |
Cortex: Connect | Open Providers to connect OpenCode accounts |
Cortex: Connect / Models | Open Models (default model, visibility, favorites) |
Cortex: Remember preference | Save a preference into Policy Brain memory |
Cortex: Open rules / memory | Open rules and memory files |
Cortex: Edit user rules | Edit user-level rules |
Cortex: Show Policy Inspector | Inspect the active Policy Brain tiers for this turn |
Cortex: Run Diagnostics | Run connectivity and setup diagnostics |
Cortex: Show Log | Open the Cortex output channel |
Cortex: Dump last retrieval | Write the last context retrieval dump for troubleshooting |
Cortex: Report Issue / Feedback | Open the feedback / issue report flow |
Models via OpenCode
Cortex uses OpenCode as the agentic provider. You choose among the models available on your OpenCode subscription (Zen free, paid Zen, or OpenCode Go). OpenCode billing is managed outside Cortex and is unrelated to the Cortex license.
- Servers — Under Settings → Servers, manage the local OpenCode connection and remote HTTP OpenCode servers (health, add/edit/delete, set default/active) — same idea as OpenCode Desktop.
- Providers — Open Providers (Cortex: Connect) to connect Zen, Go, Anthropic, Copilot, custom OpenAI-compatible endpoints, and more — same catalog style as OpenCode Desktop. Auth stays in OpenCode’s local auth.json; Cortex does not keep a separate account store.
- OpenCode Go — After subscribing to Go on opencode.ai, Cortex auto-detects it on boot / Recheck and switches (reuses your API key). You can also Enable OpenCode Go under Models.
- Paid Zen / BYOK — Free Zen stays unlocked. Paid Zen and BYOK need an explicit unlock in Models (or cortex.models.zenBillingEnabled / cortex.models.byokEnabled).
- Model picker — Select any model available from your connected OpenCode providers in the chat UI. Auto/Turbo respect cortex.models.optimizeFor (cost / balance / intelligence). When the catalog exposes them, pick a model variant (Default / Low / Medium / High).
- Themes — Chat themes follow OpenCode Desktop: official catalog from GitHub (cached), custom themes in ~/.config/opencode/themes, or follow tui.json. Configure cortex.theme.id / mode / remoteRef or pick a theme under Models.
- Notifications & sounds — Optional VS Code notifications and Web Audio presets when the agent finishes, a permission prompt appears, or an error occurs (cortex.notifications.* / cortex.sounds.*). permissions.autoAccept mirrors Desktop auto-accept.
- Composer + — The composer + menu (OpenCode Desktop parity): Images and files (Ctrl/Cmd+U), Commands (/), Context (@), Shell (!). Attachments are filtered by the active model’s input modalities.
- Defaults — Default model lives in OpenCode opencode.json (`model`). Set cortex.modelMode (Auto/Turbo/Manual) in VS Code; visibility/favorites under Models
- No folder open — You can chat in an empty window; Cortex uses your home directory as the OpenCode cwd. Open a project folder for local codebase indexing and project plans.
Auth and provider keys live in OpenCode’s local store (~/.local/share/opencode/auth.json; on Windows: %USERPROFILE%\.local\share\opencode\auth.json). Cortex reads and writes that store — it does not duplicate credentials. OpenCode may also use ~/.config/opencode/opencode.json for agent permissions; that is separate from Cortex VS Code settings.
Context sources
Cortex automatically gathers context from:
- Policy Brain (T0–T2) — layered rules: user rules, AGENTS.md, .cursor/rules, .cortex/rules, skills, neverDo — also Command Palette: Remember preference, Open rules / memory, Edit user rules, Show Policy Inspector
- Active file — the file you are editing (auto-attached each turn)
- Selection — highlighted text
- Lexical search — keyword matching across the project
- Embeddings — Performance (hash) by default; Quality (MiniLM) from the chat toolbar — send unlocks when the local model is ready (no silent Performance fallback while loading)
- Memory — .cortex/memory.json facts, preferences, and neverDo
- @ mentions — files, folders, terminals, and agents from the chat UI (also via composer + → Context)
- Hooks — .cortex/hooks.json prePrompt/postTurn plus built-in changelog gate