hub-tdd

hub-tdd is a command for Claude Code from Kastalien-Research/thoughtbox. It costs 27 tokens per session (4,113 once invoked), scanned A, original, MIT.

A test-first workflow for implementing an MCP Hub, a central component that connects agents to shared tools and workspaces.

In plain words
What is it for?
Use it to implement identities, attribution, workspaces, problems, proposals, consensus, channels, proxies, and the hub handler.
Why use it?
It breaks a complex shared-agent system into tested modules and requires each stage to pass before the next begins.

Command for Claude Code

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.

agentmods
npx agentmods add commands/kastalien-research/thoughtbox/hub-tdd
Clone the repo
git clone --depth 1 https://github.com/Kastalien-Research/thoughtbox

Made for: Claude Code.

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 hub-tdd

README.md
[![agentmods](https://agentmods.dev/badge/commands/kastalien-research/thoughtbox/hub-tdd.svg)](https://agentmods.dev/commands/kastalien-research/thoughtbox/hub-tdd)
Your own site
<a href="https://agentmods.dev/commands/kastalien-research/thoughtbox/hub-tdd"><img src="https://agentmods.dev/badge/commands/kastalien-research/thoughtbox/hub-tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,113 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00027 $0.04113
Opus 5 $0.00014 $0.02056
Sonnet 5 $0.00005 $0.00823
Haiku 4.5 $0.00003 $0.00411

Measured 2d ago against content hash 9e9f831ba5a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

hub-tdd 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 2d 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.

.claude/commands/development/hub-tdd.md · 444 lines

How it starts

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

/hub-tdd

Strict TDD workflow for implementing the MCP Hub from ADR-002. Enforces: types first, then tests (must be red), then implementation (must be green), with git commits at every checkpoint.

Variables

RESUME: $ARGUMENTS (default: auto-detected from .hub-tdd/state.json)

Module Order (dependency-driven)

# Module Test Count Depends On
0 hub-types 0 (pure types)
1 identity 4 hub-types
2 attribution 3 hub-types, existing ThoughtData
3 workspace 6 identity
4 problems 7 workspace
5 proposals 10 problems
6 consensus 5 workspace
7 channels 9 problems
8 proxy 5 hub-handler interface
9 hub-handler 18 all modules
10 integration 3 everything
Total 70

Expected Test Counts Per Module

These counts are authoritative (derived from ADR Section 10 test IDs):

{
  "identity": { "count": 4, "ids": "T-ID-1..4", "files": ["identity.test.ts"] },
  "attribution": { "count": 3, "ids": "T-ATT-1..3", "files": ["attribution.test.ts"] },
  "workspace": { "count": 6, "ids": "T-WS-1..6", "files": ["workspace.test.ts"] },
  "problems": { "count": 7, "ids": "T-PR-1..7", "files": ["problems.test.ts"] },
  "proposals": { "count": 10, "ids": "T-PP-1..10", "files": ["proposals.test.ts"] },
  "consensus": { "count": 5, "ids": "T-CON-1..5", "files": ["consensus.test.ts"] },
  "channels": { "count": 9, "ids": "T-CH-1..5, T-CHSUB-1..4", "files": ["channels.test.ts", "channel-subscription.test.ts"] },
  "proxy": { "count": 5, "ids": "T-PX-1..5", "files": ["proxy.test.ts"] },
  "hub-handler": { "count": 18, "ids": "T-PD-1..3, T-ERR-1..6, T-TERM-1..4, T-ISO-1..4, T-STOR-1..5", "files": ["hub-handler.test.ts", "errors.test.ts", "terminal-state.test.ts", "isolation.test.ts", "storage.test.ts"] },
  "integration": { "count": 3, "ids": "T-INT-1, T-CONC-1..2", "files": ["integration.test.ts", "concurrent.test.ts"] }
}

Read the full file on GitHub · 444 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. 2d ago First seen · 444 lines · 27 tokens per session scan A 9e9f831ba5a9

Subscribe to this mod's changes

hub-tdd is a command published in the GitHub repository Kastalien-Research/thoughtbox (64 stars, last pushed 1mo ago), licensed MIT. It adds 27 tokens to every session and 4,113 once invoked, about $0.0001 per session on Opus 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-09-03.