By codeninja
Claude Code hook plugin that detects likely drift from user intent and forces reflection before continuing.
Scan previous Claude Code transcript history for candidate intent-drift episodes.
Dismiss a Slop Gate drift pattern when it has produced a false positive in this session or project.
Convert a Slop Gate history audit into append-only drift patterns.
Declare the goal and allowed/forbidden file scope for the current task so Slop Gate can flag scope creep and forbidden touches.
First-time Slop Gate setup for a Claude Code environment.
Matches all tools
Hooks run on every tool call, not just specific ones
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.

Slop Gate is a Claude Code plugin that adds lifecycle hooks to surface
candidate intent drift. When a drift pattern is found, the hook injects an
advisory reflection request as additional context on the current event so
Claude can see and respond to it without halting. The one exception is
PreToolUse, where the hook denies the planned tool call so the gate can
prevent drift before it runs. The reflection request states:
UserPromptSubmitThe primary detector is intentionally simple: deterministic pattern matching over hook inputs such as stop responses, subagent responses, tool plans and inputs, tool failures, task creation, and task completion. Stop and SubagentStop also include a prompt-based semantic backstop for high-confidence judgment calls about unsupported completion, validation, readiness, or user-as-tester claims. Claude Code hooks do not expose hidden chain-of-thought; Slop Gate only sees the event payloads that Claude Code provides.
claude plugin marketplace add codeninja/slop-gate from the public repo.Older entries live under docs/changelog/.
Slop Gate will automatially detect your intent as you message and interact with Claude.
To view the current intent, use the slash command:
/slop-gate:intent show
If Intent is not explicitly set, it is inferred.
Slop Gate can also detect drift against an explicit, declarative intent for the
current task. Run /slop-gate:intent set to declare the goal and the file
scope, then Slop Gate will flag attempts to touch paths outside that scope:
/slop-gate:intent set --goal "Add rate limiting to API" \
--allowed-scope "src/middleware/**" \
--forbidden-scope "db/**"
On PreToolUse for Write/Edit/MultiEdit, Slop Gate checks the target
file_path against the declared globs:
forbidden_touch (deny) — file matches a forbidden-scope glob.scope_creep (advise) — allowed-scope is set and the file matches none of
the allowed globs.For Bash, Slop Gate extracts write targets on a best-effort basis from
output redirects (> file, >> file), tee, rm, mv, cp, truncate,
and sed -i. Complex pipelines and interpreter-as-arg invocations
(python script.py out.txt) are not parsed — treat Bash coverage as advisory.
Use /slop-gate:intent show to inspect the current intent and
/slop-gate:intent clear to remove it. The intent file is project-scoped,
written to <state-dir>/intent.json.
When a drift pattern produces a false positive, use /slop-gate:dismiss to
suppress matching findings without editing or removing the pattern itself:
/slop-gate:dismiss premature_completion --substring "ready for device"
/slop-gate:dismiss forbidden_touch --project --reason "test fixtures"
Dismissals are append-only — they never rewrite the pattern repository, only
suppress matches that fit the dismissal record. Each record names a
patternId, an optional substring to narrow which match texts are
suppressed, and a scope (session by default, --project to persist across
sessions). Records live in <state-dir>/dismissals.jsonl. To undo a
dismissal, delete its line from the file by hand.
When Claude drifts inside the current conversation and the hook missed it,
use /slop-gate:slop to flag the offense, propose a reusable pattern
update, and get back on track without leaving the session:
/slop-gate:slop you keep editing the migration files after I told you they're out of scope
The command restates the original intent, names the root cause as an
abstract drift shape, and drafts a pattern diff — either a new
## Pattern: <id> section or an ### Extensions block on an existing
pattern. Nothing is written until you confirm: answer y to apply, edit
to revise the proposal, or skip to keep the correction local without
touching the repository. On y, the pattern-curator agent performs the
append-only write and npm test runs to confirm the repository still
parses. The command then continues the original task with the corrected
direction.
/slop-gate:slop operates only on the current conversation. To learn
patterns from prior Claude Code session histories, use
/slop-gate:audit-history and /slop-gate:ingest-history instead.
npx claudepluginhub codeninja/slop-gate --plugin slop-gateMulti-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Comprehensive UI/UX design plugin for mobile (iOS, Android, React Native) and web applications with design systems, accessibility, and modern patterns
Curate auto-memory, promote learnings to CLAUDE.md and rules, extract proven patterns into reusable skills.
Memory compression system for Claude Code - persist context across sessions
Standalone image generation plugin using Nano Banana MCP server. Generates and edits images, icons, diagrams, patterns, and visual assets via Gemini image models. No Gemini CLI dependency required.