ClaudeCodeMod

All shelves / Mods / Safety

scope-guard

By theonly1me

scope-guard is a Claude Code safety mod by theonly1me.

Asks before Claude edits, deletes, or moves files outside what you asked for, and flags milder drift above the prompt with keys to pull Claude back.

DrawsHolds a command

Install

The marketplace name is claude-code-mods.

In your shell
claude plugin marketplace add theonly1me/claude-code-mods
claude plugin install scope-guard@claude-code-mods
Open the repo

It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.

Version
0.1.0
License
MIT
Repo stars
4
Last change
2026-10-04

What it can reach

  • Draws in the session
  • Holds a command
  • Sees tool calls

Claude Code 2.1.289 or later; run /reload-plugins in an open session after installing. Each change the rules flag costs one short confirm call to the helper model, claude-sonnet-5-5 at medium effort, and Claude waits up to 20 seconds for it before the change runs; most changes never reach the model. /scope flag only flags, /scope off stops the checks, and manyFiles, 8 by default, sets how many files one turn may change.

The marketplace, claude-code-mods, holds theonly1me's eleven mods, six for work and five pixel games; each installs on its own. Stopping a change you did not ask for is why this page files it under safety. file-guard, by Singh-AP, holds writes outside the project and into .git. persona, by omeerdvrn, refuses edits outside the role you set. This one keeps your last three prompts as the task and checks each Edit, Write, NotebookEdit, and each rm, git rm, mv, or git mv against cheap rules first: a file not in your request that Claude did not read this turn, a file outside the project, a large rewrite. Only then does the helper model decide in scope, mild drift, or clear drift; if that call fails, the rules decide alone. Clear drift opens Claude Code's question dialog with Allow once, Allow for this task, and Stop.

Demo

The author's screenshot of scope-guard: a shell command that deletes the legacy folder waits on the Scope question, Claude wants to delete legacy, outside your request, with Allow once, Allow for this task, Stop, and Type something; below it, in another turn, a SCOPE band says Claude chose to delete legacy, which looks outside your request, with 7, pull back, 8, fine, and 9, allow the top folder; the status line reads scope: 1 flag. The session is the author's example.
From the author's repo.

What it hooks into

  • session.startWhen a session starts
  • command.runWhen you run its slash command/scope

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Slash commands 1

  • /scopeScope Guard: show the task, allowed paths, and recent flags. on, off, ask, or flag sets the mode.

Files

The author's README and source, 4 files. They load when you open them.

Facts

Author
theonly1me
Category
Safety
Marketplace
claude-code-mods
Repo
theonly1me/claude-code-mods
Folder
plugins/scope-guard
Version
0.1.0
License
MIT
Repo stars
4
Last change
2026-10-04
Language
TypeScript
Files
15

Other mods in Safety

installguardgrichesHolds a commandHolds a package install the registry flags, such as a made-up name, a lookalike, or an hours-old release, and asks you, with a report pane beside the question.flywheel-modHarperZ9Holds a commandHolds a risky shell or file-edit call when the Flywheel monitor flags it, shows held and passed counts above the prompt, and writes a receipt for each turn.push-gateIvanLutsenkoHolds a commandAsks before every git push the model runs, with the repository, branch, upstream, commit count, and a force-push warning, and runs the confirmed push itself.devtoolsNMenzelHolds a commandHolds a tool call at a breakpoint you set for Continue, Step, or Reject, with a dashboard pane of every call and Error Lens on why a call failed.agentic-flowruvnetHolds a commandRefuses an agentic_flow_agent call whose task matches a destructive or exfiltration pattern or passes an API key, and adds a status-line entry for the guard.agentdbruvnetHolds a commandRefuses a write to AgentDB memory that holds a key, token, password, or private key, and refuses its destructive admin tools unless you turn them on.cc-askpassGoneToneOpens a password pane when a command Claude runs asks for sudo, ssh, or git credentials, so the password goes to the program and never reaches the model.secret-envtoy-craneHolds a commandOpens a pane for typing an API key into a .env file, shows [hidden] wherever the value appears in tool results, and denies Write and Edit on that key's line.mod-blast-radiusv-amorimHolds a commandHolds a risky Bash command on a card until you choose Run or Cancel, shows what it would change first, and reads your own rules from a JSON file.mod-collision-guardv-amorimHolds a commandPauses a file edit when another open session just edited that file, and asks you to proceed, move to a worktree, cancel, or type an instruction for Claude.secret-guardvumichienHolds a commandHides secret values from your env files and secret-shaped text in tool results, tells Claude to use $NAME instead, and refuses commands that print them.blast-radiusAnthropicHolds a commandHolds a shell command such as rm -rf, a force push, a hard reset, or a migration, shows what it would touch, then asks you to proceed or cancel.
All 73 in Safety