Claude Code hook
TDD Guard
Hook-based enforcer that blocks code changes which skip the red-green-refactor TDD cycle.
Install
/plugin marketplace add nizos/tdd-guardRun inside Claude Code, then /plugin to pick what to install from it.
npm install -g tdd-guardgit clone https://github.com/nizos/tdd-guard.gitFrom the README
TDD Guard TDD Guard grew into Probity: the same TDD enforcement, now for Claude Code, Codex, and GitHub Copilot CLI, with more reliable validation and no test reporters to set up. New projects should start there. TDD Guard remains maintained for the projects that rely on it. Automated Test-Driven Development enforcement for Claude Code. TDD Guard ensures Claude Code follows Test-Driven Development principles. When your agent tries to skip tests or over-implement, TDD Guard blocks the action and explains what needs to happen instead. Features - Test-First Enforcement - Blocks implementation without failing tests - Minimal Implementation - Prevents code beyond current test requirements - Lint Integration - Enforces refactoring using your linting rules - Customizable Rules - Adjust validation rules to match your TDD style - Flexible Validation - Choose faster or more capable models for your needs - Session Control - Toggle on and off mid-session Getting Started Requirements - Node.js 22+ - A supported test framework (Vitest, Jest, Storybook, pytest, PHPUnit, Go, Rust, RSpec, Minitest) Installation Open Claude Code in your project and run: 1. /plugin marketplace add nizos/tdd-guard 2. /plugin install tdd-guard@tdd-guard 3. /tdd-guard:setup This adds the marketplace, installs the plugin, and configures the test reporter for your project. You may need to restart your terminal session or IDE extension for the setup skill to appear. For manual installation and configuration, see the installation guide. Configuration - Custom instructions - Customize TDD validation rules - Lint integration - Automated refactoring support - Strengthening enforcement - Prevent agents from bypassing validation - Ignore patterns - Control which files are validated - Validation Model -…
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/tdd-guard
- Type
- Hooks
- Language
- TypeScript
- License
- MIT
- Last updated
- 26 October 2026
- Topics
- agentic-codingautomationclaude-codecode-qualityhooksllm-toolstdd
FAQ
What is TDD Guard?
Hook-based enforcer that blocks code changes which skip the red-green-refactor TDD cycle. It is a hook for Claude Code, from nizos/tdd-guard on GitHub.
How do I install TDD Guard?
Run npm install -g tdd-guard, then follow the setup in the README.
Is TDD Guard popular?
nizos/tdd-guard has 2,373 GitHub stars and 189 forks, and is included in 2 curated Claude Code lists. It was last updated on 26 October 2026.
More hooks
Continuous Claude V3
3.9kparcadei/Continuous-Claude-v3
Context management for Claude Code. Hooks maintain state via ledgers and handoffs. MCP execution without context pollution. Agent orchestration with isolated context windows.
Everything Claude Code
5.8kWorldFlowAI/everything-claude-code
Claude Code toolkit - agents, commands, skills, rules, and hooks for productive AI-assisted development
destructive_command_guard
6.2kDicklesworthstone/destructive_command_guard
Fast Rust PreToolUse hook that stops destructive shell, git and filesystem commands before they run.
Skillshare
2.9krunkids/skillshare
Sync skills, agents, MCP, plugins to all AI CLI tools with one command and simplify team sharing.
Claude Code Ultimate Guide
6.3kFlorianBruniaux/claude-code-ultimate-guide
The most comprehensive Claude Code guide: agentic workflows, hooks, skills, MCP servers, quizzes, and production-ready templates. 430K+ lines.
Claude Memory Compiler
1.3kcoleam00/claude-memory-compiler
Hooks that capture sessions and compile them into evolving project memory for Claude Code.
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.