{"slug": "turn-superlogical-s-rex-into-an-ai-harness", "title": "Turn Superlogical's Rex into an AI Harness", "summary": "Developer Alpcan Aydın released rexmod, an unofficial mod for Superlogical's Rex terminal that adds a review harness around coding agents including Claude Code, Codex, OpenCode and Pi. rexmod snapshots the working tree on each prompt, shows a Changes panel with Last Turn, Uncommitted, Branch and Files views, opens changed files in Neovim at the changed line, and feeds review comments back to the agent with the next message. The mod requires a Mac with Apple silicon on macOS 15 or later, Rex installed and opened once, and Homebrew, and is installed via a Homebrew tap or a one-line install script.", "body_md": "## demo.mp4\n\n<sub>One minute, sped up while the agent works. No player? [Download the video](https://github.com/alpcanaydin/rexmod/blob/main/assets/demo.mp4).</sub>\n\nRex already runs your agents. rexmod builds the harness around them: it records every turn, so you see exactly what the agent changed; it opens a real editor beside the agent to read and review that code; and it hands your review back to the agent as its next input. Prompt, change, review, feedback: the whole loop stays in one Rex window, for Claude Code, Codex, OpenCode or Pi.\n\nNote\n\nrexmod is an unofficial mod, not made by or affiliated with Superlogical. It patches your local copy of Rex so Rex loads the panel; the uninstaller puts the official build back.\n\n1. **Prompt.** Talk to your agent as usual. rexmod snapshots the working tree the moment you send.\n2. **Change.** The*Changes panel* on the right, styled like Rex's own sidebar, fills in while the\nagent works:*Last Turn* is exactly what this reply changed, next to*Uncommitted* ,*Branch* and a*Files* tree.\n3. **Review.** Click a file and it opens in Neovim beside the agent, at the changed line, with LSP,\ncompletion and live diagnostics.`Space r` on a line or a selection leaves a review comment.\n4. **Feedback.** Your comments ride along with your next message to the agent, or go right away\nfrom the panel. The agent answers them, and the next turn starts at step 2.\n\nAround the loop:\n\n- **Any language, on demand.** Open a Go, Rust, Python, Elixir… file and its tree-sitter parser and\nlanguage server are installed (Mason) and started on the spot.\n- **`⌘P` file picker** over the agent's repository, with the editor's syntax highlighting in the\npreview.\n- **Several agents per tab.** The harness follows the agent you focused last; its name at the bottom\nof the panel is a menu to switch. A note always goes to the agent it was written for.\n- **Media previews.** Images and PDFs open as pictures in the editor, videos show their first\nframe (`Space u o` plays them in the macOS app), and markdown renders in place, images included (`Space c p` opens a live browser preview).\n- **The agent knows the harness.** Every agent gets the`rexmod` skill, so it can open a file for\nyou in the editor pane (`rexmod open file:line` ) when it points you at something.\n- **Out of the way.** Hidden, the panel takes no space; the toggle sits with the pane actions,`⌘⇧E` from the keyboard. When Rex updates itself, rexmod re-applies the patch and asks you to\nreopen it.\n\n| Agent | How the harness hooks in | Last Turn | Comments with your next message | \n|---|---|---|---|\n| Claude Code | `UserPromptSubmit` /`Stop` hooks | ✓ | ✓ | \n| Codex | the same hooks (trust them once with `/hooks` ) | ✓ | ✓ | \n| OpenCode | server plugin + TUI plugin | ✓ | ✓ | \n| Pi | extension | ✓ | ✓ | \n\nYou need a Mac with Apple silicon on macOS 15 or later, [Rex](https://rex.superlogical.com) installed\nand opened once, and [Homebrew](https://brew.sh) (for Neovim, fzf and Node, if you don't have them).\n\nWith Homebrew:\n\n```\nbrew trust --tap alpcanaydin/rexmod   # Homebrew asks you to trust third-party taps\nbrew install alpcanaydin/rexmod/rexmod\nrexmod-setup\n```\n\nOr in one line:\n\n```\ncurl -fsSL https://raw.githubusercontent.com/alpcanaydin/rexmod/main/install.sh | sh\n```\n\nThen quit Rex (`⌘Q`) and open it again. Nothing is compiled on your machine. After `brew upgrade rexmod`, run `rexmod-setup` again.\n\n## What the installer does\n\n- Copies rexmod into `~/Library/Application Support/rexmod` and links`~/.local/bin/rexmod` .\n- Downloads the free [Flow Icons](https://github.com/thang-nm/Flow-Icons) pack for the file tree.\n- Editor: with no `~/.config/nvim` , installs the bundled LazyVim config there; with a lazy.nvim\nconfig, adds one plugin spec (`lua/plugins/rexmod.lua` ); with any other config, installs the bundled\none as`~/.config/rexmod-nvim` and leaves yours alone.\n- Adds `⌘P` to`~/.config/rex/init.lua` (in a managed block).\n- Hooks into each agent it finds and installs the `rexmod` skill. JSON files are backed up first.\n- Backs up the official Rex, patches it, and adds a LaunchAgent that re-patches after Rex updates.\n\nOptions: `--update-rex` installs the latest official Rex first, `--no-patch` skips the panel,\n`--no-hooks` skips the agents. From a checkout, `./install.sh` builds what it needs if Go and Xcode\nare there.\n\nImportant\n\nCodex runs new hooks only after you trust them: start Codex and run `/hooks` once. OpenCode loads\nplugins when its background server starts, so quit OpenCode once after installing.\n\n| Where | Keys | What | \n|---|---|---|\n| Rex | `⌘⇧E` | Show or hide the panel | \n| Rex | `⌘P` | Find a file in the agent's repository | \n| Panel | click a file | Open it in the editor pane | \n| Editor | `Space r` | Comment on the line, or on the selection in visual mode | \n| Comment box | `Ctrl+S` /`Esc` | Save / cancel | \n| Editor, on a noted line | `E` /`D` | Edit / delete that note | \n| Editor | `]r` /`[r` | Next / previous comment | \n| Editor | `Space R` | All comments of the repo: `Ctrl+S` sends pending ones,`Ctrl+X` deletes | \n\nThe comment badge in the panel header sends pending comments right away. Without it they ride along\nwith the next message you type to the agent, as a short list of `file:line`, the code, and your note.\n\n**Several agents in one tab.** The panel, Last Turn and your comments follow the agent pane you\nfocused last; working in the editor or a shell doesn't change that. The agent name at the bottom of\nthe panel becomes a menu to switch.\n\n```\nflowchart LR\n  subgraph Rex.app\n    panel[Changes panel<br/>RexModPanel.dylib]\n  end\n  agent[Agent pane<br/>Claude Code · Codex · OpenCode · Pi]\n  editor[Editor pane<br/>Neovim + rexmod.nvim]\n  cli((rexmod))\n  git[(.git/rexmod<br/>turns · comments)]\n\n  panel -- \"state, open, send\" --> cli\n  agent -- \"hook prompt / stop\" --> cli\n  editor -- \"comments\" --> cli\n  cli -- \"panes, splits, input\" --> rex[Rex server API]\n  cli --> git\n  cli -- \"--listen socket\" --> editor\n```\n\n- **The panel** is a Swift dylib. The installer adds a weak load command for it to Rex's executable and\nre-signs the app ad hoc. It insets Rex's own chrome and draws on Rex's backdrop, so it looks native.\n- **`rexmod`** , a Go CLI, does the work: it finds the tab's agent pane through Rex's API, diffs git\ntrees, opens files in the editor pane, and keeps comments.\n- **Last Turn** comes from two snapshots of the working tree (written with a throwaway git index, so\nyour index is untouched): one when you send a message, one when the agent finishes.\n- **Comments** live in`.git/rexmod/` of the worktree, each tied to the agent pane it was written for.\n\nUpdates: `brew upgrade rexmod && rexmod-setup`, or run the one-line install again.\n\nRex itself: Sparkle can't update a patched Rex (its installer only accepts an app signed by\nSuperlogical), so rexmod turns Sparkle's checks off and its LaunchAgent updates Rex instead, every\nhour: it downloads the official build, checks its signature, Team ID and notarization, patches it\nand asks you to reopen Rex. To do it now: `~/Library/Application\\ Support/rexmod/scripts/update.sh`.\n\nUninstall, which restores the official Rex and removes the hooks, the `⌘P` block and the files:\n\n```\n~/Library/Application\\ Support/rexmod/scripts/uninstall.sh\n```\n\n## The panel doesn't show up\n\nCheck that Rex is patched: `~/Library/Application\\ Support/rexmod/scripts/patch.sh --check`. If Rex\njust updated, reopen it once the re-patch notification arrives. The panel logs to\n`~/Library/Logs/rexmod-panel.log`; start Rex with `REXMOD_PANEL_DISABLE=1` to run it without the panel.\n\n## Last Turn stays empty\n\nThe agent's hooks aren't running. Run `~/Library/Application\\ Support/rexmod/scripts/install-hooks.sh`\nagain, then for Codex trust the hooks with `/hooks`, and for OpenCode quit it once.\n\n## Do my comments go to an agent outside Rex?\n\nNo. A note is tied to the agent pane of the tab you wrote it in. An agent running elsewhere (another terminal or app) in the same repository only gets notes written outside Rex.\n\n## Two Codex panes in the same repository\n\nCodex runs its hooks in one background server for every pane, so rexmod finds the pane by looking for the Codex that works in that folder. With two of them in the same repository it can't tell which one sent the message, and rather than guess it leaves the notes pending and records the turn without a pane. Send those notes with the comment badge in the panel: it pastes them straight into the pane the panel follows. Claude Code, OpenCode and Pi don't have this limit.\n\n## Debugging the panel\n\nDarwin notifications drive it from a shell: `notifyutil -p dev.rexmod.toggle` (also `.refresh`,\n`.snapshot`, `.dumpviews`, `.dumpchrome`, `.dumpheader`, `.dumpsidebar`). Output lands in\n`~/Library/Caches/rexmod/`.\n\n`make build`, `make panel`, `make test`, `make lint`. See [CONTRIBUTING.md](https://github.com/alpcanaydin/rexmod/blob/main/CONTRIBUTING.md) for the\nsetup and how the pieces fit together.", "url": "https://wpnews.pro/news/turn-superlogical-s-rex-into-an-ai-harness", "canonical_source": "https://github.com/alpcanaydin/rexmod/", "published_at": "2026-11-01 20:37:52+00:00", "updated_at": "2026-11-01 20:50:57.157654+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["rexmod", "Superlogical", "Rex", "Alpcan Aydın", "Claude Code", "Codex", "OpenCode", "Pi"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/turn-superlogical-s-rex-into-an-ai-harness", "markdown": "https://wpnews.pro/news/turn-superlogical-s-rex-into-an-ai-harness.md", "text": "https://wpnews.pro/news/turn-superlogical-s-rex-into-an-ai-harness.txt", "jsonld": "https://wpnews.pro/news/turn-superlogical-s-rex-into-an-ai-harness.jsonld"}}