Configuration
Customize Oh My OpenCode to fit your workflow
Configuration File Locations
Oh My OpenCode looks for configuration in the following locations (in order of precedence):
.opencode/oh-my-opencode.json- Project-specific configuration (highest priority)~/.config/opencode/oh-my-opencode.json- User-wide configuration
Project-specific configuration takes precedence over user-wide configuration. This allows you to have different settings for different projects.
Agents Configuration
Configure which agents are enabled and their settings:
{
"agents": {
"planner-sisyphus": {
"enabled": true,
"replace_plan": true
},
"librarian": {
"enabled": false
},
"explore": {
"enabled": false
},
"oracle": {
"enabled": false
}
}
}
Agent Options
| Option | Default | Description |
|---|---|---|
enabled |
varies | Enable or disable the agent. Planner-Sisyphus is enabled by default. |
replace_plan |
true | When true, demotes default plan agent to subagent mode. Set to false to keep both Planner-Sisyphus and default plan available. |
Hooks Configuration
Disable specific built-in hooks via disabled_hooks:
{
"disabled_hooks": ["comment-checker", "agent-usage-reminder"]
}
Available Hooks
The following hooks can be disabled:
todo-continuation-enforcer- Ensures tasks are completedcontext-window-monitor- Monitors context window usagesession-recovery- Automatic session recoverysession-notification- Session event notificationscomment-checker- Code comment validationgrep-output-truncator- Truncates large grep outputstool-output-truncator- Manages tool output sizesdirectory-agents-injector- Injects directory-specific agentsdirectory-readme-injector- Adds README contextempty-task-response-detector- Detects empty responsesthink-mode- Enables thinking modeanthropic-context-window-limit-recovery- Handles Anthropic limitsrules-injector- Injects custom rulesbackground-notification- Background notificationsauto-update-checker- Checks for updatesstartup-toast- Startup notificationskeyword-detector- Keyword detectionagent-usage-reminder- Agent usage remindersnon-interactive-env- Non-interactive environment handlinginteractive-bash-session- Interactive session managementempty-message-sanitizer- Cleans empty messagescompaction-context-injector- Context compactionthinking-block-validator- Validates thinking blocksclaude-code-hooks- Claude-specific hooksralph-loop- Ralph agent looppreemptive-compaction- Preemptive compaction
startup-toast hook is a sub-feature of auto-update-checker. To disable only the startup toast notification while keeping update checking enabled, add "startup-toast" to disabled_hooks. To disable all update checking features (including the toast), add "auto-update-checker" to disabled_hooks.
MCPs Configuration
Disable specific MCPs via disabled_mcps:
{
"disabled_mcps": ["context7", "grep_app"]
}
Available MCPs
context7- Fetches up-to-date official documentation for libraries (enabled by default)grep_app- Ultra-fast code search across millions of public GitHub repositories (enabled by default)
LSP Configuration
Add and configure LSP servers:
{
"lsp": {
"typescript-language-server": {
"command": ["typescript-language-server", "--stdio"],
"extensions": [".ts", ".tsx"],
"priority": 10
},
"pylsp": {
"disabled": true
}
}
}
LSP Server Options
| Option | Description |
|---|---|
command |
Array of command and arguments to start the LSP server |
extensions |
Array of file extensions this server should handle |
priority |
Priority number (higher = more priority) when multiple servers handle the same file |
env |
Environment variables to pass to the server |
initialization |
Custom initialization options for the server |
disabled |
Set to true to disable a server |
Experimental Features Configuration
Opt-in experimental features that may change or be removed in future versions:
{
"experimental": {
"preemptive_compaction_threshold": 0.85,
"truncate_all_tool_outputs": true,
"aggressive_truncation": true,
"auto_resume": true,
"dcp_for_compaction": false
}
}
Experimental Options
| Option | Default | Description |
|---|---|---|
preemptive_compaction_threshold |
0.85 | Threshold percentage (0.5-0.95) to trigger preemptive compaction. The preemptive-compaction hook is enabled by default; this option customizes the threshold. |
truncate_all_tool_outputs |
false | Truncates ALL tool outputs instead of just whitelisted tools (Grep, Glob, LSP, AST-grep). Tool output truncator is enabled by default - disable via disabled_hooks. |
aggressive_truncation |
false | When token limit is exceeded, aggressively truncates tool outputs to fit within limits. More aggressive than the default truncation behavior. Falls back to summarize/revert if insufficient. |
auto_resume |
false | Automatically resumes session after successful recovery from thinking block errors or thinking disabled violations. Extracts the last user message and continues. |
dcp_for_compaction |
false | Enable DCP (Dynamic Context Pruning) for compaction - runs first when token limit exceeded. Prunes duplicate tool calls and old tool outputs before running compaction. |
Complete Configuration Example
Here's a complete example configuration file:
{
"agents": {
"planner-sisyphus": {
"enabled": true,
"replace_plan": true
},
"librarian": {
"enabled": true
}
},
"disabled_hooks": ["comment-checker"],
"disabled_mcps": [],
"lsp": {
"typescript-language-server": {
"command": ["typescript-language-server", "--stdio"],
"extensions": [".ts", ".tsx"],
"priority": 10
}
},
"experimental": {
"preemptive_compaction_threshold": 0.85,
"auto_resume": false
}
}
Configuration Validation
Oh My OpenCode validates your configuration on startup. If there are any errors, they will be reported and the default configuration will be used for invalid sections.
Common Configuration Errors
- Invalid JSON syntax - Make sure your JSON is valid. Use a JSON validator if needed.
- Unknown options - Check that option names are spelled correctly.
- Invalid values - Ensure values match the expected types (boolean, number, string, array, object).