safeguard

safeguard is a skill for Claude Code from Rune-kit/rune. It costs 41 tokens per session (1,951 once invoked), scanned A, original, MIT.

A preparation step for risky refactoring that records current behavior and creates points for recovery. It uses characterization tests, which describe what existing code currently does, along with boundaries and configuration protections.

In plain words
What is it for?
Use it before changing an untested or risky module. It helps identify interfaces and dependencies, write tests for existing behavior, freeze configuration, and verify the starting state.
Why use it?
Refactoring old code can accidentally change behavior that was never documented or tested. These safety nets make unexpected changes easier to detect and provide a rollback point.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the rune plugin — 66 skills, 1 command, 66 agents, 6 hooks shipped together

Good fit Use it before changing an untested or risky module. It helps identify interfaces and dependencies, write tests for existing behavior, freeze configuration, and verify the starting state.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rune-kit/rune/safeguard
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 Rune-kit/rune --skill safeguard
Clone the repo
git clone --depth 1 https://github.com/Rune-kit/rune

Made for: Claude Code.

Or install rune, the plugin that ships this one along with the rest of its 66 skills, 1 command, 66 agents, 6 hooks.

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 safeguard

README.md
[![agentmods](https://agentmods.dev/badge/skills/rune-kit/rune/safeguard/github.svg)](https://agentmods.dev/skills/rune-kit/rune/safeguard)
Your own site
<a href="https://agentmods.dev/skills/rune-kit/rune/safeguard"><img src="https://agentmods.dev/badge/skills/rune-kit/rune/safeguard/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for safeguard

Your own site · 80×15
<a href="https://agentmods.dev/skills/rune-kit/rune/safeguard"><img src="https://agentmods.dev/badge/skills/rune-kit/rune/safeguard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,951 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00041 $0.01951
Opus 5.5 $0.00016 $0.00780
Sonnet 5.5 $0.00008 $0.00390
Haiku 4.5 $0.00004 $0.00195

Measured 2d ago against content hash 0d4a43219228, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

safeguard scanned grade A with 0 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/safeguard/SKILL.md · 202 lines

How it starts

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

safeguard

Purpose

Build safety nets before any refactoring begins. Safeguard creates characterization tests that capture current behavior, adds boundary markers to distinguish legacy from new code, freezes config files, and creates git rollback points. Nothing gets refactored without safeguard running first.

Called By (inbound)

  • rescue (L1): Phase 1 SAFETY NET — build protection before surgery
  • surgeon (L2): untested module found during surgery

Calls (outbound)

  • scout (L2): find all entry points and public interfaces of the target module
  • test (L2): write and run characterization tests for the target module
  • verification (L3): verify characterization tests pass on current code

Cross-Hub Connections

  • surgeon → safeguard — untested module found during surgery

Execution Steps

Step 1 — Identify module boundaries

Call rune:scout targeting the specific module. Ask scout to return:

  • All public functions, classes, and exported symbols
  • All files that import from this module (consumers)
  • All files this module imports from (dependencies)
  • Existing test files for this module (if any)

Use Read to open the module entry file and confirm the public interface.

Step 2 — Write characterization tests

Create a test file at tests/char/<module-name>.test.ts (or .js, .py matching project convention).

Use Write to create the characterization test file. Rules for characterization tests:

  • Tests MUST capture what the code CURRENTLY does, not what it should do
  • Include edge cases that currently produce surprising output — test for that actual output
  • Do NOT fix bugs in characterization tests — if the current code returns wrong data, test for that wrong data
  • Cover every public function in the module
  • Include at least one integration test calling the module as an external consumer would

Read the full file on GitHub · 202 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. 2d ago Changed 0d4a43219228
  2. 3d ago Changed · +1 lines 0f8943e878da
  3. 8d ago First seen · 201 lines · 41 tokens per session scan A a8a572d882f7

Subscribe to this mod's changes

safeguard is a skill published in the GitHub repository Rune-kit/rune (96 stars, last pushed yesterday), licensed MIT. It adds 41 tokens to every session and 1,951 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-22.

Related

safeguard compared with skills from other repositories

safeguard next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
safeguardRune-kit/runeSkill96yesterdayMITA41Claude Code
precommitsd0xdev/sd0x-harnessSkill1965d agoMITA15Claude Code
precommit-fastsd0xdev/sd0x-harnessSkill1965d agoMITA15Claude Code
ship-itsmallnest/goal-workflowSkill3032mo agoMITA96Claude Code
commit-allsentimony/skillsSkill8todayMITA30Claude Code, Codex
Git Workflow Disciplineniels-emmer/myaceSkill1yesterdayMITA25Claude Code, Codex
dx-tdddikamilo/dx-workflowSkill81mo agoMITA27Claude Code