tdd-start

tdd-start is a command for Claude Code from hculap/better-code. It costs 8 tokens per session (829 once invoked), scanned A, original, MIT.

A session command that turns on strict test-driven development, or TDD: writing tests as part of the process of building code.

In plain words
What is it for?
Use it before coding when you want the session to follow TDD practices for projects using npm, pytest, or Go tests.
Why use it?
It records the project’s test command and activates the settings used to enforce the selected TDD mode.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the tdd-dev plugin — 1 skill, 5 commands, 1 agent, 3 hooks shipped together

Good fit Use it before coding when you want the session to follow TDD practices for projects using npm, pytest, or Go tests.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/hculap/better-code/tdd-start
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/hculap/better-code

Made for: Claude Code.

Or install tdd-dev, the plugin that ships this one along with the rest of its 1 skill, 5 commands, 1 agent, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tdd-start

README.md
[![agentmods](https://agentmods.dev/badge/commands/hculap/better-code/tdd-start/github.svg)](https://agentmods.dev/commands/hculap/better-code/tdd-start)
Your own site
<a href="https://agentmods.dev/commands/hculap/better-code/tdd-start"><img src="https://agentmods.dev/badge/commands/hculap/better-code/tdd-start/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tdd-start

Your own site · 80×15
<a href="https://agentmods.dev/commands/hculap/better-code/tdd-start"><img src="https://agentmods.dev/badge/commands/hculap/better-code/tdd-start.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 829 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00008 $0.00829
Opus 5.5 $0.00003 $0.00332
Sonnet 5.5 $0.00002 $0.00166
Haiku 4.5 $0.00001 $0.00083

Measured 1mo ago against content hash 0b12c984cac8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tdd-start scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/tdd-dev/commands/tdd-start.md · 107 lines

How it starts

The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TDD Mode Activation

Activate TDD Dev Mode for this session. From now on, apply strict Test-Driven Development practices to all coding requests.

Step 1: Detect Configuration First

Before creating the flag file, detect the test command:

  1. Check for settings file: Look for .claude/tdd-dev.local.md in project root
  2. Auto-detect test command:
    • If package.json exists: Use npm test or check for vitest/jest in devDependencies
    • If pyproject.toml or pytest.ini exists: Use pytest
    • If go.mod exists: Use go test ./...
    • Otherwise: Ask user for test command
  3. Read strictness setting: Default to strict if not configured

Step 2: Create TDD Mode Flag File

CRITICAL: Create the flag file that enables hook enforcement.

  1. Ensure .claude/ directory exists in project root
  2. Create the TDD mode state file at .claude/.tdd-mode-active with the following JSON content:
{
  "active": true,
  "activatedAt": "[current ISO timestamp]",
  "strictness": "strict",
  "testCommand": "[detected or configured test command]"
}

This file signals to hooks that TDD mode is active and stores the detected configuration for use by commands and hooks.

Step 2.5: Initialize TDD Cycle State

CRITICAL: Create the cycle state file that tracks TDD phases.

Create .claude/.tdd-cycle-state with the following JSON content:

{
  "phase": "red",
  "testFilesWritten": [],
  "testsRan": false,
  "testsFailed": false
}

This file tracks the current TDD phase:

  • red: Waiting for failing test to be written and run
  • green: Test failed, now implement to make it pass
  • refactor: Tests passing, safe to refactor

The hooks use this file to enforce the TDD cycle:

  • PreToolUse (Write|Edit) blocks source file edits unless phase is "green" or "refactor"
  • PostToolUse (Bash) detects test runs and transitions phases automatically

Step 3: Session State

Set the following TDD mode state:

  • TDD Mode: ACTIVE (flag file created)
  • Strictness: [detected or default: strict]
  • Test Command: [detected command]

Read the full file on GitHub · 107 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 107 lines · 8 tokens per session scan A 0b12c984cac8

Subscribe to this mod's changes

tdd-start is a command published in the GitHub repository hculap/better-code (2 stars, last pushed 7d ago), licensed MIT. It adds 8 tokens to every session and 829 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.