@jstxn/rein
v0.5.2
Published
REIN harness installer for Codex, Claude Code, and Cursor
Readme
REIN (Regulated Execution and Inference Navigation)
REIN is a lightweight and hands-off harness for stricter, more explicit engineering workflow with Codex, Claude Code, and Cursor.
It adds:
REIN.mdfor regulated execution and inference guidance- packaged skills for clarification, inspection, cleanup, triage, verification, and retrospection
.rein/as the repo-local artifact root for REIN-generated outputsrein indexfor a local, rebuildable evidence vector index over REIN artifacts
[!NOTE] New in REIN:
rein gois the runtime-backed end-to-end flow. It starts the same user-facing interview thatrein-interviewuses, then carries the task through planning, implementation, cleanup, review, and verification with durable state under.rein/.
[!IMPORTANT] New vector-backed evidence recall: run
rein index buildto give REIN a local, rebuildable index over protocol docs, skills, codebase maps, completed interviews, specs, andrein goartifacts. When the index exists,rein goautomatically attaches matching evidence to plan and stage artifacts with source paths, line numbers, and stale-source status.
New: rein go
If you want one REIN-controlled workflow instead of manually invoking each stage, start here:
rein go "add a CSV export for invoices"You can then inspect or continue the flow with:
rein go status --slug <slug> --json
rein go resume --slug <slug> --jsonIf you are using Codex or Claude Code, the same flow can be exposed through wrapper entrypoints like $rein-go and /rein-go.
What rein go gives you:
- the normal user-facing REIN interview, including the clarity score and interview question flow
- durable runtime state for the full task under
.rein/ - a runtime-backed path from interview -> plan -> implementation -> cleanup -> review -> verify
rein go status,rein go resume, andrein go advancefor inspecting or continuing the flow- the option to start from an already-completed interview bundle with
--from-interview - automatic evidence context in plan and stage artifacts when a local
rein indexis available
New: rein index
REIN can build a local evidence index from protocol docs, skills, codebase maps, completed interviews, specs, and rein go stage artifacts:
rein index build
rein index query "what constraints matter before I edit this?"
rein index statusThe index lives under .rein/index/ and is always rebuildable from source artifacts. It uses deterministic local feature-hash vectors, BM25 lexical scoring, and REIN-specific pressure signals like constraints, acceptance criteria, decision boundaries, rejected alternatives, and verification notes. Query results include source paths, line numbers, and stale-source filtering so retrieved context stays evidence, not hidden state.
When the index exists, rein go automatically queries it while generating the plan and later stage instruction artifacts. If the index is missing or stale, the flow still proceeds, but the generated artifact records that evidence status and filters stale sources instead of treating old retrieval results as active context.
Install
npm install -g @jstxn/rein
rein initInteractive install lets you choose:
- which tool to target (Codex, Claude Code, Cursor, or all)
- the current repository, another repository, or your user-level setup
Non-interactive examples:
rein init --repo # default (Codex)
rein init --repo --claude # Claude Code only
rein init --repo --cursor # Cursor only
rein init --repo --codex --claude # both
rein init --repo --codex --claude --cursor # all
rein init --repo --link # advanced: symlink packaged assets instead of copying
rein init --repo /path/to/repo --claude
rein init --user --claudeCore flow commands:
rein go "..." # start the runtime-backed REIN go flow from a fresh task
rein go --from-interview <slug|path> --json
rein go status --slug <slug> --json
rein go resume --slug <slug> --json
rein go advance --slug <slug> --stage <stage> --status <status> --json
rein index build
rein index query "what prior constraints apply here?" --json
rein index status --jsonDirect stage/runtime commands:
rein status # show what's installed and whether it's outdated
rein update # re-install REIN surfaces, replacing existing files
rein remove # uninstall REIN from the repo (interactive)
rein remove --yes # uninstall without prompts (preserves .rein/ artifacts)
rein interview init --idea "..." # start a durable interview
rein interview status --slug my-topic # inspect live interview state
rein interview resume --slug my-topic # resume a saved interview
rein interview crystallize --slug my-topic --summary '{"intent":"Clarify the implementation scope","desiredOutcome":"A verified implementation plan","transcriptSummary":"The interview captured scope, constraints, and acceptance criteria.","acceptanceCriteria":["Required checks are documented"],"constraints":["Keep the change scoped"],"decisionBoundaries":["Decide whether to plan or implement next"],"executionBridge":["plan"],"inScope":["Crystallize the interview result"],"outOfScope":["Implementing the follow-up task"],"technicalContext":["Artifacts are written under .rein/specs"]}'The --codex, --claude, and --cursor flags work with status, update, and remove too. Without flags, these commands auto-detect which tools are installed.
rein init --link and rein update --link are advanced options for users who want linked installs. Linked installs update from one source checkout, but they depend on that source path continuing to exist.
What rein init adds
| Surface | Codex (--codex, default) | Claude Code (--claude) | Cursor (--cursor) |
|---|---|---|---|
| Protocol doc | REIN.md | REIN.md | REIN.md |
| Artifact root | .rein/, .rein/codebase/ | .rein/, .rein/codebase/ | .rein/, .rein/codebase/ |
| Skills | .codex/skills/ | .claude/commands/ | .cursor/rules/ |
| Guidance block | AGENTS.md | CLAUDE.md | AGENTS.md |
All targets install the same 10 skills:
rein-gorein-interviewrein-inspectrein-triagerein-planrein-scoperein-reviewrein-cleanuprein-verifyrein-retro
By default, rein init copies these surfaces into the target. With --link, REIN symlinks the packaged docs and skills instead, while still writing repo- or user-specific guidance files normally.
How to use it
Typical workflow:
- Run
rein initin the repo you want to use. - Start a new Codex, Claude Code, or Cursor session in that repo.
- Let
AGENTS.md/CLAUDE.mdroute work throughREIN.md. - Use:
rein-gowhen you want REIN to carry one task through the full runtime-backed flowrein-interviewwhen you want the clarification stage by itselfrein-inspectfor a durable repo maprein-triagebefore ambiguous or multi-file changesrein-planto break complex work into sequenced steps with checkpointsrein-scopewhen requirements are too large, conflicting, or need negotiationrein-reviewto self-review your diff before committingrein-cleanupfor cleanup/refactor work after behavior is lockedrein-verifybefore declaring completionrein-retroafter misses or suspicious shortcuts
Inspiration
- Fear-Regulated Pressure and Verification-First Prompting -- the research paper behind REIN's protocol design
- andrej-karpathy-skills -- concise behavioral guidelines derived from Andrej Karpathy's observations on LLM coding pitfalls
Notes
- REIN is a workflow harness, not a benchmark or proof of superiority.
License
MIT
