Claude Code hook

Grip

A git hook that won't let you push code you can't explain. Quizzes you on your own diff. Works with Claude Code, Codex, Cursor.

439 stars 98 forksHooks Plugin marketplace Source

Install

Add the plugin marketplace
/plugin marketplace add guilyx/grip

Run inside Claude Code, then /plugin to pick what to install from it.

Install
pipx install grip-hook                 # or: uv tool install grip-hook

Found in the project README. Check it for setup steps after installing.

From source
git clone https://github.com/guilyx/grip.git

From the README

grip

A git hook that won't let you push code you can't explain.

Before your code leaves your machine, grip reads the diff and asks you about it: why it is
built this way, where it fails, what a malicious caller could do, how you know it works.
In the terminal, or on a whiteboard of your change in the browser. A model grades your
answers out of 100. Below your team's pass mark, the push waits.

It checks the developer, not the code. Let AI write it; just be able to defend it.
Follow one real change from commit to push
to see what it asks and how it grades.
"If I ask 'why did you do X instead of Y?', 'what happens if this actor behaves
maliciously?' [...] you should be able to answer confidently."
Mitchell Hashimoto, on X, about
the whiteboard defense (not affiliated with grip)

Try it in 30 seconds

No hook, no account, no API key: the fake provider runs the whole flow offline.

The offline grader does not read your answers, it only checks their length: twenty
characters, or the word "because", gets full marks. Any long answer passes and a row of
"idk" fails, so this shows the flow, not the grading. For questions written from your diff
and real grading, use a model you have (--provider claude-code, codex, gemini or
anthropic), or read the walkthrough.

Nothing is blocked until you install the hook with grip init.

Features

- Five questions from your diff, graded against a hidden rubric into a Grip Score out
  of 100. Never line numbers or trivia.
- grip whiteboard: your change drawn as parts and arrows in the browser, with the
  questions pinned to it, including what a malicious actor could do. Set
  hook_mode = "whiteboard" and every push is defended there.
- Works with what you have: reuse Claude Code, Codex or Gemini CLI as the model (no
  API key), or use…
Read the full README on GitHub

How hooks work

  • Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
  • They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
  • A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Claude Code docs

Details

Repository
guilyx/grip
Type
Hooks
Language
Python
License
BSD-3-Clause
Last updated
28 October 2026
Topics
aiclaude-codeclicode-reviewcodexcursordeveloper-toolsgit-hooksllmpre-commipre-push

FAQ

What is Grip?

A git hook that won't let you push code you can't explain. Quizzes you on your own diff. Works with Claude Code, Codex, Cursor. It is a hook for Claude Code, from guilyx/grip on GitHub.

How do I install Grip?

Run pipx install grip-hook # or: uv tool install grip-hook, then follow the setup in the README.

Is Grip popular?

guilyx/grip has 439 GitHub stars and 98 forks. It was last updated on 28 October 2026.

More hooks

Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.