Back to browse
GitHub Repository

The Agentic Gatekeeper is a localized, autonomous AI Agent that acts as a strict pre-commit hook inside VS Code. Before you commit, the Gatekeeper reads your staged diffs, deeply cross-references them against your documented Markdown rules, and natively Auto-Patches your code to enforce 100% compliance.

5 starsTypeScript

Agentic Gatekeeper – AI pre-commit hook to auto-patch logic errors

by revanth1108·Feb 22, 2026·2 points·0 comments

AI Analysis

●●SolidBig BrainShip It

AI pre-commit hook that auto-patches logic errors against CONTRIBUTING.md rules—solves real drift but needs Windows support.

Strengths
  • Native VS Code WorkspaceEdit API means instant inline patching without file write cycles
  • Contextual rule scoping (.gatekeeper/ + recursive markdown) is thoughtful—rules decay naturally with directory scope
  • Multi-model support (Claude, DeepSeek, local Ollama) avoids vendor lock
Weaknesses
  • No Windows version; Mac + Linux only limits adoption in enterprise shops
  • Reliance on frontier models (Claude 4.6) means per-commit API cost; unclear economics at scale
Target Audience

Engineering teams using LLM code generation and custom architecture guidelines

Similar To

Conventional pre-commit hooks (pre-commit.com) · Linters (ESLint, Pylint) + custom rules

Post Description

Hey HN,

I built Agentic Gatekeeper, a headless pre-commit hook baked into the VS Code Source Control panel that autonomously patches code before you commit it.

The Problem: Whether I'm writing code manually or letting LLMs (Cursor/Copilot) generate it, keeping logic strictly in pace with local project rules (like CONTRIBUTING.md or custom architecture guidelines) is tedious. Standard linters catch syntax, but they don't catch business logic or state "You must use the Fetch wrapper for API calls in this folder".

How it works: When you stage files and trigger the hook, the extension spins up a parallel execution engine using the latest frontier models (Claude 4.6, DeepSeek V4, or local Ollama). It parses your workspace for local routing rules (e.g., .gatekeeper/*.md), evaluates the raw Git diffs, and utilizes the native VS Code WorkspaceEdit API to instantly auto-patch the logic errors directly in your editor.

It basically turns plain-English markdown into strict compiler rules that the IDE enforces before a bad commit is made.

The biggest challenge was handling multi-file concurrency and preventing race conditions when evaluating massive diffs, so I implemented a batched validation loop with explicit rollback safety checks. It natively supports OpenRouter so you can hot-swap models.

It's completely open-source. I'd love for you to try breaking it on a messy branch or poke around the multi-provider abstraction layer in the repo.

VS Code Marketplace: https://marketplace.visualstudio.com/items?itemName=revanthp... GitHub: https://github.com/revanthpobala/agentic-gatekeeper

Would love your technical feedback on the prompt orchestration or the VS Code API integration!

Similar Projects

Developer Tools●●Solid

Agentic Gatekeeper – Auto-patch your code to enforce Markdown rules

AI-powered pre-commit hook enforces your Markdown rules, but linters and husky already exist.

Solve My Problem
revanth1108
103mo ago
Developer Tools●●Solid

KanVibe – Kanban board that auto-tracks AI agents via hooks

Task cards actually contain live terminals (xterm.js) and the app will create a git worktree + tmux/zellij session when you make a task — move it to DONE and it cleans up. The hook-driven auto-moves for Claude/Codex agents cut out manual status checking, but this is an ops-y, niche tool (Node 22+, Docker, tmux/zellij) aimed squarely at people running local agent fleets.

Niche GemWizardry
rookedsysc
113mo ago