state

state is a command for Claude Code from Kastalien-Research/thoughtbox. It costs 0 tokens per session (443 once invoked), scanned A, original, MIT.

A defined JSON file format for tracking the state of a hypothesis-driven development workflow. It records the current phase, task, artifacts, risks, handoffs, and required checks.

In plain words
What is it for?
Use it to record and verify progress while researching, staging, implementing, validating, and deciding on an architecture change.
Why use it?
It gives each workflow phase a shared source of truth and requires important files and transitions to be verified on disk. This reduces confusion about what has been completed or is blocked.

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/state
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 state

README.md
[![agentmods](https://agentmods.dev/badge/commands/kastalien-research/thoughtbox/state.svg)](https://agentmods.dev/commands/kastalien-research/thoughtbox/state)
Your own site
<a href="https://agentmods.dev/commands/kastalien-research/thoughtbox/state"><img src="https://agentmods.dev/badge/commands/kastalien-research/thoughtbox/state.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 443 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 $0.00000 $0.00443
Opus 5 $0.00000 $0.00221
Sonnet 5 $0.00000 $0.00089
Haiku 4.5 $0.00000 $0.00044

Measured yesterday against content hash 5f87ba7b7f54, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

state 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 yesterday.

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.

apps/web/.claude/commands/hdd/state.md · 53 lines

What it actually says

HDD State Contract

Canonical state structure for the modular HDD workflow.

State Path

  • .hdd/state.json

Required Fields

{
  "workflow": "hdd",
  "version": "2.0",
  "adr_number": "",
  "title": "",
  "phase": "research|stage|implement|validate|decide|complete",
  "current_task": "",
  "status": "idle|in_progress|blocked|complete|failed",
  "artifacts": [],
  "errors": [],
  "handoff": {
    "module_path": "",
    "task_goal": "",
    "paths_to_inspect": [],
    "acceptance_checks": []
  },
  "open_risks": [],
  "updated_at": ""
}

Phase Transition Rules

Each transition requires on-disk verification — read the state file back after writing and confirm the required data is present. Conversation memory is not an artifact.

  1. research -> stage requires hypotheses array in state.json with length > 0. Each entry must have id, claim, prediction, validation fields.
  2. stage -> implement requires staging_adr_path and spec_path non-null in state.json AND both files exist on disk (verified by reading them).
  3. implement -> validate requires artifacts array with implementation files and test targets recorded in state.json.
  4. validate -> decide requires hypothesis outcomes written to state.json (each hypothesis has an outcome field: VALIDATED | INVALIDATED | INCONCLUSIVE).
  5. decide -> complete requires accepted/rejected migration artifact on disk.

Enforcement: The orchestrator MUST read .hdd/state.json after every write and verify the transition prerequisite before starting the next phase. If verification fails, fix the write — do not advance.

Resume Rules

  1. Load state and verify phase prerequisites using the transition rules above.
  2. Re-run current phase module if output artifacts are missing from disk.
  3. Preserve prior artifacts and append new events.
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. yesterday First seen · 53 lines · 0 tokens per session scan A 5f87ba7b7f54

Subscribe to this mod's changes

state is a command published in the GitHub repository Kastalien-Research/thoughtbox (64 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 443 tokens. 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.