scope

Solid

Hard-block edits outside declared frozen directories via PreToolUse hook.

AI & Automation 367 stars 36 forks Updated today NOASSERTION

Install

View on GitHub

Quality Score: 86/100

Stars 20%
85
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# /scope — Edit Scope Guard > **Purpose:** Declare which directories are in scope for the current work session. Edits outside the declared scope are hard-blocked by a PreToolUse hook. **YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it.** --- ## Quick Start ```bash /scope freeze cli/cmd/ao/ # Freeze a single directory /scope freeze cli/cmd/ao/ skills/scope/ # Freeze multiple (additive) /scope unfreeze cli/cmd/ao/ # Remove one frozen directory /scope unfreeze # Clear ALL frozen directories /scope status # Show current lock state /scope status --json # JSON output ``` --- ## Behavior Contract When `.agents/scope.lock` declares one or more `frozen_dirs`: - Any `Edit`, `Write`, or `Bash` tool call whose target path is **outside** every frozen directory is **rejected** by `hooks/edit-scope-guard.sh` with a structured stderr reason and a non-zero exit code (Claude Code converts that into a tool-use refusal). - Edits to paths **under** any frozen directory are allowed. - When the lock file is missing OR `frozen_dirs` is empty, the hook short-circuits with exit 0 (no enforcement; allow everything). - The hook fails **open** on malformed JSON or missing target-path fields — do not block when the input contract is violated. Defensive default protects against harness changes. The lock file is written via `cli/internal/llmwiki/scope_guard.go:SafeAtomicWri...

Details

Author
boshu2
Repository
boshu2/agentops
Created
6 months ago
Last Updated
today
Language
Go
License
NOASSERTION

Related Skills