DStack Reflector
Review layer for DStack. Add-on for the Claude Code plugin, with a native oh-my-pi port.
Independent critic and oracle for coding agents.
The agent acts. A decision model judges changes, plans, stops, and risky commands. Code changes get a second opinion by default.
Requirements
- oh-my-pi (omp): a working
judge model role (modelRoles.judge). It answers the review questions.
- Claude Code plugin (Python):
TYPESAFE_API_KEY in the environment. Python 3.8+, standard library only. The judge calls go to the TypeSafe decision-model API.
The reflector ships in two surfaces; install whichever matches your agent:
- Claude Code plugin: the original single-file Python hook. Needs Python 3.8+ (stdlib only, no pip dependencies).
- oh-my-pi (omp): a native TypeScript port, no Python runtime. Needs the
omp CLI.
Claude Code plugin
A single-file Python hook (scripts/codex-reflector.py, stdlib only) wired through hooks/hooks.json. Requires Python 3.8+ and TYPESAFE_API_KEY in the environment.
Install
claude plugin marketplace add OutlineDriven/odin-reflector; claude plugin install codex-reflector@odin-reflector
Activation
Place this plugin at ~/.claude/codex-reflector/ and restart Claude Code.
~/.claude/codex-reflector/
├── .claude-plugin/plugin.json
├── hooks/hooks.json
├── scripts/codex-reflector.py
├── LICENSE
├── README.md
└── .gitignore
Hook events
| Event | Trigger | Mode | Purpose |
|---|
| PostToolUse | Write, Edit, Fast-Apply MCP edit | async | Decision-model scorecard review (PASS/FAIL/UNCERTAIN) |
| PostToolUse | ExitPlanMode | async | Decision-model plan review, advisory (PASS/FAIL/UNCERTAIN) |
| Stop | Agent finishing | sync | Fresh judge review; blocks on FAIL only (PASS/UNCERTAIN settle) |
Use with Cursor
Cursor can run this plugin through its Claude Code third-party hooks compatibility layer.
Install as a Cursor plugin
This repository includes native Cursor plugin metadata at .cursor-plugin/plugin.json.
To install it as a local Cursor plugin, copy or symlink this repository into:
~/.cursor/plugins/local/codex-reflector
Then reload Cursor. The plugin entry point is hooks/hooks.json, the only
component Cursor auto-discovers from this repository.
Direct-export hooks
- Enable Third-party skills in Cursor Settings.
- Install the direct-export Claude settings:
scripts/install-cursor.sh
That writes ~/.claude/settings.json with absolute paths to this checkout. To install into a specific project instead, pass the project path:
scripts/install-cursor.sh /path/to/project
Cursor compatibility notes:
PostToolUse and Stop run through Cursor's Claude hook compatibility.
- Cursor treats Claude
Stop blocks as follow-up messages, so a blocked Stop review causes the agent to continue with the judge's reason instead of hard-stopping the UI.
- The direct export mirrors the Claude plugin matcher. Cursor only fires the parts whose tool names are exposed through its Claude hook compatibility layer.
oh-my-pi (omp)
A native TypeScript port of this reflector ships at omp/codex-reflector.ts, with no Python runtime. It registers oh-my-pi extension handlers that mirror the plugin: a scorecard review on write/edit/ast_edit and Fast-Apply MCP edits, an opt-in Stop gate, and an opt-in bash guard.
Installation Guide
1. Install the omp CLI
Skip if you already have it (more options):
curl -fsSL https://omp.sh/install | sh # macOS / Linux
bun install -g @oh-my-pi/pi-coding-agent # any platform, bun >= 1.3.14
2. Install the reflector from GitHub (recommended)
Install this repository directly as an oh-my-pi plugin:
omp plugin install https://github.com/OutlineDriven/odin-reflector
The repository's package.json declares omp.extensions: ["./omp/codex-reflector.ts"], so omp installs the GitHub package and loads the native extension from that manifest. This is the canonical install path for normal use: no local clone, symlink, or config-file edit is required.
For a named omp profile, run the same command with that profile selected:
omp --profile <profile> plugin install https://github.com/OutlineDriven/odin-reflector
Behavior
Reads the shared environment variables. The TYPESAFE_* judge variables are Python-only.
Run the unit tests with bun test omp/codex-reflector.test.ts.