OMC
Oh My ClaudeCodev4.12.0

Core Concepts

How agents, skills, hooks, and the state management system fit together in OMC

OMC Building Blocks

OMC runs on four systems.

Summary of Each Concept

Agents

19 specialized agents perform tasks according to their role. Each agent operates with an appropriate AI model (haiku, sonnet, or opus).

Examples: explore (discovery), executor (implementation), architect (design), verifier (validation)

Skills

37 skills compose and extend how agents behave. They are activated via slash commands (/oh-my-claudecode:skill-name) or magic keywords.

Examples: autopilot (autonomous execution), ralph (loop until complete), team (parallel collaboration)

Hooks

React to Claude Code lifecycle events to activate skills and agents. They fire when users submit prompts, use tools, or when a session starts or ends.

State Management

Stores task progress, notes, and project knowledge in the .omc/ directory. Important information is preserved even when the context window is reset (compacted).


What Are Agents?

Agents are AI workers specialized for specific roles. OMC organizes its 19 agents into 4 lanes.

Each agent is invoked with the format oh-my-claudecode:agent-name.

Build/Analysis Lane

Handles the entire development flow — from exploration to verification.

AgentDefault ModelRole
explorehaikuCodebase exploration, file and pattern discovery
analystopusRequirements analysis, uncovering hidden constraints
planneropusTask sequencing, execution planning
architectopusSystem design, interface definition, trade-off analysis
debuggersonnetRoot cause analysis, build error fixes
executorsonnetCode implementation, refactoring
verifiersonnetCompletion verification, test adequacy checks
tracersonnetEvidence-based causal tracing, competing hypotheses

Review Lane

The quality gate before handing off code. Catches quality and security issues.

AgentDefault ModelRole
security-reviewersonnetSecurity vulnerabilities, trust boundaries, authn/authz
code-revieweropusComprehensive code review, API contracts, backward compatibility

Domain Lane

Domain specialists called in as needed.

AgentDefault ModelRole
test-engineersonnetTest strategy, coverage, flaky-test hardening
designersonnetUI/UX architecture, interaction design
writerhaikuDocumentation, migration notes
qa-testersonnetCLI/service runtime validation via tmux
scientistsonnetData analysis, statistical research
git-mastersonnetGit operations, commits, rebase, history management
document-specialistsonnetExternal docs, API, and SDK reference lookup
code-simplifieropusCode clarity, simplification, maintainability improvements

Coordination Lane

Challenges plans made by other agents. If no gaps are found, the plan passes.

AgentDefault ModelRole
criticopusGap analysis of plans and designs, multi-angle review

Model Routing

OMC uses three model tiers.

TierModelCharacteristicsCost
LOWhaikuFast and inexpensiveLow
MEDIUMsonnetBalance between performance and costMedium
HIGHopusHighest-level reasoningHigh

Default tiers vary by agent.

  • haiku: fast lookups and simple tasks (explore, writer)
  • sonnet: code implementation, debugging, testing (executor, debugger, test-engineer)
  • opus: architecture, strategic analysis, review (architect, planner, critic, code-reviewer)

Delegation Rules

The OMC orchestrator delegates to the appropriate agent based on task type.

When to Delegate to an Agent

  • When multiple files need to be changed
  • When refactoring is needed
  • When debugging or root cause analysis is needed
  • When code review or security review is needed
  • When planning or research is needed

When to Handle Directly

  • Simple file lookups
  • Straightforward question answering
  • Single-line command execution

Example Agent Workflow

A typical task flow looks like this.

Agent Role Boundaries

AgentDoesDoes Not
architectCode analysis, debugging, verificationRequirements gathering, planning
analystFinding requirement gapsCode analysis, planning
plannerCreating task plansRequirements analysis, plan review
criticReviewing plan qualityRequirements analysis, code analysis

Agent Selection Guide

Task TypeRecommended AgentModel
Quick code lookupexplorehaiku
Feature implementationexecutorsonnet
Complex refactoringexecutor (model=opus)opus
Simple bug fixdebuggersonnet
Complex debuggingarchitectopus
UI componentdesignersonnet
Documentationwriterhaiku
Test strategytest-engineersonnet
Security reviewsecurity-reviewersonnet
Code reviewcode-revieweropus
Data analysisscientistsonnet

What Are Skills?

Skills are a behavior injection system that defines how agents act. They do not replace agents — they add extra capabilities to existing agents.

Skills are divided into three layers.

Skills can be composed.

Task: "ultrawork: refactor the API and commit it"
Active skills: ultrawork + default + git-master

How to Invoke Skills

Slash Commands

/oh-my-claudecode:autopilot build me a todo app
/oh-my-claudecode:ralph refactor the auth module
/oh-my-claudecode:team 3:executor "implement a full-stack app"

Magic Keywords

Include a keyword in natural language and the corresponding skill activates automatically.

autopilot build me a todo app          # activates autopilot skill
ralph: refactor the auth module        # activates ralph skill
ultrawork implement OAuth              # activates ultrawork skill

Key Workflow Skills

autopilot

A 5-stage autonomous execution pipeline from idea to finished code.

autopilot build me a REST API with authentication

Trigger keywords: autopilot, build me, I want a

ralph

A loop that does not stop until the task is verified complete. Keeps working until the verifier confirms completion.

ralph: refactor the authentication module

Trigger keywords: ralph, don't stop, must complete

ultrawork

Runs multiple agents simultaneously with maximum parallelism.

ultrawork implement user authentication with OAuth

Trigger keywords: ultrawork, ulw

team

Coordinates N Claude agents simultaneously. Operates through a 5-stage pipeline: plan → prd → exec → verify → fix

/oh-my-claudecode:team 3:executor "implement a full-stack todo app"

ccg (Claude-Codex-Gemini)

Queries Codex and Gemini simultaneously, then Claude synthesizes the results.

ccg: review this authentication implementation

Trigger keywords: ccg, claude-codex-gemini

ralplan

A planning process where Planner, Architect, and Critic iterate until reaching consensus.

ralplan this feature

Trigger keywords: ralplan

Utility Skills

SkillDescriptionCommand
cancelCancel a running mode/oh-my-claudecode:cancel
noteSave a note to the notepad/oh-my-claudecode:note
hudConfigure the status bar/oh-my-claudecode:hud
omc-setupInitial setup wizard/oh-my-claudecode:omc-setup
omc-doctorInstallation diagnostics/oh-my-claudecode:omc-doctor
learnerExtract reusable skills from a session/oh-my-claudecode:learner
skillManage local skills (list/add/remove)/oh-my-claudecode:skill
traceEvidence-based causal tracing/oh-my-claudecode:trace
releaseAutomated release workflow/oh-my-claudecode:release
deepinitGenerate hierarchical AGENTS.md/oh-my-claudecode:deepinit
deep-interviewSocratic deep interview/oh-my-claudecode:deep-interview
sciomcParallel scientist agent orchestration/oh-my-claudecode:sciomc
external-contextParallel document specialist research/oh-my-claudecode:external-context
ai-slop-cleanerAI expression cleanup workflow/oh-my-claudecode:ai-slop-cleaner
writer-memoryMemory system for writing projects/oh-my-claudecode:writer-memory

Full Magic Keyword List

KeywordEffect
ultrawork, ulwParallel agent orchestration
autopilot, build me, I want aAutonomous execution pipeline
ralph, don't stop, must completeLoop until verified complete
ccg, claude-codex-gemini3-model orchestration
ralplanConsensus-based planning
deep interview, ouroborosSocratic deep interview
deepsearch, search the codebaseCodebase search mode
deepanalyze, deep-analyzeDeep analysis mode
ultrathinkDeep reasoning mode
tdd, test first, red greenTDD workflow
deslop, anti-slopAI expression cleanup
cancelomc, stopomcCancel execution mode

config.jsonc vs keyword-detector

Keywords are processed in two places.

SourceRoleCustomizable
config.jsonc magicKeywords4 categories (ultrawork, search, analyze, ultrathink)Yes
keyword-detector hook11+ triggers (autopilot, ralph, ccg, etc.)No

The keywords you can change in config.jsonc are limited. Major triggers like autopilot, ralph, and ccg are hardcoded in the hook.


What Are Hooks?

Hooks are code that reacts to Claude Code lifecycle events. They run automatically when users submit prompts, use tools, or when sessions start or end.

OMC uses this hook system to implement agent delegation, keyword detection, and state persistence.

Lifecycle Events

Claude Code provides 11 lifecycle events, and OMC registers hooks on them.

EventWhen It FiresOMC Usage
UserPromptSubmitWhen the user submits a promptMagic keyword detection, skill injection
SessionStartWhen a session startsInitial setup, project memory load
PreToolUseBefore a tool is usedPermission validation, parallel execution hints
PermissionRequestWhen a permission is requestedBash command permission handling
PostToolUseAfter a tool is usedTool result validation, project memory update
PostToolUseFailureAfter a tool use failureError recovery handling
SubagentStartWhen a subagent startsAgent tracking
SubagentStopWhen a subagent stopsAgent tracking, output verification
PreCompactBefore context compactionPreserve important info, save project memory
StopWhen Claude stopsMaintain persistent mode, code simplification
SessionEndWhen a session endsSession data cleanup

system-reminder Injection

Hooks inject additional context to Claude via <system-reminder> tags.

<system-reminder>
hook success: Success
</system-reminder>

The meaning depends on the injected pattern.

PatternMeaning
hook success: SuccessHook ran successfully, continue normally
hook additional context: ...Additional context info, take note
[MAGIC KEYWORD: ...]Magic keyword detected, execute the indicated skill
The boulder never stopsralph/ultrawork mode is active

Key Hook Descriptions

keyword-detector

Fires on the UserPromptSubmit event. Detects magic keywords in user input and activates the corresponding skill.

persistent-mode

Fires on the Stop event. Prevents Claude from stopping when a persistent mode like ralph or ultrawork is active.

pre-compact

Fires on the PreCompact event. Saves important information to the notepad before the context window is compacted.

subagent-tracker

Fires on SubagentStart and SubagentStop events. Tracks currently running agents and verifies their output when they stop.

context-guard-stop

Fires on the Stop event. Monitors context usage and warns when approaching the limit.

code-simplifier

Fires on the Stop event. Disabled by default. When enabled, automatically simplifies modified files when Claude stops.

To enable:

{
  "codeSimplifier": {
    "enabled": true,
    "extensions": [".ts", ".tsx", ".js", ".jsx", ".py", ".go", ".rs"],
    "maxFiles": 10
  }
}

Disabling Hooks

Disable All Hooks

export DISABLE_OMC=1

Skip Specific Hooks

export OMC_SKIP_HOOKS="keyword-detector,persistent-mode"

Multiple hooks can be skipped at once using comma separation.

Hook Registration Structure

OMC hooks are defined declaratively in a hooks.json file. Each hook is implemented as a Node.js script with a configured timeout.

{
  "UserPromptSubmit": [
    {
      "matcher": "*",
      "hooks": [
        {
          "type": "command",
          "command": "node scripts/keyword-detector.mjs",
          "timeout": 5
        }
      ]
    }
  ]
}
  • matcher: Pattern the hook responds to (* matches all input)
  • timeout: Timeout in seconds
  • type: Always "command" (runs an external command)

State Management Overview

OMC stores task progress and project knowledge in the .omc/ directory. Even when context compaction occurs, this state system preserves important information.

Directory Structure

.omc/
├── state/                    # Per-mode state files
│   ├── autopilot-state.json  # autopilot progress
│   ├── ralph-state.json      # ralph loop state
│   ├── team/                 # team task state
│   └── sessions/             # per-session state
│       └── {sessionId}/
├── notepad.md                # Compaction-resistant notes
├── project-memory.json       # Project knowledge store
├── plans/                    # Execution plans
├── notepads/                 # Per-plan knowledge capture
│   └── {plan-name}/
│       ├── learnings.md
│       ├── decisions.md
│       ├── issues.md
│       └── problems.md
├── autopilot/                # autopilot artifacts
│   └── spec.md
├── research/                 # Research results
└── logs/                     # Execution logs

Notepad

File: .omc/notepad.md

The notepad is a memo pad that survives context compaction. Even when Claude's context window is reset, content written to the notepad is preserved.

Usage

# Save a note using the skill
/oh-my-claudecode:note "Use /api/v2 for the API endpoint"

MCP Tools

ToolDescription
notepad_readRead notepad content
notepad_write_prioritySave a high-priority note (permanently preserved)
notepad_write_workingSave a working note
notepad_write_manualSave a manual note
notepad_pruneClean up old notes
notepad_statsView notepad statistics

How It Works

  1. When a PreCompact event fires, important information is saved to the notepad
  2. After context compaction, notepad content is re-injected
  3. Agents use the notepad to recover previous context

Project Memory

File: .omc/project-memory.json

Project memory is a persistent store for project-level knowledge. Knowledge about the project is retained across sessions.

MCP Tools

ToolDescription
project_memory_readRead project memory
project_memory_writeWrite entire project memory
project_memory_add_noteAdd a note
project_memory_add_directiveAdd a directive

Lifecycle Integration

  • SessionStart: Loads project memory and injects it into the context
  • PostToolUse: Extracts and saves project knowledge from tool use results
  • PreCompact: Saves project memory before context compaction

Session Scope

Path: .omc/state/sessions/{sessionId}/

Stores state isolated per session. Multiple sessions running simultaneously on the same project do not have state conflicts.

Plan Notepad (Per-plan Knowledge Capture)

Path: .omc/notepads/{plan-name}/

Stores learnings for each execution plan separately.

FileContents
learnings.mdDiscovered patterns, successful approaches
decisions.mdArchitecture decisions and rationale
issues.mdProblems and blockers
problems.mdTechnical debt and cautions

All entries are automatically timestamped.

Centralized State Management

By default, state is stored in the .omc/ directory inside the project. If the worktree is deleted, the state is lost with it.

To preserve state across worktree deletions, set the OMC_STATE_DIR environment variable.

# Add to ~/.bashrc or ~/.zshrc
export OMC_STATE_DIR="$HOME/.claude/omc"

With this setting, state is stored at ~/.claude/omc/{project-identifier}/. The project identifier is a hash of the Git remote URL, so state can be shared across different worktrees of the same repository.

Persistent Memory (remember tags)

Especially important information can be stored with <remember> tags.

<!-- Retained for 7 days -->
<remember>API endpoint changed to /v2</remember>

<!-- Retained permanently -->
<remember priority>Never access the production DB directly</remember>
TagRetention
<remember>7 days
<remember priority>Permanent

On this page