Report Abuse

Basic Information

TDD Guard is a developer tool that enforces Test-Driven Development principles for Claude Code agents by intercepting agent tool actions and validating test-driven workflows. It integrates as a pre-tool hook in Claude Code to block implementations that skip tests or over-implement features and to require the red-green-refactor cycle. The project captures test results via language-specific reporters so the agent can be informed about failing or passing tests. It supports multiple programming languages and test frameworks and can run against a local Claude binary or the Anthropic API. The repository includes configuration options, reporters for common test runners, and guidance for adding the hook to Claude Code projects. Requirements include Node.js 18+, a Claude Code or Anthropic API key, and a supported test framework.

Links

App Details

Features
TDD Guard enforces test-first development by blocking implementation attempts when tests are not failing and by preventing code beyond the current test requirements. It provides minimal implementation checks and integrates with linting tools to encourage refactoring when tests are green. Multi-language support covers TypeScript, JavaScript, Python, PHP and Go with reporters for Vitest, Jest, pytest, PHPUnit and a Go test reporter that consumes go test -json. Session control lets you toggle enforcement on or off mid-session and clear sessions automatically. Validation is configurable with ignore patterns and project-root settings. The tool can operate via a local Claude binary or via the Anthropic API and is distributed as an npm CLI.
Use Cases
TDD Guard helps teams and developers keep agent-driven coding aligned with TDD by preventing Claude Code from skipping tests or delivering overly broad implementations. By capturing test runner output and enforcing minimal changes, it maintains the red-green-refactor workflow and reduces regressions caused by unchecked agent edits. ESLint integration offers automated refactoring guidance so refactors follow project lint rules. Configurable ignore patterns and project-root settings allow integration in monorepos and CI pipelines. The ability to toggle enforcement and clear sessions reduces friction during development. Overall it raises code quality and discipline when using Claude Code agents to write or modify code.

Please fill the required fields*