# oh-my-pi (omp) Mental Model Wiki > omp is a batteries-included coding agent CLI and SDK — a TypeScript/Rust monorepo that wires a multi-provider LLM loop, 32+ built-in tools, LSP, DAP, and an embedded shell into a single terminal process. Study it to understand how a production-grade agent harness manages state, tool execution, and extensibility. This is a Grok-Wiki source-grounded repository wiki. Use the complete Markdown link when an agent needs the full repo context. ## Context Links - [Complete Markdown wiki](https://grok-wiki.com/public/wiki/can1357-oh-my-pi-64b0ce1ccc45/llms-full.txt) - [Complete Markdown alias](https://grok-wiki.com/public/wiki/can1357-oh-my-pi-64b0ce1ccc45.md) - [Human interactive wiki](https://grok-wiki.com/public/wiki/can1357-oh-my-pi-64b0ce1ccc45) - [GitHub repository](https://github.com/can1357/oh-my-pi) ## Repository - Repository: can1357/oh-my-pi - Generated: 2026-05-21T22:04:00.959Z - Updated: 2026-05-21T22:21:04.433Z - Runtime: Claude Code - Format: Mental Model - Pages: 6 ## Pages - [The Mental Model — One Picture of the Whole System](https://grok-wiki.com/public/wiki/can1357-oh-my-pi-64b0ce1ccc45/pages/01-the-mental-model-one-picture-of-the-whole-system.md): The simplest useful model of omp: what it is, how its layers relate, what the invariants are, and which facts let you predict behavior without reopening the code. - [Agent Loop — The Turn Cycle & Harmony Safety Layer](https://grok-wiki.com/public/wiki/can1357-oh-my-pi-64b0ce1ccc45/pages/02-agent-loop-the-turn-cycle-harmony-safety-layer.md): How the agent loop drives LLM turns, executes tool calls, coerces malformed results, and detects GPT-5 Harmony protocol leakage — the core invariant that keeps session files valid. - [Native Layer — Rust Crates & N-API Addon](https://grok-wiki.com/public/wiki/can1357-oh-my-pi-64b0ce1ccc45/pages/03-native-layer-rust-crates-n-api-addon.md): The ~27k-line Rust underbelly: pi-natives (N-API cdylib), pi-shell (embedded bash/PTY), pi-ast (tree-sitter summarizer), pi-iso (workspace isolation), and how each module eliminates fork/exec on the hot path. - [Four Run Modes — Interactive, Print, RPC, and ACP](https://grok-wiki.com/public/wiki/can1357-oh-my-pi-64b0ce1ccc45/pages/04-four-run-modes-interactive-print-rpc-and-acp.md): Same engine, four wrappers: the TUI interactive mode, one-shot print mode, NDJSON RPC over stdio, and ACP/JSON-RPC for editors. Understand which mode owns the I/O boundary, what framing it uses, and when tool calls route through the host. - [Tools, LSP & DAP — What the Agent Can Touch](https://grok-wiki.com/public/wiki/can1357-oh-my-pi-64b0ce1ccc45/pages/05-tools-lsp-dap-what-the-agent-can-touch.md): The 32 built-in tools (read, write, bash, search, eval, fetch, gh…), the 13 LSP operations wired through workspace/willRenameFiles, and the 27 DAP operations that attach real debuggers. State ownership, caching boundaries, and what differs between tool categories. - [Extension Model — Providers, Plugins, Skills & Safe-Change Rules](https://grok-wiki.com/public/wiki/can1357-oh-my-pi-64b0ce1ccc45/pages/06-extension-model-providers-plugins-skills-safe-change-rules.md): How omp stays model-agnostic: the 40+ provider adapters in pi-ai, the plugin/marketplace loader, slash-command and skill registration, hook injection, MCP wiring, and the discovery pass that inherits rules from .claude/.cursor/.windsurf on first run. Closes with invariants for adding providers or extensions without breaking the session contract. ## Source Files - `Cargo.toml` - `crates/pi-ast/Cargo.toml` - `crates/pi-iso/Cargo.toml` - `crates/pi-natives/build.rs` - `crates/pi-natives/Cargo.toml` - `crates/pi-shell/Cargo.toml` - `packages/agent/src/agent-loop.ts` - `packages/agent/src/agent.ts` - `packages/agent/src/compaction.ts` - `packages/agent/src/harmony-leak.ts` - `packages/agent/src/run-collector.ts` - `packages/agent/src/telemetry.ts` - `packages/agent/src/thinking.ts` - `packages/agent/src/types.ts` - `packages/ai/src/models.json` - `packages/ai/src/providers` - `packages/coding-agent/src/dap` - `packages/coding-agent/src/discovery` - `packages/coding-agent/src/extensibility/extensions` - `packages/coding-agent/src/extensibility/plugins` - `packages/coding-agent/src/extensibility/slash-commands.ts` - `packages/coding-agent/src/lsp/client.ts` - `packages/coding-agent/src/lsp/index.ts` - `packages/coding-agent/src/main.ts` - `packages/coding-agent/src/mcp` - `packages/coding-agent/src/modes/acp` - `packages/coding-agent/src/modes/index.ts` - `packages/coding-agent/src/modes/interactive-mode.ts` - `packages/coding-agent/src/modes/print-mode.ts` - `packages/coding-agent/src/modes/rpc` - `packages/coding-agent/src/sdk.ts` - `packages/coding-agent/src/tools/bash.ts` - `packages/coding-agent/src/tools/eval.ts` - `packages/coding-agent/src/tools/index.ts` - `packages/coding-agent/src/tools/read.ts` - `packages/natives` - `README.md`