scope — Claude Code command: scope check and setup
scope is a Claude Code command that checks hosts and URLs before active testing. It blocks assets outside engagement rules during security work.
MIT ★ 16,193 updated 2026-10-29
/plugin marketplace add elementalsouls/Claude-BugHunter
/plugin install claude-bughunter@elementalsoulsWhat scope does
scope checks each host or URL before any active testing begins. It reads allow and deny patterns from scope.md, or accepts patterns inline, then prints IN-SCOPE or OUT-OF-SCOPE <reason>. A non-zero exit status appears when any asset fails, so the result can stop an automated run.
The check runs through engine/scope.py rather than model judgement. It handles an apex domain and its subdomains, wildcard entries such as *.acme.com, exact hosts, CIDR ranges like 10.0.0.0/8, and regex rules marked with re:. Deny rules win when patterns overlap. An empty allow-list rejects every asset, so scope.md must contain the engagement rules first.
With an unfilled scope.md, the command stays in default-deny mode and rejects the assets it receives.
What it helps with
- check a host before sending HTTP requests
- match an asset against
scope.mdrules - halt testing when an asset is out of scope
- validate IPs with CIDR and hosts with regex
Example prompts for the agent
- Run
/scope api.acme.combefore testing the host. - Check
api.acme.com,staging.acme.io, andadmin.acme.comwith/scope api.acme.com staging.acme.io admin.acme.com. - Use the rules in
scope.mdand stop when the result isOUT-OF-SCOPE.
How to install scope
1Plugin marketplace
/plugin marketplace add elementalsouls/Claude-BugHunter/plugin install claude-bughunter@elementalsouls2Manually: put the files in place
.claude/commands/scope.mdCall it with /scope. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/scope.mdCall it with /prompts:scope. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/scope.prompt.mdManually: put the files in place
.gemini/commands/scope.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about scope
How do I install scope in Claude Code?
Add the marketplace with /plugin marketplace add elementalsouls/Claude-BugHunter, then install the plugin with /plugin install claude-bughunter@elementalsouls. The command is stored at .claude/commands/scope.md.
What does scope do?
It checks hosts and URLs against engagement scope rules before active testing. If any asset is rejected, the command reports the reason and exits with a non-zero status.
What happens when an asset matches both allow and deny rules?
The deny rule takes precedence, so the asset is marked OUT-OF-SCOPE. An empty allow-list also rejects every asset.
Source text
scope.md · MIT
--- name: scope description: Mandatory pre-flight scope check — verify an asset is in scope BEFORE any HTTP touch. Deterministic (deny-wins, default-deny) via engine/scope.py against the engagement's scope.md. Blocks out-of-scope testing. Usage: /scope <asset> [<asset> ...] --- # /scope The mandatory pre-flight gate. Verify a host or URL is in scope **before** any active testing. Scope is enforced in **code** (`engine/scope.py`), not by LLM judgment — deny wins, default deny. ## What This Does 1. Loads in-scope / out-of-scope patterns from the engagement's `scope.md` (the `hunt` scaffold creates it) or from inline patterns. 2. Checks each asset deterministically with `engine/scope.py`: - apex `acme.com` → the apex **and** any subdomain - `*.acme.com` → any subdomain (NOT the bare apex) - `api.acme.com` → that exact host - `10.0.0.0/8` → any IP in the CIDR - `re:^lab[0-9]+\.acme\.io$` → explicit regex (prefix `re:`) 3. Prints `IN-SCOPE` / `OUT-OF-SCOPE <reason>` and exits non-zero if any asset is out of scope — so it can gate automation. ## Usage ``` /scope api.acme.com /scope api.acme.com staging.acme.io admin.acme.com ``` Under the hood, run the deterministic checker directly: ```bash # Against the engagement scope.md (preferred — fill scope.md from the program page first) python3 engine/scope.py api.acme.com --md ~/Targets/acme/scope.md # Or with inline patterns (repeat --in-scope / --out-of-scope per pattern) python3 engine/scope.py api.acme.com evil.com \ --in-scope acme.com --in-scope '*.acme.io' --out-of-scope admin.acme.com ``` ## Rules - **Run this before any HTTP touch.** An `OUT-OF-SCOPE` result is a hard stop — do not probe the asset. - If `scope.md` is still the empty template (`(paste ... here)` placeholders), fill it from the program page first; an empty in-scope list = default-deny = everything rejected, which is the safe default. - Deny wins: if an asset matches both an in-scope and an out-of-scope rule, it is out of scope.
© Sachin Sharma · MIT · elementalsouls/Claude-BugHunter