OmO
Oh My OpenAgentv4.7.5

Hooks

Lifecycle automation that keeps OmO sessions recoverable, routed, and moving.

Hooks are the harness layer wrapped around OpenCode sessions. They inject instructions, repair malformed state, route slash commands, remind agents about category and skill rules, and resume unfinished work.

What Hooks Control

FamilyExamplesPurpose
Routingauto-slash-command, keyword-detector, category-skill-reminderTurn user intent into the right workflow.
Continuationralph-loop, todo-continuation-enforcer, task-reminderKeep unfinished tasks from stopping silently.
Recoverysession-recovery, edit-error-recovery, json-error-recoveryRepair common model and tool failure modes.
Tool integrationinteractive-bash-session, claude-code-hooks, MCP hooksConnect tmux, external tools, and agent-specific tooling.
Contextdirectory-agents-injector, AGENTS-style injectionAdd repository or directory conventions.

Practical Model

You rarely need to memorize every hook. Think of them as four guarantees:

  1. The right instructions are present before work starts.
  2. The right specialist or category is selected for the task.
  3. The session can recover from tool and model glitches.
  4. The agent continues until todos and verification are complete.

Safe Customization

When changing hooks or experimental options:

  • Change one behavior at a time.
  • Run bunx oh-my-openagent doctor --verbose after config changes.
  • Keep continuation hooks enabled unless you are debugging the harness itself.
  • Prefer per-project config for repository-specific behavior.
  • Document any project hook assumptions in .opencode/skills/ or local docs.

Common experimental options cover context and recovery: aggressive_truncation, auto_resume, preemptive_compaction, and truncate_all_tool_outputs. Their availability varies by installed version, so let doctor and the generated schema be the source of truth.

On this page