For AI agents: this page as Markdown · llms.txt · JSON Schema

Rerail in-session surfaces

In a coding-agent session, Rerail shows a note to the agent at start, a steer when a rule is broken, a footer with counts, and /rerail on request.

Coding agent Footer On request Session identity
Claude Code Status line, beside yours /rerail Session id, working directory
OMP Widget below the editor; native footer kept /rerail Session id, working directory
Pi Widget below the editor; native footer kept /rerail Session id, working directory
Codex None (no slot) $rerail Thread id, never the latest session in a directory
Cursor None /rerail None: Cursor cannot name its session, so /rerail is repository-level

Setup

One command registers every surface; restart your coding-agent sessions afterward.

sh
npx @neralabs/rerail setup

Nothing else needs turning on. Rerail does not install the coding agents.

Commands

Every coding agent gets the same commands:

Terminal only: rerail settings, rerail status, rerail update check, rerail reset, and audits (rerail scan, in internal testing).

How each coding agent registers them

Claude Code status line

Rerail appends to your status-line command instead of replacing it; rerail install --remove restores the old one.

Details

Session-start note

Where Rerail is started, each session opens with a short note to the agent that you do not see.

It explains steers and asks the agent to check with you before turning a rule off. Rerail never writes instruction files.

What the note says

Cursor shows you nothing from a hook, so there the note also asks the agent to begin its reply with each steer's line.

The note and steers guide the agent; nothing enforces its replies.

/rerail

/rerail (Codex: $rerail; terminal: rerail session [<host> [<session-id>]]) shows what Rerail is doing in this session, then every command.

text
● Rerail is on in this repo · acme-web
  26 rules · steered 1× in this session
  See what it logged → http://127.0.0.1:4737/?sessionId=…&host=claude-code#sessions

Commands
/rerail-manage       open the dashboard
…
Or just ask me, in plain words.

In a terminal: rerail status · rerail version · rerail update · rerail daemon stop

Steer

A steer has two parts: a block only the coding agent reads, and one line per rule for you.

What the agent reads

text
<lead>
- <path>:<line>:<col> — <message> [<rule id>]
  Suggested fix: replace 14:3–14:12 with `logger.info(user)`
- <path> — <message> [<rule id>]
- <message> [<rule id>]
<latitude>

A lead says what Rerail did. Each finding gives its place, message and rule id, sometimes a suggested fix.

Finding format and limits

Findings appear in the order found. The place is path:line:col, the bare path for a whole-file finding, or omitted without a path.

A suggested fix follows its finding: Suggested fix: delete <range>, Suggested fix: replace <range> with <code>, or, over several lines, Suggested fix, replacing <range>: and a ~~~ fence. Ranges use an en dash (3:1–5:2). Fixes over 240 characters end in … (truncated).

The block has no Rerail vocabulary: no glyphs, modes, packs or links.

Repository text (paths, captured code, fixes) is cleaned: control and invisible characters go, and line breaks inside a line become spaces. Parts are capped and marked …: places, rule ids and tool names at 300 characters, message lines at 600, a whole message at 2,000, and snippets at their first line and 80 characters.

Leads by trigger
Trigger Lead
An edit's check Rerail found 1 problem in your last edit: (N problems)
A check re-run after its sources changed Rerail re-checked; still open:
Findings arriving after the agent moved on Rerail finished checking your earlier edits after you moved on:
A repository audit Rerail checked the repository and found 1 problem: (N problems)
A tool call or conversation rule Rerail has guidance for this <Tool> call:, or Rerail has guidance for this step: with no tool named

The latitude closes it: Fix it, or tell the user in one line why you won't and run `rerail feedback <rule-id> '<that line>'`. rerail feedback keeps the reason on this computer (Steer feedback).

Latitude variants and modes

Block-mode rules steer the same way; blocking is not built yet. Log-mode rules never reach a session.

What you see

One line per rule, ◆ Rerail · <rule id>  steered  ·  why?, where why? opens the rule on your dashboard.

Mark, link and glyphs
Per-agent placement and turn-end steers

Where your line appears, and what happens to a steer found as the turn ends:

When a steer arrives

Each coding agent waits briefly after an edit for its check, so the steer lands under that edit. A steer never becomes your message.

Wait times

Slower checks steer at the next hook, reply or poll. The waits are fixed, not per rule.

How each agent carries a steer

A steer never becomes your message, before or after the agent compacts its context:

Experimental steer features (missed-steer digest, rewind and subagent strategies) are off unless you turn them on.

Edits made by shell commands and before rules are ready

Rerail checks shell-written files when the command finishes. Edits made while a large repository indexes are checked in the first pass after.

Shell edits and indexing

In a large repository, Rerail indexes at session start before code rules can run; nothing waits for it.

When the daemon is down

A hook never fails a tool call; the footer says not running.

Behaviour without a daemon

Events the OMP or Pi extension cannot hand to the daemon are recorded as a gap, not lost silently. Meanwhile the footer adds Rerail: N session events dropped — daemon not answering (not under silent), and the dashboard timeline counts the events that never arrived.

The footer shows the session's rule count, steers and any problem state.

text
R E R A I L ● 26 rules · steered 3×

· steered N× appears only above zero. Other states:

Footer Meaning
R E R A I L ○ not on here Not started here, or stopped
R E R A I L ○ not set up · rerail start Started, but no rules set up
R E R A I L ✕ not running No daemon answers
R E R A I L ● session unavailable Session not recorded yet

It refreshes every five seconds and only reads: it never starts a daemon, runs a check or writes anything.

Suffixes appended when they apply

The footer never animates. Full audits and rule lists are on the dashboard.

What the numbers mean

Rules is the session's configured coverage. Steered counts steer lines you saw. Unknown is shown as unavailable, never as zero.

Exact counting

R E R A I L and the steer count link to this session on the dashboard; the rule count links to the rules page.

Colours

Steer lines in Claude Code and OMP are clickable (OSC 8) links in terminals known to draw them; elsewhere the URL is printed.

Supported terminals and overrides

The footer always carries its links; your terminal decides if they are clickable.

A session link opens the dashboard's Sessions view on one session.

text
http://127.0.0.1:<daemon-port>/?sessionId=<encoded-id>&host=<encoded-host>#sessions

The silent preference hides the footer and dropped-events line without changing enforcement.

Rules stay on, steers arrive, modes hold, and /rerail, $rerail, the CLI and the API still answer. Set it through the daemon's API (also an MCP tool); there is no settings screen or file yet.

API, precedence and storage
Operation Purpose
GET /api/presentation-preferences List stored preferences
PUT /api/presentation-preferences Set { repository, host, presence }
DELETE /api/presentation-preferences?repository=…&host=… Remove an override, revealing the next
GET /api/presentation?repository=…&host=…[&sessionId=…&onDemand=true] Resolve the preference, optionally with session counts

A preference is compact (default) or silent, keyed by repository and coding agent; empty means all. The most specific wins: repository and agent, repository, agent, database default, then compact. Removing an override reveals the next.

Preferences live in the Rerail database and survive rerail reset.

References

Coding-agent docs: Claude status lines, Claude skills, Claude settings and worktree precedence, Codex configuration.