railguard CLAUDE.md

railguard CLAUDE.md is an instructions file for coding agents from railyard-dev/railguard. It costs 627 tokens per session, scanned B, original, MIT.

Session instructions for Railguard, a tool that checks coding-agent actions, records them, and saves copies of edited files.

In plain words
What is it for?
Use them when a command is denied, approval is requested, or you need session details, change comparisons, or a rollback.
Why use it?
They explain what blocked or approval-required commands mean and how to inspect or undo changes safely.

Instructions file

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.

agentmods
npx agentmods add instructions/railyard-dev/railguard/claude-md
Clone the repo
git clone --depth 1 https://github.com/railyard-dev/railguard

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 railguard CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/railyard-dev/railguard/claude-md.svg)](https://agentmods.dev/instructions/railyard-dev/railguard/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/railyard-dev/railguard/claude-md"><img src="https://agentmods.dev/badge/instructions/railyard-dev/railguard/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 627 This file is loaded in full into every session.
When invoked 627 The same file — it is already loaded in full.
Security scan B 1 finding. Scan, not verified.
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 $0.00627 $0.00627
Opus 5 $0.00313 $0.00313
Sonnet 5 $0.00125 $0.00125
Haiku 4.5 $0.00063 $0.00063

Measured 4d ago against content hash 78ddb4ab9d67, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

railguard CLAUDE.md scanned grade B with 1 finding 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 4d ago.

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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- Modify `~/.claude/settings.json` — it will be blocked.
CLAUDE.md · 48 lines

How it starts

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

Railguard — Active Guardrails

Railguard is monitoring this session. Every tool call (Bash, Write, Edit, Read) passes through Railguard before execution.

What you need to know

  • Some commands will be blocked. If you see a "denied" response from a hook, it means Railguard blocked the command. Do NOT retry the same command — find a safer alternative.
  • Some commands require human approval. If you see an "ask" response, the human will be prompted to approve or deny.
  • File writes are snapshotted. Every Write/Edit you make is backed up before execution. The human can rollback any change.
  • Everything is logged. All tool calls and decisions are recorded in .railguard/traces/.

If something goes wrong

If the human asks you to undo changes, fix a mistake, or rollback:

  1. Get context first. Run: railguard context --session $SESSION_ID --verbose This shows you exactly what changed, diffs, blocked commands, and available rollback commands.

  2. Check what changed. Run: railguard diff --session $SESSION_ID Or for a specific file: railguard diff --session $SESSION_ID --file <path>

  3. Rollback options:

    • Undo the last edit: railguard rollback --session $SESSION_ID --steps 1
    • Undo the last N edits: railguard rollback --session $SESSION_ID --steps N
    • Restore a specific file: railguard rollback --session $SESSION_ID --file <path>
    • Restore everything: railguard rollback --session $SESSION_ID
    • Restore a specific snapshot: railguard rollback --session $SESSION_ID --id <snapshot-id>
  4. Find your session ID. Run: railguard log This lists all sessions. Pick the most recent one.

Configuring Railguard

You can help the user customize their Railguard policy. This is encouraged:

  • Read railguard.yaml to understand the current policy.
  • Propose edits to railguard.yaml — the user will be prompted to approve before any change is applied.
  • Run railguard init to generate a starter railguard.yaml if one doesn't exist (user approves).
  • Run railguard status to show the current protection state. All changes to Railguard policy require explicit human approval. You generate the change, the user reviews and accepts or rejects it. Changes take effect on the next tool call — no restart needed.

Read the full file on GitHub · 48 lines

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. 4d ago First seen · 48 lines · 627 tokens per session scan B 78ddb4ab9d67

Subscribe to this mod's changes

railguard CLAUDE.md is an instructions file published in the GitHub repository railyard-dev/railguard (38 stars, last pushed 5mo ago), licensed MIT. It adds 627 tokens to every session, about $0.0031 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

bifrost AGENTS.md

AGENTS.md instructions for maximhq/bifrost, covering agents.md — bifrost ai gateway, what is bifrost?, repository layout, go workspace and build, test & dev commands.

maximhq/bifrost · 12,300 tokens

Doberman-Core AGENTS.md

AGENTS.md instructions for DobermanCore/Doberman-Core, covering claude.md — doberman operating manual, 0. on startup (every session), 1. what this repository is, 2. architecture & extension points and 3. prime directives (non-negotiable).

DobermanCore/Doberman-Core · 3,567 tokens

agentscope-runtime copilot-instructions.md

Instructions for agentscope-ai/agentscope-runtime, covering agentscope runtime code review guide, 1. code quality, 2. [must] code security, 3. [must] testing & dependencies and 4. code standards.

agentscope-ai/agentscope-runtime · 646 tokens

agent-guardrails-template CLAUDE.md

Instructions for TheArchitectit/agent-guardrails-template, covering project guidelines, 0. navigation maps (read first), 0.1 agent-gdui-2026 initialization context, 1. context & setup and 2. token-saving rules (strict).

TheArchitectit/agent-guardrails-template · 712 tokens

FeatherlaneAI AGENTS.md

Instructions for ducnguyen67201/FeatherlaneAI, covering repository agent instructions, skills, architecture: rust backend is the source of truth, page integration expectations and implementation checklist.

ducnguyen67201/FeatherlaneAI · 4,372 tokens

vibeguard AGENTS.md

AGENTS.md instructions for majiayu000/vibeguard, covering agent instructions, scope, start here, core rules and delivery policy.

majiayu000/vibeguard · 1,335 tokens