pre-edit-safety-gate

pre-edit-safety-gate is a skill for Claude Code, Codex from rexleimo/aios. It costs 68 tokens per session (1,331 once invoked), scanned A, original, MIT.

A safety check to run before making a coordinated code, workflow, or migration change. It reviews the current Git state, relevant code and tests, and the safest shape for the proposed edit.

In plain words
What is it for?
Use it to inspect the branch and worktree, establish a baseline, locate affected modules and callers, choose whether to reuse or refactor code, and prepare focused changes.
Why use it?
It reduces the risk of changing stale code, overwriting existing work, or putting new behavior in the wrong module. If its code-graph tool is unavailable, it falls back to targeted searches and local tests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex; mentions OpenCode.

Good fit Use it to inspect the branch and worktree, establish a baseline, locate affected modules and callers, choose whether to reuse or refactor code, and prepare focused changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rexleimo/aios/pre-edit-safety-gate
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 rexleimo/aios --skill pre-edit-safety-gate
Clone the repo
git clone --depth 1 https://github.com/rexleimo/aios

Made for: Claude Code, Codex.

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 pre-edit-safety-gate

README.md
[![agentmods](https://agentmods.dev/badge/skills/rexleimo/aios/pre-edit-safety-gate.svg)](https://agentmods.dev/skills/rexleimo/aios/pre-edit-safety-gate)
Your own site
<a href="https://agentmods.dev/skills/rexleimo/aios/pre-edit-safety-gate"><img src="https://agentmods.dev/badge/skills/rexleimo/aios/pre-edit-safety-gate.svg" alt="Measured on agentmods" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,331 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.00068 $0.01331
Opus 5 $0.00034 $0.00665
Sonnet 5 $0.00014 $0.00266
Haiku 4.5 $0.00007 $0.00133

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

Security

Grade A, and why

pre-edit-safety-gate 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 7d 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.

skill-sources/pre-edit-safety-gate/SKILL.md · 114 lines

How it starts

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

Mutation Safety Preflight

Run this preflight before a cohesive code, workflow, or migration change. Its purpose is to establish a current baseline and a maintainable design; it is not a per-keystroke approval system.

1. Establish a Safe Baseline

  1. Inspect the worktree with git status --short, the current branch, and its upstream before changing files.
  2. When the worktree is clean and the branch has an upstream, run git pull --ff-only to obtain the latest code without creating a merge.
  3. If the worktree is dirty, the branch has no upstream, or fast-forwarding fails, do not stash, reset, rebase, force-pull, or discard work. Record the condition and continue only within the known baseline when doing so is safe.
  4. Update the CRG code graph before planning. Then use the graph to locate the relevant module, callers, dependencies, and existing tests. If CRG is not available, record that fact and use targeted rg searches plus local tests as the fallback.

2. Decide the Appropriate Change Shape

Plan before a cohesive edit batch, not before every file save. First state the requested public behavior, its owning domain or layer, the relevant existing modules, and the focused verification command. Then decide which shape is supported by the evidence:

  • Local change. Use when the existing module owns the behavior and can express the request without duplicating responsibility or leaking internals.
  • Extend or reuse. Use an existing domain module, abstraction, utility, or adapter only when its purpose and contract match the new behavior.
  • Refactor or extract. Treat a refactor as part of the authorized request when duplicate or closely related capabilities, unclear ownership, or tight coupling prevent a correct and maintainable implementation. State the affected boundary, compatibility expectation, and migration steps.

Do not treat "smallest change" or "reuse first" as reasons to preserve an unsuitable design. The smallest maintainable change is the smallest complete design that correctly supports the request and leaves responsibility clear.

Read the full file on GitHub · 114 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. 7d ago First seen · 114 lines · 68 tokens per session scan A 113eb22cd0f9

Subscribe to this mod's changes

pre-edit-safety-gate is a skill published in the GitHub repository rexleimo/aios (52 stars, last pushed yesterday), licensed MIT. It adds 68 tokens to every session and 1,331 once invoked, about $0.0003 per session on Opus 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-08-30.

Related

Other skills, from other repositories

new-gh-issue-orchestration

Orchestrates a GitHub-issue-driven delivery workflow from issue intake to PR creation using reviewer-first then worker execution. Invoked when the user provides a GitHub issue link/number and asks to start end-to-end delivery.

soulcodex/agentic · 54 tokens

pull-request-automation

Audits and improves the pull request workflow for a GitHub repository. Covers PR description templates, auto-labelling, CODEOWNERS, PR size checks, and branch protection rules. Invoked when the user asks to improve the PR process, set up PR automation, or add a PR template.

soulcodex/agentic · 65 tokens

powerskills-workiq

Microsoft 365 automation via Work IQ (Graph-backed CLI). Ask natural-language questions against Outlook mail, calendar, Teams messages, SharePoint, OneDrive, and People. Fetch entities by URL, run OpenAPI actions (sendMail, copy, move), call functions (getSchedule, delta, reminderView), list Work IQ agents. Use when…

aloth/PowerSkills · 101 tokens

powerskills-browser

Edge browser automation via Chrome DevTools Protocol (CDP). List tabs, navigate, take screenshots, extract page content/HTML, execute JavaScript, click elements, type text, fill forms, scroll. Use when needing to control Edge browser, scrape web content, automate web forms, or take browser screenshots on Windows.…

aloth/PowerSkills · 80 tokens

powerskills

Windows automation toolkit for AI agents. Provides Outlook email/calendar (COM), Microsoft 365 mail/calendar/Teams/SharePoint/OneDrive via Work IQ CLI, Edge browser (CDP), desktop screenshots/window management, and shell commands via PowerShell. Install this for the full suite, or install individual sub-skills…

aloth/PowerSkills · 92 tokens

powerskills-desktop

Windows desktop automation. Take full-screen or window screenshots, list/focus/minimize/maximize windows, send keystrokes, launch applications. Use when needing to capture the Windows screen, manage windows, send keyboard input, or start programs.

aloth/PowerSkills · 53 tokens