Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By 2233adminMIT
Zero-token scope enforcement for AI coding agents. Intercepts file edits via hooks to block out-of-scope changes.
Claude loads one when your task matches it, or you run it by name.
1 caution to review before installing
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Zero-token scope enforcement for AI coding agents.
A Claude Code plugin that intercepts file edits in real-time, blocking out-of-scope changes without consuming any LLM tokens. The interception runs as a Node.js shell process — completely outside the model context.
AI coding agents (Claude Code, Codex, Cursor, etc.) are bad at staying in scope. You ask it to fix the scheduler, it "helpfully" refactors config, updates README, and touches .env. On SWE-bench, scope drift is a leading cause of agent failure.
Current solutions:
salacia-guard takes a different approach: enforce scope at the tool level, not the prompt level. The model can "think" whatever it wants — if it tries to edit a protected file, the edit is blocked before it happens. Zero tokens spent on enforcement.
Agent receives task
│
├─ /salacia-init generates .salacia/contract.json
│ (which files are allowed, soft-allowed, protected)
│
├─ Agent works normally...
│
├─ Agent calls Edit("packages/core/src/scheduler.ts")
│ └─ PreToolUse hook → guard.mjs → in scope → ✅ allow (silent)
│
├─ Agent calls Edit(".env")
│ └─ PreToolUse hook → guard.mjs → protected → 🛡️ BLOCK
│ └─ Agent sees: "Salacia: BLOCKED — .env is a protected path"
│
├─ Agent calls Edit("README.md")
│ └─ PostToolUse hook → guard.mjs → out of scope → tracked
│ └─ drift score += 5, warn if threshold exceeded
│
└─ /salacia-status shows drift report
Key insight: hooks run as shell commands, not LLM calls. Interception is free.
This plugin draws from several research projects and papers. We didn't invent the ideas — we made them practical for everyday use.
| Paper | What we took | What we didn't |
|---|---|---|
| Salacia (StartripAI, 2025) | Contract concept: define allowed paths before execution. Drift scoring formula (out-of-scope=+5, protected=+40). | Their pre-pass layers (fault localization, repo map, intent IR). Their system is a SWE-bench harness; ours is a runtime guard. |
| AgentFL (2024) | Three-step navigation idea (understand→navigate→confirm) validated that fault localization helps agents. $0.074/bug is the bar. | Their multi-agent architecture. We're simpler — single hook script. |
| ContextCov (2025) | Agent instructions → executable constraints. Confirmed that scope can be derived from task description. | Their formal constraint language. We use glob patterns — good enough. |
| Project | What we took | Link |
|---|---|---|
| commit-prophet | Co-change coupling algorithm: coupling(A,B) = co_changes(A,B) / max(changes(A), changes(B)). We ported the core ~50 lines. | GitHub |
| Axon | Coupling threshold ≥0.3 as the default for "related files". Validated by their Tree-sitter knowledge graph. | GitHub |
| CodeScene | Commercial validation that temporal coupling works. Their "change coupling" feature proved the concept at scale. | codescene.com |
What's original in salacia-guard:
Zero-token enforcement via hooks. Everyone else injects scope into the prompt (costs tokens, model can ignore it). We enforce at the tool call level. The model literally cannot edit a protected file.
Soft/hard two-layer scope. Prior work treats scope as binary (in/out). We add a "soft allowed" zone for co-change companions — files that are related but not explicitly in scope. They don't trigger drift penalties but are tracked. This alone cut our false-positive rate from 67% to 27%.
Sibling directory inference. If the contract allows execution/scheduler.ts, we automatically soft-allow execution/**. Simple heuristic, massive impact — 21 files saved from false-positive in our test suite.
Mid-pattern glob matching. Sounds trivial, but config*.ts matching config.ts and configReader.ts is not handled by naive glob implementations. We added regex fallback for * in filename position.
The Salacia paper (StartripAI) implements 5 layers: fault localization → repo map → intent IR → contract → verify & retry. That's a SWE-bench harness — it wraps the entire agent execution.
Generated from the plugin's indexed repository (2233admin/salacia-guard) — no native marketplace selected
npx claudepluginhub p/2233admin-salacia-guardPlugins from other owners that cover similar ground
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.