Skip to content

Configuration

CodeBuddy is configured through your editor’s settings. Open settings with Cmd+, (macOS) or Ctrl+, (Windows/Linux) and search for “CodeBuddy”.

CodeBuddy supports 10 AI providers through a unified buildChatModel() factory. Configure your preferred provider:

ProviderSetting keyModels
Anthropiccodebuddy.anthropic.apiKeyClaude Sonnet 4, Claude Opus 4, Claude Haiku
OpenAIcodebuddy.openai.apiKeyGPT-4o, GPT-4o-mini, GPT-4-turbo, o3-mini
Googlecodebuddy.google.apiKeyGemini 2.5 Pro, Gemini 2.5 Flash, Gemini 2.0 Flash
Groqcodebuddy.groq.apiKeyLlama 3.3 70B, Llama 3.1 8B, Mixtral 8x7B
DeepSeekcodebuddy.deepseek.apiKeyDeepSeek Chat, Coder, Reasoner
xAIcodebuddy.xai.apiKeyGrok models
Qwencodebuddy.qwen.apiKeyQwen Plus, Turbo, Max
GLMcodebuddy.glm.apiKeyGLM-4 Plus, GLM-4 Flash
ProviderSetting keyNotes
Ollamacodebuddy.ollama.baseUrlDefault: http://localhost:11434. Any locally hosted model.
OpenAI-compatiblecodebuddy.local.baseUrlLM Studio, vLLM, or any server implementing the OpenAI API.

All providers share the same ChatModel type, so switching providers requires only a configuration change.

{
// Primary AI model
"codebuddy.defaultModel": "claude-sonnet-4-20250514",
// Auto-approve safe operations (file reads, searches)
"codebuddy.autoApprove": true,
// Maximum cost per task (USD, 6 decimal precision)
"codebuddy.costLimit": 1.0,
// Language for the UI (en, es, fr, de, ja, zh-cn, yo)
"codebuddy.language": "en"
}

Control how far the agent can go before stopping:

{
// Maximum events per task (default: 2000)
"codebuddy.agent.maxEvents": 2000,
// Maximum tool invocations per task (default: 400)
"codebuddy.agent.maxToolInvocations": 400,
// Maximum task duration in minutes (default: 10)
"codebuddy.agent.maxDuration": 10,
// Maximum concurrent agent streams (default: 3)
"codebuddy.agent.concurrentStreams": 3,
// Context window size in tokens (4k-128k)
"codebuddy.context.windowSize": 128000
}

Set the active permission profile to control what tools the agent can use:

{
"codebuddy.security.permissionProfile": "standard"
}
ProfileCapabilities
restrictedRead-only. No terminal, no file writes, no browser.
standardRead/write with safe terminal commands. Dangerous patterns blocked. Default.
trustedFull access with auto-approval.

Control who can use the agent in team environments:

{
"codebuddy.security.accessMode": "open"
}
ModeBehavior
openNo restrictions (default)
allowOnly listed users can access
denyListed users are blocked, others allowed

For teams that need centralized API key management:

{
"codebuddy.credentialProxy.enabled": true,
"codebuddy.credentialProxy.rateLimit": 60
}

The proxy runs on localhost, injects API keys from the OS keychain, and rate-limits requests per provider.

Create a .codebuddy/rules.md file in your project root to set project-specific instructions that CodeBuddy follows in every conversation:

# Project Rules
- Use TypeScript strict mode
- Follow the existing code style
- Always write tests for new functions
- Use pnpm instead of npm

CodeBuddy also checks .codebuddy/rules/index.md, .codebuddyrules, and CODEBUDDY.md as fallback locations. Rules are limited to a 2,000-token budget (approximately 8,000 characters) and truncated with a warning if exceeded.

See Project Rules for details.

Enable and configure MCP server connections:

{
"codebuddy.mcp.enabled": true,
"codebuddy.mcp.timeout": 30000
}

Server definitions go in .codebuddy/mcp.json. See MCP Integration for full configuration.

For CI/CD or team setups, configure providers via environment variables:

Terminal window
export CODEBUDDY_OPENAI_API_KEY="sk-..."
export CODEBUDDY_ANTHROPIC_API_KEY="sk-ant-..."
export CODEBUDDY_GOOGLE_API_KEY="AIza..."