reins

reins is a skill for Claude Code from pegasi-ai/reins. It costs 90 tokens per session (1,444 once invoked), scanned C, original, Apache-2.0.

A security layer for Claude Code, Anthropic’s command-line coding agent, that checks agent actions against rules before and after they run.

In plain words
What is it for?
Use it to control shell commands, file edits, browser and network access, and tool calls. It can scan the environment and block actions that violate configured rules.
Why use it?
It helps prevent unsafe commands, file changes, network requests, and other restricted actions. It can also connect to Watchtower for shared policies and audit records.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions Claude Code; built for openclaw.

Part of the reins plugin — 1 skill, 2 hooks, 1 plugin shipped together

Good fit Use it to control shell commands, file edits, browser and network access, and tool calls. It can scan the environment and block actions that violate configured rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pegasi-ai/reins/skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add pegasi-ai/reins --skill skill
Clone the repo
git clone --depth 1 https://github.com/pegasi-ai/reins

Made for: Claude Code.

Or install reins, the plugin that ships this one along with the rest of its 1 skill, 2 hooks, 1 plugin.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for reins

README.md
[![agentmods](https://agentmods.dev/badge/skills/pegasi-ai/reins/skill.svg)](https://agentmods.dev/skills/pegasi-ai/reins/skill)
Your own site
<a href="https://agentmods.dev/skills/pegasi-ai/reins/skill"><img src="https://agentmods.dev/badge/skills/pegasi-ai/reins/skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,444 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 3 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00090 $0.01444
Opus 5 $0.00045 $0.00722
Sonnet 5 $0.00018 $0.00289
Haiku 4.5 $0.00009 $0.00144

Measured 8d ago against content hash 9643a7312cf9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade C, and why

reins scanned grade C with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/ensure_installed.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reaches for credential filesmediumPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

`~/.openclaw/reins`, `/etc/passwd`, `/etc/shadow`

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- BLOCKED always: `rm -rf /`, `mkfs`, `dd` to disk device, fork bombs

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- LOGGED: `git push`, `pip install`, `npm install`, `curl`, `wget`
skill/SKILL.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Reins — Runtime Security for Claude Code

Reins enforces deterministic security policies on every agent action via Claude Code. PreToolUse and PostToolUse hooks. Policies are pulled from Watchtower (app.pegasi.ai) and evaluated in <50ms with no LLM in the enforcement path.

Use reins for all commands and paths.

Step 1: Verify installation

reins --version

If the command is not found, run:

npm install -g @pegasi/reins && reins init

reins init runs an interactive wizard that:

  • Chooses your security level: permissive / balanced / strict
  • Selects modules to protect: FileSystem, Shell, Browser, Network
  • Installs PreToolUse + PostToolUse hooks into .claude/settings.json
  • Prompts for optional Watchtower connection (centralized policy + audit)
  • Runs an initial environment security scan (reins scan)

How hooks work

PreToolUse fires before every Bash, Edit, MultiEdit, Write, and MCP tool call.

Hook exit Meaning What to do
0 ALLOWED — proceed normally Continue
2 BLOCKED — policy violation Stop. Explain the block. Suggest a safe alternative. Do NOT retry.
0 + JSON decision: WARN WARNING — elevated risk Acknowledge the warning. Proceed with extra caution.

PostToolUse fires after every action (non-blocking). It appends a JSONL entry to ~/.openclaw/reins/decisions.jsonl and queues it for Watchtower batch upload.

What gets enforced

Shell (Bash tool)

  • BLOCKED always: rm -rf /, mkfs, dd to disk device, fork bombs
  • BLOCKED (user-overridable): DROP TABLE/DATABASE, TRUNCATE, DELETE without WHERE, git push --force, kill -9, pipe-to-shell (| bash, | sh)
  • WARNED: rm, chmod, chown, sudo, UPDATE without WHERE, git reset --hard
  • LOGGED: git push, pip install, npm install, curl, wget

File operations (Edit / MultiEdit / Write)

  • Writes blocked to protected paths: ~/.ssh, ~/.gnupg, ~/.env, ~/.openclaw/reins, /etc/passwd, /etc/shadow

Read the full file on GitHub · 138 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 138 lines · 90 tokens per session scan C 9643a7312cf9

Subscribe to this mod's changes

reins is a skill published in the GitHub repository pegasi-ai/reins (408 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 90 tokens to every session and 1,444 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 3 findings (reaches for credential files, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.