Skip to content

Configuration

CodeBuddy reads from VS Code settings. Open with Cmd/Ctrl+, and filter by “codebuddy” for the full surface. This page covers the settings you’ll touch day-to-day; the full list lives in the Settings Reference.

Configure any subset — the extension only initializes providers whose keys are present. Switch active provider via the generativeAi.option setting or the onboarding wizard.

ProviderAPI key settingModel setting
Anthropicanthropic.apiKeyanthropic.model
OpenAIopenai.apiKeyopenai.model
Google Geminigoogle.gemini.apiKeysgoogle.gemini.model
Groqgroq.llama3.apiKeygroq.llama3.model
DeepSeekdeepseek.apiKeydeepseek.model
xAI Grokgrok.apiKeygrok.model
Qwenqwen.apiKeyqwen.model
GLMglm.apiKeyglm.model
Locallocal.apiKey + local.baseUrllocal.model

Keys are stored in the OS keychain via SecretStorageService, not in settings.json. The onboarding wizard writes them there for you; you can also set them via the “CodeBuddy: Set <Provider> API Key” commands.

Local covers Ollama (http://localhost:11434), LM Studio, Docker, and any OpenAI-API-compatible endpoint — set local.baseUrl to point at it.

The safety guard that catches runaway agents:

{
"codebuddy.agent.recursionLimit": 600, // deepagents graph depth
"codebuddy.agent.maxEventCount": 15000, // total stream events per task
"codebuddy.agent.maxToolInvocations": 2000, // total tool calls per task
"codebuddy.agent.maxDurationMinutes": 60 // minutes
}

Hit any limit and the stream terminates with a “safety guard” error; the diff view stays clean.

{ "codebuddy.permissionScope.defaultProfile": "standard" }
ProfileBehavior
restrictedRead-only. No terminal, no file writes, no browser.
standardRead/write. Terminal requires modal approval outside a small safe-command list. Default.
trustedSame tools; auto-approves the safe-command list. Catastrophic patterns still deny.

The catastrophic-pattern deny (rm -rf /, dd if=, mkfs.*, etc.) applies even in trusted.

{
"codebuddy.accessControl.defaultMode": "open" // open | allow | deny
}

For team-managed extensions where only some users should reach the agent. See Access Control.

Centralize API keys behind a localhost proxy instead of shipping them to every editor instance:

{
"codebuddy.credentialProxy.enabled": true
}

Rate-limited per provider, injects the real key at proxy time. See Credential Proxy.

Create .codebuddy/rules.md at the repo root. CodeBuddy appends it to the system prompt in every conversation for this workspace.

# Project rules
- TypeScript strict mode
- Use Zod for input validation
- pnpm, not npm
- Every new function needs a test

Fallback filenames checked in order: .codebuddy/rules.md, .codebuddy/rules/index.md, .codebuddyrules, CODEBUDDY.md. Budget: 2000 tokens (~8000 chars); anything over is truncated with a warning.

Dynamic values are supported via {{js: EXPRESSION}} fragments (e.g. Current branch: {{js: host.gitBranch()}}). See Project Rules.

Server configs go in workspace settings under codebuddy.mcp.servers. First-time launch fires a modal approval showing the exact command + args + env-key names; approval persists per workspace. See MCP.

For CI, shell aliases, or team provisioning, providers can also be set via env:

Terminal window
export CODEBUDDY_ANTHROPIC_API_KEY="sk-ant-..."
export CODEBUDDY_OPENAI_API_KEY="sk-..."
# ... one CODEBUDDY_<PROVIDER>_API_KEY per provider

Extension prefers keychain > env > settings.json.