rsih-codex
v0.6.0
Published
Local correction-aware memory and quality controls for Codex
Maintainers
Readme
RSIH-Codex
Codex forgets your corrections. Your harness should not.
RSIH-Codex is a local, correction-aware memory and quality-control layer for Codex. It finds explicit corrections in your previous Codex sessions, turns them into bounded personal memory, and—only with your approval—uses that memory to help Codex avoid repeating the same mistakes.
It does not retrain the model. It gives Codex better, evidence-backed instructions at the time they matter.
The value in one sentence: correct Codex once, preserve the lesson locally, and make that correction available to future Codex tasks.
Read the visual product overview
Why RSIH-Codex?
Without a harness, valuable feedback often disappears with the session:
| Without RSIH-Codex | With RSIH-Codex | | --- | --- | | You correct the same mistake again | Explicit corrections become private memory | | Every new task starts almost from zero | Relevant lessons can carry into later tasks | | Improvement is hard to measure | Changes are replay-tested and reported honestly | | Instructions drift invisibly | Every behavioral change has an exact preview | | Removing a change is risky | RSIH-Codex reverts only the state it owns |
What you get
| Learn from history | See an immediate benefit | Improve with continued use |
| --- | --- | --- |
| Onboarding scans eligible previous Codex tasks after asking permission. | Production-reviewed lessons can be activated immediately without model calls. | Later scans add new corrections to the private memory corpus and identify broader candidates. |
| Raw sessions stay in Codex storage. | You see the exact AGENTS.md change before approving it. | Broader changes must pass replay checks before they can affect Codex. |
Quick start
Requirements
- macOS or Linux
- Node.js 18 or newer for the npm launcher
- Python 3.11 or newer
- Codex CLI installed and signed in with a ChatGPT subscription
- Git available on
PATHfor isolated replay fixtures
No OpenAI API key is required. Optional replay certification uses the Codex subscription login already saved on your computer.
Install with npm
npm install --global rsih-codex
rsih-codex onboardThe npm package has no JavaScript dependencies or install-time lifecycle scripts. It ships the
validated Python core and launches it with a locally installed Python 3.11 or newer. If several
Python versions are installed, select one explicitly with
RSIH_CODEX_PYTHON=/path/to/python.
For development from a checked-out source tree, install with
uv:
uv tool install .Onboard
rsih-codex onboardThat single command guides you through:
- Readiness — verifies Codex, authentication, private state, and existing deployments.
- Consent — explains exactly what history will be read before reading anything.
- Learning — scans 90 days of eligible local history, including archives by default.
- Immediate value — shows any production-reviewed memory that can be activated now.
- Exact approval — displays the complete
AGENTS.mddiff before changing Codex. - Future value — shows what was learned and what evidence is needed for broader adaptation.
Start a new Codex session after activation so the new memory loads into context.
For a read-only first look:
rsih-codex onboard --allow-history --scan-onlyHow the learning loop works
flowchart LR
A["Past Codex sessions"] --> B["Detect explicit corrections"]
B --> C["Create private correction cards"]
C --> D{"Evidence path"}
D -->|"Production-reviewed lesson"| E["Preview immediate memory"]
D -->|"Broader behavior pattern"| F["Replay certification"]
E --> G["Exact user approval"]
F --> G
G --> H["Future Codex sessions"]
H -. "More use and corrections" .-> AImmediate memory versus future adaptation
| | Immediate reviewed memory | Broader future adaptation |
| --- | --- | --- |
| Source | A correction matching a production-reviewed lesson | Repeated correction patterns and verified controls |
| First effect | Durable global guidance in AGENTS.md | Candidate rule plus relevant task-time memory |
| Model calls | None during onboarding | Only after a separate subscription-spend approval |
| Activation | Exact diff and explicit approval | Replay certificate, exact deployment preview, and approval |
| Claim | Useful reviewed memory is active | Benefit remains unclaimed until appropriate evaluation passes |
RSIH-Codex does not silently run in the background today. Rerun rsih-codex onboard after more
Codex use to import newer corrections. This keeps history access visible and consent-based.
What is actually remembered?
RSIH-Codex looks for explicit human corrections, not every conversation detail. Eligible corrections become source-bound cards containing:
- a project scope;
- keyed matching cues;
- a bounded correction excerpt or reviewed lesson;
- a source fingerprint and detector version; and
- lifecycle state so stale evidence can be retired.
When trusted hooks are active, a later matching prompt can receive at most three reviewed lessons and three relevant correction cards. The current request always wins if it directly conflicts with historical memory.
Example
You ask Codex to add note archiving. Later, you correct it because archive and delete were conflated. RSIH-Codex can preserve the reviewed acceptance contract:
Archive retains and hides the note. Delete permanently removes it. Unless explicitly excluded, implement and verify both lifecycle paths.
On a later relevant note-library task, Codex receives that lesson instead of relying on you to repeat it.
Evidence so far
Exploratory proof of mechanism
In the corrected V7 paired benchmark, GPT-5.5 medium completed unseen synthetic note-lifecycle tasks under two conditions:
RSIH-Codex reviewed memory [#####.] 5 / 6
No reviewed memory [......] 0 / 6Observed difference: +83.3 percentage points.
The benchmark used six previously unexposed task representations, hidden state-based verifiers, balanced execution order, one attempt per arm, disabled actor web access, and Codex subscription authentication with API credentials unset.
This is promising evidence that the reviewed-memory mechanism works. It is one exploratory synthetic benchmark in one semantic task cluster. It is not evidence that RSIH-Codex makes every Codex task 83.3% better, and it does not yet prove broad or longitudinal benefit for every user.
That distinction is enforced in the product: replay certificates and historical measurements cannot silently authorize a causal benefit claim.
Privacy by design
| Data or action | RSIH-Codex behavior |
| --- | --- |
| Raw Codex sessions | Read locally after consent; remain in Codex storage |
| Derived evidence | Stored privately under ~/.codex/rsih-codex/ by default |
| Prompt matching | Uses keyed cues and keyed project scope |
| Prompt text seen by hooks | Not persisted by the hook |
| OpenAI API credentials | Not required or used |
| Subscription calls | Never started without an exact replay preview and approval |
| AGENTS.md changes | Exact diff shown before application |
| Hooks | Installed inactive and require separate trust before activation |
| Revert | Removes only RSIH-Codex-owned state |
Safety principles
- Unknown, incomplete, stale, or conflicting evidence fails closed.
- Current user instructions override historical memory.
- Holdout evidence never becomes static-rule training evidence.
- Broad behavior changes require replay certification.
- Every deployment is signed, source-bound, monitored, and reversible.
- RSIH-Codex never modifies model weights.
Commands
| Command | Purpose | Starts model calls? |
| --- | --- | --- |
| rsih-codex onboard | Guided first run, history learning, and safe activation | No |
| rsih-codex doctor | Verify the local installation and deployment health | No |
| rsih-codex run | Incrementally refresh historical evidence | No |
| rsih-codex report | Show a privacy-preserving product report | No |
| rsih-codex rules | List candidate rules and certificates | No |
| rsih-codex explain --candidate ID | Explain one candidate and its evidence gaps | No |
| rsih-codex improve | Estimate or preview an improvement | No by default |
| rsih-codex monitor | Refresh evidence and inspect deployment decisions | No |
| rsih-codex revert | Preview or remove owned integration state | No |
| rsih-codex measure | Assess what benefit evidence does and does not establish | No |
Only the exact confirmation command emitted by rsih-codex improve can start subscription replay
calls.
Project status
RSIH-Codex 0.6.0 is a technical alpha.
Ready today:
- guided, consent-based onboarding;
- local historical correction mining;
- immediate reviewed-memory activation when eligible;
- bounded project-scoped correction cards;
- subscription-only replay certification with no API key;
- exact deployment previews, health checks, monitoring, and revert; and
- validated zero-dependency npm package, Python wheel, and source distribution.
Still in progress:
- automatic background history refresh;
- a larger, multi-cluster external benchmark; and
- prospective evidence that measures benefit accumulated from each user's future corrections.
This project is independent and is not affiliated with or endorsed by OpenAI.
License
RSIH-Codex is available under the MIT License.
Development
uv sync
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run mypy src
npm test
npm pack --dry-runCurrent release verification: 837 tests passing, repository-wide Ruff checks clean, and strict mypy passing across 42 source modules.
See LOG.md for the complete implementation and verification history.
