safety-check

safety-check is a command for Claude Code from latestaiagents/agent-skills. It costs 14 tokens per session (617 once invoked), scanned C, original, MIT.

A command for reviewing risky operations before they change databases, files, Git history, deployments, or APIs.

In plain words
What is it for?
Use it before deleting data, removing files, resetting or force-pushing Git, changing production systems, or making bulk API changes.
Why use it?
It checks the environment, likely impact, backups, dependencies, and recovery options before an operation that may be hard to undo.

Command for Claude Code

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

Part of the latestaiagents plugin — 47 skills, 10 commands, 7 plugins shipped together

Good fit Use it before deleting data, removing files, resetting or force-pushing Git, changing production systems, or making bulk API changes.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/latestaiagents/agent-skills/safety-check
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.

Clone the repo
git clone --depth 1 https://github.com/latestaiagents/agent-skills

Made for: Claude Code.

Or install latestaiagents, the plugin that ships this one along with the rest of its 47 skills, 10 commands, 7 plugins.

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 safety-check

README.md
[![agentmods](https://agentmods.dev/badge/commands/latestaiagents/agent-skills/safety-check/github.svg)](https://agentmods.dev/commands/latestaiagents/agent-skills/safety-check)
Your own site
<a href="https://agentmods.dev/commands/latestaiagents/agent-skills/safety-check"><img src="https://agentmods.dev/badge/commands/latestaiagents/agent-skills/safety-check/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 safety-check

Your own site · 80×15
<a href="https://agentmods.dev/commands/latestaiagents/agent-skills/safety-check"><img src="https://agentmods.dev/badge/commands/latestaiagents/agent-skills/safety-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 617 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00014 $0.00617
Opus 5 $0.00007 $0.00309
Sonnet 5 $0.00003 $0.00123
Haiku 4.5 $0.00001 $0.00062

Measured 9d ago against content hash 5fb72ab577b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

safety-check scanned grade C 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 9d 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.

Recursive force deletehighDestructive command

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

| `rm -rf` on directory | CRITICAL | Path verification + confirmation |
commands/safety-check.md · 97 lines

How it starts

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

/safety-check

Run comprehensive safety checks before any destructive operation.

What Are You About To Do?

Tell me the operation and I'll assess the risks:

  • Database: DELETE, DROP, TRUNCATE, migrations, resets
  • Files: rm, mv, bulk operations, directory cleanup
  • Git: force push, reset --hard, rebase, clean
  • Deployment: production deploys, rollbacks, scaling
  • API: DELETE endpoints, bulk updates, cache flush

Safety Check Protocol

1. Environment Verification

# What environment are we in?
echo $NODE_ENV
echo $RAILS_ENV
echo $APP_ENV

# What database are we connected to?
echo $DATABASE_URL

RED FLAG: If you see "production", "prod", or "live" - STOP and verify intent.

2. Impact Assessment

I'll analyze:

  • Scope: How many records/files affected?
  • Reversibility: Can this be undone?
  • Dependencies: What else will break?
  • Users affected: Who will notice?

3. Pre-Operation Checklist

Before ANY destructive operation:

  • Environment confirmed (not production unless intended)
  • Backup created
  • Impact scope understood
  • Recovery plan documented
  • Team notified (if shared resources)

4. Backup Creation

# Database
pg_dump database_name > backup_$(date +%Y%m%d_%H%M%S).sql

# Files
cp -r target_directory target_directory.backup.$(date +%Y%m%d_%H%M%S)

# Git
git stash push -m "safety backup"
git branch backup-$(date +%Y%m%d_%H%M%S)

5. Confirmation Protocol

I will ALWAYS show you:

⚠️ DESTRUCTIVE OPERATION WARNING

Operation: [specific command]
Environment: [dev/staging/prod]
Impact: [exactly what will be affected]
Reversibility: [can this be undone?]

Type "[specific confirmation phrase]" to proceed.

Quick Reference

Operation Risk Level Requires
DROP DATABASE CRITICAL Full backup + explicit confirmation
DELETE without WHERE CRITICAL Explicit confirmation
rm -rf on directory CRITICAL Path verification + confirmation
git push --force HIGH Branch check + team notification
git reset --hard HIGH Stash uncommitted changes first
Database migration MEDIUM Check existing data + backup
rm single file LOW Verify file path

Read the full file on GitHub · 97 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. 9d ago First seen · 97 lines · 14 tokens per session scan C 5fb72ab577b0

Subscribe to this mod's changes

safety-check is a command published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 14 tokens to every session and 617 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.