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.
git clone --depth 1 https://github.com/MadeByTokens/bon-cop-bad-copWrote 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.
[](https://agentmods.dev/commands/madebytokens/bon-cop-bad-cop/tdd-loop)<a href="https://agentmods.dev/commands/madebytokens/bon-cop-bad-cop/tdd-loop"><img src="https://agentmods.dev/badge/commands/madebytokens/bon-cop-bad-cop/tdd-loop/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.
<a href="https://agentmods.dev/commands/madebytokens/bon-cop-bad-cop/tdd-loop"><img src="https://agentmods.dev/badge/commands/madebytokens/bon-cop-bad-cop/tdd-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00009 | $0.05339 |
| Opus 5 | $0.00005 | $0.02669 |
| Sonnet 5 | $0.00002 | $0.01068 |
| Haiku 4.5 | $0.00001 | $0.00534 |
Grade A, and why
tdd-loop 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 8d 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.
This is a copy
100% identical to tdd-loop — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 556 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/tdd-loop Command
When the user runs /tdd-loop "<requirement>" [options] or /tdd-loop --requirement-file <path> [options], follow these instructions:
Trail Log (REQUIRED) - Primary Record
The .tdd-loop.log file is the AUTHORITATIVE record of all loop activity.
This is critical for context management:
- Agents write verbose output here, not to their responses
- Full mutation survivor details go here, not in state file
- Full feedback text goes here
- Archived history entries go here when truncated from state
- The state file and agent responses contain only summaries
Every significant action MUST be logged with timestamp. Use the Write tool to append entries.
Log format:
[YYYY-MM-DD HH:MM:SS] [PHASE] Message
What to log:
| Event | Log Entry |
|---|---|
| Plugin version | [INIT] Bon Cop Bad Cop v{version} |
| Loop start | [INIT] TDD loop started. Requirement: "<first 100 chars>..." |
| Language detected | [INIT] Language detected: {language} ({testFramework}) |
| State file created | [INIT] State file created: .tdd-working/state.json |
| Phase start | [ITER {n}] Starting phase: {WRITING_TESTS|WRITING_CODE|REVIEWING} |
| Agent invoked | [ITER {n}] Invoking {agent} agent... |
| Agent completed | [ITER {n}] {agent} completed. Files: {list} |
| Agent verbose output | [ITER {n}] [{agent}] {detailed analysis, reasoning, progress} |
| Tests run | [ITER {n}] Tests executed: {passed}/{total} passed |
| Flaky detected | [ITER {n}] Flaky tests found: {list} |
| Cheating detected | [ITER {n}] Cheating patterns found: {list} |
| Mutation score | [ITER {n}] Mutation score: {score}% ({killed}/{total} mutants) |
| Mutation survivors | [ITER {n}] Surviving mutants: {full list of survivors} |
| Verdict issued | [ITER {n}] Verdict: {verdict}. Feedback: "{full feedback text}" |
| Iteration complete | [ITER {n}] Iteration complete. Next phase: {phase} |
| History archived | [HISTORY] Archived iteration {n}: verdict={v}, mutationScore={s}, survivors=[...] |
| Loop complete | [COMPLETE] Loop finished: {reason}. Total iterations: {n} |
| Error | [ERROR] {error description} |
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.
- 8d ago First seen · 556 lines · 9 tokens per session scan A 432f6718e841
tdd-loop is a command published in the GitHub repository MadeByTokens/bon-cop-bad-cop (1 stars, last pushed 7mo ago), licensed MIT. It adds 9 tokens to every session and 5,339 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to tdd-loop, differing in 0 lines, and is treated as a copy.
Other commands, from other repositories
prompt-evolve
Closed prompt-evolution loop: turn a lesson into a candidate agent prompt, gate it on held-out evals, promote only if it beats the baseline. SIA Meta→Target→Feedback ported to greatcto.
atdd
Start the ATDD workflow for a new feature. Optionally provide a feature description as an argument.
symfony-tdd-pest
Start a TDD workflow using Pest PHP for Symfony with RED-GREEN-REFACTOR cycle.
symfony-tdd-phpunit
Start a TDD workflow using PHPUnit for Symfony with RED-GREEN-REFACTOR cycle.
bugfix
TDD-driven bugfix workflow: tester writes failing test (RED) → developer fixes (GREEN) → developer refactors (REFACTOR) → reviewer validates. Accepts issue number, description, or both. Auto-creates PR unless --no-pr flag is passed.
partition-dev
Derive test cases from Z specification using TTF testing tactics.