CLAUDE LABJP
2.2553.0 — Claude Desktop and Cowork both shipped over the weekend. Connector and extension tools no longer fail when an optional argument is left outCOMPACT — The Messages API gained a compaction parameter. Behind the compact-2026-09-04 beta header, you can now compress a conversation on your own schedule10/07 — The old management-configuration key spellings are accepted until noon PT on October 7, sixteen days away. Move your fleet past 1.15200.0 before switching orgPluginSettings to the array formGH.LINK — Cowork shows the GitHub integration as authenticated, yet there is no way to use it: it never registers as a connectorNEW — You are paying for Pro but no charges appear in the Console. Here is where to lookKB5129195 — September Windows updates that stopped Cowork from reaching files are fixed by Microsoft KB5129195. No Claude Desktop update is needed2.2553.0 — Claude Desktop and Cowork both shipped over the weekend. Connector and extension tools no longer fail when an optional argument is left outCOMPACT — The Messages API gained a compaction parameter. Behind the compact-2026-09-04 beta header, you can now compress a conversation on your own schedule10/07 — The old management-configuration key spellings are accepted until noon PT on October 7, sixteen days away. Move your fleet past 1.15200.0 before switching orgPluginSettings to the array formGH.LINK — Cowork shows the GitHub integration as authenticated, yet there is no way to use it: it never registers as a connectorNEW — You are paying for Pro but no charges appear in the Console. Here is where to lookKB5129195 — September Windows updates that stopped Cowork from reaching files are fixed by Microsoft KB5129195. No Claude Desktop update is needed
Articles/Claude Code
Claude Code/2026-04-17Advanced

From Spec to Production: Spec-Driven Development with Claude Code

Driving tests, implementation, and docs from a YAML spec with Claude Code, plus measured bcrypt 72-byte results where a valid spec still yields broken code.

Claude Code255Spec-Driven DevelopmentTDD4Test AutomationCI/CD19SpecificationsQuality EngineeringWorkflow8

Premium Article

Three months into a project, you open a function you wrote and think: "Wait, what was this supposed to do?" If you've experienced that moment, you're not alone.

The divergence between specs and code is one of software development's oldest problems. Test-Driven Development (TDD) offers one solution — "the test is the spec" — but the psychological overhead of writing tests first often slows teams down, especially in solo or small-team projects.

Over the past six months, I've been experimenting with a workflow built around Claude Code that sidesteps this problem entirely: write a structured specification, and let Claude Code generate the tests, implementation, and documentation from it. I call this Spec-Driven Development.

This article shares that workflow in full, including the code examples and the pitfalls I hit along the way.

Why Specs and Code Always Drift Apart

The typical development flow looks something like this:

  1. Gather requirements (Slack messages, Confluence pages, meetings)
  2. Write the implementation
  3. Open a PR once it "works"
  4. Add tests if there's time
  5. Document it later (which never comes)

The root problem is that specs live outside the code. They exist in chat logs and wiki pages, and keeping them synchronized with the implementation depends entirely on developer discipline.

TDD reframes this: "the test is the spec." But TDD requires you to write the test before you can write the implementation, which means you need to design the test first — another time-consuming task.

Claude Code changes the equation. When you write a structured specification, Claude Code can generate the test from it. You skip the test design step entirely.

The Spec-Driven Development Overview

The core idea is a clear division of labor:

Humans write:

  • Feature specifications (input → output contracts)
  • Business rules (edge cases, error handling policies)
  • Quality requirements (performance, security constraints)

Claude Code generates:

  • Test code based on the spec
  • Implementation that passes the tests
  • API documentation from the implementation
  • Review comments on diffs

The key is writing specs in a format Claude can read accurately. Structured YAML works better than natural language descriptions — Claude interprets it with higher fidelity.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Once you write a YAML spec, Claude Code auto-generates tests, implementation, and documentation — freeing you from manual test writing while maintaining code quality
Automating the 'write tests first' TDD principle with AI lets you eliminate bugs from the start. You can run the Red→Green cycle without writing a single line of code manually
A fully automated GitHub Actions pipeline—from spec to CI/CD—can be integrated into your project today, ensuring spec changes automatically propagate to tests, implementation, and docs
Catch the blind spot where a valid spec yields broken code: measured results across two bcrypt versions showing when a different password authenticates, and how to close the collision at the spec level
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $15 for lifetime access
View Membership →

Related Articles

Claude Code2026-04-26
Test-Driven Development with Claude Code — A TDD Workflow for the Agent Era
Adding the constraint of 'write tests first' to Claude Code stops the agent's drift and dramatically changes the quality of generated code. Here's the TDD workflow I arrived at after six months of trial and error.
Claude Code2026-07-29
The MCP Server Connects Fine and Still Hands Back Zero Tools — Catching Silent Capability Drift with a Tool Manifest Diff
A missing credential does not break the MCP handshake. initialize succeeds, tools/list succeeds, and the array comes back empty. Here is the measured behaviour, and a preflight that locks the expected tool surface and fails closed before the agent ever starts.
Claude Code2026-06-18
Moving Cleanup and Logging into a SessionEnd Hook
How to use Claude Code's new post-session hook to automate temp-file cleanup and log writing after a session ends, with real examples from a pipeline that processes several repositories in sequence.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links