zkoekl/drift-guard
Catch and prevent AI coding agents drifting from your plan and instructions (Cursor-first).
field: Developer tools
stack: Go
ARCHETYPE
Automator
Hooks on every lifecycle event: format, lint, notify, log.
GUARDRAILS
3/5
Blocks destructive commands · Pre-tool screening hook · No YOLO mode · details
Quality 23/100 Guardrails v2
Copy this rig
# review before running: this installs third-party code
$ npx degit zkoekl/drift-guard/.claude ./rig-drift-guard # inspect, then merge into .claude/ MCP servers are added to Claude Code at local scope; env vars are shown as YOUR_… placeholders — we never store values. Files are fetched with degit into a separate folder so you can review before merging.
$ npx degit zkoekl/drift-guard/docs/install/skills/advisory-scan .claude/skills/advisory-scan $ npx degit zkoekl/drift-guard/docs/install/skills/check-ambiguity .claude/skills/check-ambiguity $ npx degit zkoekl/drift-guard/docs/install/skills/handoff-constraints .claude/skills/handoff-constraints $ npx degit zkoekl/drift-guard/docs/install/skills/verify-before-done .claude/skills/verify-before-done
Merge into .claude/settings.json (project) or ~/.claude/settings.json (user). Hook commands reference scripts in the source repo — copy those too.
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PROJECT_DIR}/.cursor/hooks/drift-guard.sh"
},
{
"type": "command",
"command": "drift-guard hook"
}
]
},
{
"matcher": "Read|Write|Edit|MultiEdit|NotebookEdit|Grep",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PROJECT_DIR}/.cursor/hooks/drift-guard.sh"
},
{
"type": "command",
"command": "drift-guard hook"
}
]
}
]
}
} Skills (4)
Hooks (12)
| event | matcher | runs |
|---|---|---|
| PreToolUse | Bash | ${CLAUDE_PROJECT_DIR}/.cursor/hooks/drift-guard.sh |
| PreToolUse | Read|Write|Edit|MultiEdit|NotebookEdit|Grep | ${CLAUDE_PROJECT_DIR}/.cursor/hooks/drift-guard.sh |
| PostToolUse | Bash | ${CLAUDE_PROJECT_DIR}/.cursor/hooks/drift-guard.sh |
| SessionStart | * | ${CLAUDE_PROJECT_DIR}/.cursor/hooks/drift-guard.sh |
| UserPromptSubmit | * | ${CLAUDE_PROJECT_DIR}/.cursor/hooks/drift-guard.sh |
| Stop | * | ${CLAUDE_PROJECT_DIR}/.cursor/hooks/drift-guard.sh |
| PreToolUse | Bash | drift-guard hook |
| PreToolUse | Read|Write|Edit|MultiEdit|NotebookEdit|Grep | drift-guard hook |
| PostToolUse | Bash | drift-guard hook |
| SessionStart | * | drift-guard hook |
| UserPromptSubmit | * | drift-guard hook |
| Stop | * | drift-guard hook |
Cursor rules (2)
drift-guard · alwaysdrift-guard · always
Similar rigs
princelundgren/prince-skills
Rules, skills, agents and hooks that make coding agents check facts, own mistakes and pressure-test plans. For Claude Code, Qwen Code and Kiro CLI.
Minimalist 772 tok · · Q0
wondping0/wondev
Write your AI agent knowledge once. Compile it to every agent config format - CLAUDE.md, AGENTS.md, .cursor/rules and more.
Pragmatist 229 tok · · Q0
oscar-chw/agent-harness
One standard-library install of shared rules, memory and retrieval for Claude Code, Codex, Copilot, Cursor, Gemini CLI and two more AI coding tools (as far as each supports them), plus a fail-closed command guard for Claude Code. The guard
Skill Collector 1.1k tok · · Q5
acyclic-labs/sdk
Open-source Acyclic SDK and in-memory reference providers
Skill Collector 4.2k tok · · Q3