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):

  1. .opencode/oh-my-opencode.json - Project-specific configuration (highest priority)
  2. ~/.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.

Learn More About Agents โ†’

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 completed
  • context-window-monitor - Monitors context window usage
  • session-recovery - Automatic session recovery
  • session-notification - Session event notifications
  • comment-checker - Code comment validation
  • grep-output-truncator - Truncates large grep outputs
  • tool-output-truncator - Manages tool output sizes
  • directory-agents-injector - Injects directory-specific agents
  • directory-readme-injector - Adds README context
  • empty-task-response-detector - Detects empty responses
  • think-mode - Enables thinking mode
  • anthropic-context-window-limit-recovery - Handles Anthropic limits
  • rules-injector - Injects custom rules
  • background-notification - Background notifications
  • auto-update-checker - Checks for updates
  • startup-toast - Startup notifications
  • keyword-detector - Keyword detection
  • agent-usage-reminder - Agent usage reminders
  • non-interactive-env - Non-interactive environment handling
  • interactive-bash-session - Interactive session management
  • empty-message-sanitizer - Cleans empty messages
  • compaction-context-injector - Context compaction
  • thinking-block-validator - Validates thinking blocks
  • claude-code-hooks - Claude-specific hooks
  • ralph-loop - Ralph agent loop
  • preemptive-compaction - Preemptive compaction
Note on auto-update-checker and startup-toast: The 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.

Learn More About 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)

Learn More About MCPs โ†’

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

Learn More About LSP โ†’

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.
Warning: These features are experimental and may cause unexpected behavior. Enable only if you understand the implications.

Learn More About Experimental Features โ†’

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).