scope-guard

scope-guard is a skill for Claude Code, Codex from ALTEN-group/coding-pal. It costs 50 tokens per session (528 once invoked), scanned A, original, MIT.

A change-scope checker that compares a Git working tree with allowed paths and change limits. It can reject edits to forbidden files or changes that are larger than permitted.

In plain words
What is it for?
Use it after a focused edit, before committing, or in a continuous integration check for a pull request.
Why use it?
It prevents a narrowly requested code change from accidentally modifying unrelated files, lockfiles, or protected areas.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths.

Good fit Use it after a focused edit, before committing, or in a continuous integration check for a pull request.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alten-group/coding-pal/scope-guard
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 ALTEN-group/coding-pal --skill scope-guard
Clone the repo
git clone --depth 1 https://github.com/ALTEN-group/coding-pal

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 scope-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/alten-group/coding-pal/scope-guard/github.svg)](https://agentmods.dev/skills/alten-group/coding-pal/scope-guard)
Your own site
<a href="https://agentmods.dev/skills/alten-group/coding-pal/scope-guard"><img src="https://agentmods.dev/badge/skills/alten-group/coding-pal/scope-guard/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 scope-guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/alten-group/coding-pal/scope-guard"><img src="https://agentmods.dev/badge/skills/alten-group/coding-pal/scope-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 528 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.00050 $0.00528
Opus 5.5 $0.00020 $0.00211
Sonnet 5.5 $0.00010 $0.00106
Haiku 4.5 $0.00005 $0.00053

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

Security

Grade A, and why

scope-guard 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 24d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/scope-guard.mjs, scripts/scope-guard.test.mjs), 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.

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/scope-guard/SKILL.md · 47 lines

How it starts

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

Scope Guard

Deterministically enforce blast-radius bounds, forbidden path rules, and diff churn limits before committing changes or concluding an agent task.

When to Use This Skill

  • An AI coding agent has completed a surgical change (e.g. audit-fix, unit-test) and must verify no out-of-scope files or lockfiles were contaminated.
  • A workflow or harness hook needs to mechanically assert that git modifications remain bounded within a defined subfolder or module.
  • CI/CD pipelines need a fast, deterministic check to reject PRs that exceed churn thresholds or touch protected files.

Path resolution

Resolve references/ and scripts/ relative to this skill's install directory (the folder containing this SKILL.md). In APM consumer projects, this typically resolves to .agents/skills/scope-guard/ or .claude/skills/scope-guard/.

Workflow

  1. Read references/guard-contract.md for invariant definitions, forbidden file defaults, and exit codes.
  2. After making code changes, run the deterministic validator:
# Check current git repository against authorized scopes
node scripts/scope-guard.mjs --git --scope "src/auth/**" --scope "tests/auth/**"

# Enforce churn thresholds (max lines added / deleted)
node scripts/scope-guard.mjs --git --scope "src/**" --max-additions 80 --max-deletions 40

# Check explicit files or inspect JSON diagnostics
node scripts/scope-guard.mjs --file "src/auth/service.js" --scope "src/auth/**" --json
  1. Treat a nonzero exit code as a scope violation. If forbidden files were touched or scope was breached:
    • Revert unauthorized files: git checkout -- <unauthorized-file>.
    • Remove newly created untracked files: rm <unauthorized-file>.
    • Re-run the validator until it exits with code 0.

Done When

  • scripts/scope-guard.mjs exits with code 0.
  • All touched files reside strictly within the permitted scope patterns.
  • No forbidden files (*.lock, *-lock.json, .env*) have been modified or created.

Read the full file on GitHub · 47 lines

Files

What ships with it

3 files 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. 24d ago First seen · 47 lines · 50 tokens per session scan A 3fe338c73152

Subscribe to this mod's changes

scope-guard is a skill published in the GitHub repository ALTEN-group/coding-pal (5 stars, last pushed 5d ago), licensed MIT. It adds 50 tokens to every session and 528 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-09-24.