Claude Code hook
Probity
TDD enforcement and guardrail hooks for Claude Code, Codex and Copilot CLI from the TDD Guard author.
Install
/plugin marketplace add nizos/probitygit clone https://github.com/nizos/probity.gitFrom the README
Probity Probity forces AI coding agents to follow your rules. It hooks into your agent and checks every file write and shell command before it happens. When an action breaks a rule, Probity blocks it and tells the agent why. You can use it to enforce Test-Driven Development with the built-in rule, block destructive commands, or keep unwanted patterns out of your code. Writing your own rules takes a few lines of TypeScript, and one config works across most coding agents. Probity is featured on the Modern Software Engineering channel, where Emily Bache and Nizar Selander discuss what TDD looks like when an agent writes the code. A separate Q&A with factor10's Jimmy Nilsson covers using Probity on real projects, and links the full kata run. How it works When a rule is broken, the agent sees a reason and a path forward: The agent corrects course and continues. Rules can be deterministic, matching commands or file content by string or regex, or AI-validated using official SDKs. Both kinds can read recent session activity, so actions are judged in context. Quick start Create probity.config.ts at your project root: Then wire it into your agent. One-time setup per agent. Built-in rules - enforceTdd(): failing test first, minimal implementation, refactor on green - forbidCommandPattern(): block shell commands by pattern - requireCommand(): require a prior command (e.g. tests before commit) - forbidContentPattern(): block writes containing a pattern - enforceFilenameCasing(): enforce a filename casing style FAQ Does it work with my agent? Probity currently works with Claude Code, Codex, and GitHub Copilot CLI, with more coming. Does it work with my language? Probity reads each agent's session transcript directly, so there are no per-framework reporters to install.…
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.
Details
- Repository
- nizos/probity
- Type
- Hooks
- Language
- TypeScript
- License
- MIT
- Last updated
- 26 October 2026
- Topics
- agentic-codingclaude-codecodexcoding-agentgithub-copilotguardrailshookspolicytdd
FAQ
What is Probity?
TDD enforcement and guardrail hooks for Claude Code, Codex and Copilot CLI from the TDD Guard author. It is a hook for Claude Code, from nizos/probity on GitHub.
How do I install Probity?
Run /plugin marketplace add nizos/probity inside Claude Code, then follow the setup in the README.
Is Probity popular?
nizos/probity has 241 GitHub stars and 30 forks. It was last updated on 26 October 2026.
More hooks
Claudecode Rule2hook
403zxdxjtu/claudecode-rule2hook
Transform natural language project rules into Claude Code automation hooks - Write rules in plain English and let Claude automatically generate powerful hooks for code formatting, testing, validation and more
Claude Office
331W17ant/Claude-Office
A pixel art virtual office that visualizes your AI agents working in real-time. Claude Code hooks, WebSocket events, and isometric pixel art.
TypeScript Quality Hooks
179bartolli/claude-code-typescript-hooks
Hooks that run TypeScript type checks, ESLint and Prettier automatically after Claude edits files.
Claude Code Pro Course
339justxor/claude-code-pro-course
Claude Code PRO — полный курс и гайд на русском: CLAUDE.md, settings, skills, subagents, hooks, MCP, плагины, CI. 8 лабораторных, библиотека промптов и готовый starter-kit. Здесь бесплатные курсы по chatgpt -
cchooks
131GowayLee/cchooks
Python SDK that simplifies parsing hook input and returning decisions for Claude Code hooks.
Workout Gate
220BotchetDig/workout-gate
Joke hook that blocks your prompt until you finish push-ups counted by webcam.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.