Skip to content

Install

sloprail runs inside your agent as a plugin, and its hooks call a separate set of binaries (sr, sr-session, sr-file, sr-mark, sr-agent, sr-eval, sr-checks). The plugin installs those itself, so installing the plugin is the whole install.

Install sloprail per project. Run the commands below from the project’s root, once for each project you want guarded, with the scope set to that project. The rules a project writes live in its .sloprail/ directory, and the plugin that enforces them is declared in the same repository. A project with a .sloprail/ directory is guarded; a project with none is an ordinary project until its first rule.

Terminal window
claude plugin marketplace add sloprail/sloprail --scope project
claude plugin install sloprail@sloprail-marketplace --scope project

Both commands write the project’s .claude/settings.json, so the plugin is part of the repository and a teammate who opens it is offered the same install. The marketplace pins each plugin to the latest release tag, so the plugin files (hooks, skills) and the binaries below always come from the same release, never from unreleased work on main.

Verify. Start a session in the project; the first one fetches the binaries and says so. Then sr-session --version (see Verify it worked) must print a version.

install.sh takes --harness claude|codex|cursor|all to set up one harness (or several, comma-separated), and with no flag sets up each harness it finds on the machine. For Claude Code it only prints the project commands above.

install.sh also installs jq and yq when they are not on your PATH (the tests and some shipped scripts need them): with brew on macOS, with apt-get, dnf or apk on Linux when one is available (through sudo only when you are not root and sudo needs no password), otherwise the official static binary into the same directory as the sr* binaries. It prints what it installed and fails with the reason if it cannot. install.sh --tools-only [DIR] does just that step.

The rules a project writes don’t change between harnesses; these are the places the harnesses themselves differ.

Claude Code Codex Cursor
Scope project (--scope project) enabled per project, installed per user per user, plus the project’s .cursor/hooks.json for stop and sessionStart
Hooks run once the plugin is enabled run only once trusted (sr-session codex-trust) run once the plugin is loaded (stop and sessionStart: from the project’s .cursor/hooks.json)
Turn-end gates (Stop) every session every session only in the interactive terminal UI, not in cursor-agent -p
Skills loaded with the Skill tool loaded with the Skill tool there is no Skill tool: a skill counts as loaded when its SKILL.md is read

A rule that gates the end of a turn therefore does not run in cursor-agent -p, which has no Stop hook; guard that action at the tool call (a gate) or at the commit (a file-guard) instead.

The first session after the install fetches them, once: the GitHub release matching the plugin’s version (never “latest”), verified against the release’s checksums, into ~/.local/bin (set SLOPRAIL_INSTALL_DIR to choose another directory). The session says it is doing this, and says so loudly if it fails.

To install them yourself instead, set SLOPRAIL_NO_AUTO_INSTALL=1 and run

Terminal window
curl -fsSL https://raw.githubusercontent.com/sloprail/sloprail/main/install.sh | sh

or, with Go, go install ./services/... from a checkout of sloprail/sloprail. Either way, if the binaries are missing the next file write is refused with the install command, never silently let through.

A missing binary does not, however, block a plain shell command — a git commit guarded only by a gate on Bash goes through silently if sr-session can’t be found, since there is no file write for that check to attach to. Confirm the install actually worked (see below) before you rely on a guardrail whose action runs through Bash rather than a file write.

Terminal window
sr-session --version

should print a version, not a “command not found” error. If you skipped step 1 or ~/.local/bin isn’t on $PATH, this is how you find out — check it before trying a guardrail, especially one that guards a Bash command rather than a file write. Once it prints a version, a file-write guardrail’s own missing-binary refusal (the install command, repeated until it can find sr-session) is the fallback safety net, not the first check.

Write your first guardrail and watch it refuse — the Quickstart.