omp (oh-my-pi)
Fork ofbadlogic/pi-mono by can1357. Positions itself as the batteries-included coding agent: same TypeScript + TUI shell as Pi, but with a ~55k-line Rust native core and 32 built-in tools. MIT license.
GitHub: https://github.com/can1357/oh-my-pi
Docs: https://omp.sh
Install: curl -fsSL https://omp.sh/install | sh · Homebrew · Bun · Windows PowerShell · mise
Why It Diverges From Pi
Pi’s thesis: minimal harness beats feature-heavy harness (validated by Terminal Bench). omp accepts the data but identifies a different failure class: tool quality failures — string-match edits that fail on whitespace drift, missing debugger forcing print-statement debugging, no LSP integration for cross-file renames, fork/exec overhead on every search. omp’s answer: replace unreliable primitives with native ones, then add the tools that eliminate entire categories of retry loops.Tool Surface (32 tools)
Files & Search
Runtime
Code Intelligence
Coordination
Outside the Box
Memory & State
Misc
Differentiating Primitives
Hashline Edit Format
Content-hash anchors replace string matching. Stale anchors (file changed since read) are rejected before corruption. 61% fewer output tokens on Grok 4 Fast. 2.1× pass rate lift on MiniMax. +5pp over str_replace on Gemini 3 Flash.LSP Wired Into Writes
Every write goes throughworkspace/willRenameFiles. Re-exports, barrel files, aliased imports update before the file moves. No post-rename breakage without IDE.
Time-Traveling Stream Rules (TTSR)
Regex match aborts mid-token stream → injects rule as system reminder → retries from same point. No full-context tax. Injections survive compaction. Qualitatively different from PreToolUse hooks: fires mid-stream, not between turns.DAP Debugger
Drives lldb (C/C++/Rust), dlv (Go), debugpy (Python) via DAP protocol. Attach, step, inspect frame. Not a REPL workaround.Task (First-Class Subagents)
Worktree-isolated workers with typed schema-validated return objects.irc enables in-process inter-agent prose. No prose parsing of subagent output.
Eval Kernels
Persistent Python + Bun cells that share a prelude and can call back into agent tools. Multi-kernel, multi-cell within one session.Conflict Resolution Scheme
conflict://N URL → write @theirs/@ours/@base → file resolves atomically. conflict://* for bulk.
Preview/Accept Workflow
ast_edit returns a staged “(proposed)” card. Agent calls resolve to commit atomically. Structural rewrites have a gate between proposal and application.
Hindsight Memory
SQLite memory engine, project-scoped.retain (write) / recall (search) / reflect (synthesize). Survives sessions. Qualitatively different from manually maintained MEMORY.md.
Snapcompact
Bitmap-frame context compression — distinct from summarization-based compaction. Renders discarded conversation history into dense PNG frames of pixel-font glyphs that vision models read back directly. Local and deterministic — no LLM call, no API key. Key detail for tool outputs: snapcompact already truncates tool results during archival compaction:- Default cap: 2000 chars per tool result (
toolResultMaxChars) - Head/tail truncation with 60/40 split (
truncateHeadRatio) - “Useless” tool results skipped entirely
- Tool arguments capped at 500 chars per value, 2000 chars per call
Native Rust Core (~55k LoC)
In-process on libuv thread pool. No fork/exec on hot path.Provider Surface (40+)
Roles:default, smol (cheap fan-out), slow (deep reasoning), plan, commit. Cycle with Ctrl+P, swap mid-session with /model.
Features: fallback chains per role, path-scoped model overrides (different model set per repo prefix), round-robin credential rotation with per-key backoff.
Notable: Cursor (oauth), GitHub Copilot (oauth), Kimi Code, MiniMax Coding Plan, Alibaba Coding Plan, Qwen Portal, Xiaomi MiMo — plus all OpenAI-compatible local servers (Ollama, LM Studio, llama.cpp, vLLM, LiteLLM).
Config Inheritance
Inherits from.claude, .cursor, .windsurf, .gemini, .codex, .cline, .github/copilot, .vscode on first run. Existing rules, skills, MCP servers carry over without migration.
Entry Points
RPC Mode (Deep Dive)
omp --mode rpc is a JSON-lines protocol: commands on stdin, responses/events on stdout.
Key capabilities for bus integration:
set_host_tools— register host-side tools that the agent can call (language-agnostic: Python, Rust, Go, bash)set_host_uri_schemes— custom URI schemes (e.g.,commandr://events.jsonl)host_tool_call/host_tool_result— bidirectional structured RPCextension_ui_request— agent requests UI: selector, confirm, input, OAuthsubagent_lifecycle/subagent_progress/subagent_event— native subagent monitoring- Real-time event streaming:
message_update,tool_execution_*,agent_start/agent_end
Plugin Architecture
omp bundles skills, commands, hooks, custom tools, MCP servers, and themes in a single installable package. The surface is Claude-Code-compatible — existing.claude-plugin/ catalogs work as-is.
Install:
omp install ./path (symlinks + watches), omp install github:user/repo, omp install @scope/plugin. Project-scoped with -l.
Headroom Compression Plugin (Local)
A working example lives atpi-headroom/ in this repo:
hooks/pre/headroom-compress.ts—tool_resulthook that compresses or truncates large tool outputs before the model sees them usingheadroom-aitools/headroom-retrieve/index.ts— custom tool that lets the model fetch original uncompressed content on demand
The plugin uses
tool_result instead of context because omp 16.0.9 does not support message-array replacement via context hook returns. This still covers the bulk of token bloat (tool outputs). See pi-headroom/README.md for full test results and configuration.
Role in Commandr Stack
omp is the strongest practical L2 runner candidate: a high-quality worker, not the bus. Its value is execution quality inside a task: hashline edits, LSP/DAP, typed subagent outputs, internal schemes, persistent eval kernels, and provider routing. Commandr should still own claim/progress/approval/complete lifecycle. Integration ladder:
Level 1 is complete with
commandr-omp-runner (see commandr-omp-runner/ in this repo). Level 2 becomes useful once task/event/approval schemas stabilize. Level 3 (plugin-based bidirectional sync) is where the headroom plugin pattern also lives — a plugin can both intercept context and register tools that talk back to Commandr’s bus.
Internal Schemes (://)
pr://, issue://, agent://, skill://, rule:// and others resolve through the same FS-shaped tools. read pr://owner/repo/1428 returns the same shape as read src/foo.ts. agent://<id>/findings.0.path extracts a field from subagent output.
Monorepo Packages (omp-specific additions)
Related Pages
- Pi Agent (pi-mono) — upstream fork; minimal harness design; Terminal Bench data
- Omp Oh My Pi — full source summary
- Our Stack vs omp — feature gap vs our Claude Code + Pi setup
- Commandr — L3 bus omp should speak through
- DiffViewer — L5 UI consuming omp artifacts through Commandr/DiffViewer sidecars
- Agent Harness — harness engineering framing
- Claude Code vs OpenCode Plugin Systems — adjacent harness comparison