◉CLAUDE LABJP
●2.1.301 — Adds the vim % motion, LaTeX math rendering in the VS Code panel, and a retry-watchdog limit for usage-limit waits (10/15)●2.1.299 — Conversations over 200K tokens left idle about 54 minutes get compacted; MCP allow rules now match only the server they name●SONNET 4.5 — Retires on the Claude API on 11/30, 45 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST MODE — Opus 5.5 fast mode is out of research preview and no longer needs the beta header (10/15)●NEW — I Put a Ten-Line Promise File at the To…●2.1.301 — Adds the vim % motion, LaTeX math rendering in the VS Code panel, and a retry-watchdog limit for usage-limit waits (10/15)●2.1.299 — Conversations over 200K tokens left idle about 54 minutes get compacted; MCP allow rules now match only the server they name●SONNET 4.5 — Retires on the Claude API on 11/30, 45 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST MODE — Opus 5.5 fast mode is out of research preview and no longer needs the beta header (10/15)●NEW — I Put a Ten-Line Promise File at the To…
Articles/Claude Code
⟐ Claude Code/2026-05-05Advanced

Your Design Doc Quality Sets Claude Code's Speed Limit: Spec-First AI Development

The story of compressing 16 person-days into 2 hours isn't about how good the AI was — it's about how well the design doc prevented AI from having to think. Learn how to build specs that unlock Claude Code's true speed.

Claude Code264AI-driven developmentdesign docspecificationproductivity19software design

When I first heard "16 person-days of development finished in 2 hours," I assumed it was a story about how impressive Claude Code is. But the person who did it kept emphasizing something else entirely: "It wasn't that the AI was fast. It was that the design doc left nothing for the AI to decide."

That framing stuck with me. When you're building apps with AI assistance and things feel slower than they should, the bottleneck is almost always the same thing: the design document — or the lack of one.

This guide digs into how to write specs that let Claude Code operate at full speed, with a practical three-file system you can use immediately.

Why the Design Doc Sets the Speed Ceiling

AI coding agents like Claude Code are excellent at implementation and poor at judgment.

Judgment means: "Should I use this design or that one?" "How much error handling do we need here?" "How does this spec change fit with the existing architecture?" Answering those questions is the human's job. When Claude Code encounters ambiguity, it stops and asks.

Here's what happens when you hand Claude Code a vague spec:

AI: What format should the API error response use?
You: { error: string }
AI: Should network errors use the same format?
You: Yes
AI: Should auth errors include the status code?
You: Yes, 401
AI: What about 404 errors?
(continues)

That back-and-forth is what kills your speed. The case of 16 person-days becoming 2 hours involved a design doc of 3,500 lines across 20 sections — detailed enough that the AI almost never needed to make a judgment call. It could just implement.

Three Conditions for a Spec That Leaves Nothing to the AI

Condition 1: Every decision is recorded, including the reasoning

The most important thing to capture in a design doc is why you made each decision — not just what you decided.

Good:

## Authentication
 
Using JWT (reason: no session management needed in serverless environment)
Token expiry: 24 hours (reason: matches our mobile app usage patterns; 
  refresh tokens add implementation cost without proportional benefit)

Not good:

## Authentication
 
Implement JWT authentication

With the first version, the AI can make informed choices when it encounters edge cases around token expiry or exception handling. With the second, it asks you every time.

Condition 2: Out-of-scope items are explicitly listed

"What we are NOT building" is the most underrated section in any design doc.

## Out of Scope (not in this phase)
 
- Internationalization (post-MVP consideration)
- Social login (low priority)
- Email notifications (replaced by push notifications)
- Admin panel (CSV export is sufficient for now)

When "don't implement X" isn't stated, the AI may generate extra code for X "just in case" or stop to ask whether it should. Explicit exclusions eliminate that entirely.

Condition 3: File structure, components, and naming conventions are predefined

Defining the project's structure before implementation begins keeps the AI's output consistent across sessions.

## Directory Structure
 
src/
  components/    # React components (PascalCase)
  hooks/         # Custom hooks (use* prefix required)
  api/           # API call functions (camelCase)
  types/         # TypeScript types (PascalCase, .types.ts extension)
  utils/         # Utility functions (camelCase)
 
## Naming Conventions
 
- Components: UserCard.tsx (feature + component type)
- Hooks: useUserData.ts (use + feature name)
- API functions: fetchUserById.ts (verb + target + condition)

The Three-File System: DESIGN.md, TASK.md, DECISION.md

Working with Claude Code regularly, I've found that splitting design information across three separate files — each with a different purpose — works significantly better than one large document.

DESIGN.md: The System Design Document

The primary document covering what you're building and how. A solid baseline structure:

# Project Name
 
## Scope of this article
(1-2 paragraphs on the product's purpose and the problem it solves)
 
## User Stories
- User A can do X
- User B can do Y
 
## Tech Stack
(Frameworks and libraries with reasons for choosing them)
 
## Data Model
(Core entities and their relationships)
 
## API Design
(Endpoint list with request/response formats)
 
## State Management
(What state lives where)
 
## Error Handling
(Error classification and response strategy)
 
## Out of Scope
(What is explicitly not being built this phase)

TASK.md: The Implementation Breakdown

Where DESIGN.md answers "what to build," TASK.md answers "in what order and how to verify it's done."

The critical detail is a completion condition for each task:

## Tasks
 
### Phase 1: Foundation
- [ ] Project setup
  - Done when: `npm run dev` runs, ESLint/Prettier pass
- [ ] Auth API
  - Done when: /api/auth/login returns { token: string }, tests pass
  - Depends on: nothing
 
### Phase 2: Core Features
- [ ] User list page
  - Done when: /users shows DB users, error toast appears on failure
  - Depends on: Auth API

When completion conditions are explicit, the AI can judge for itself whether an implementation is finished — no check-in required.

DECISION.md: The Design Decision Log

A record of the judgment calls made during development. This is especially important in AI-assisted work, where the reasoning behind past decisions gets lost between sessions.

# Design Decisions
 
## 2026-04-15: Chose Zustand for state management
 
**Context**: Global state became necessary
**Options**: Context API / Redux / Zustand
**Decision**: Zustand
**Reasoning**:
- Redux is over-engineered for this project's scale
- Context API has performance concerns at this component depth
- Zustand has minimal boilerplate and low learning curve
**Future**: If the project grows significantly, revisit Redux

How to Hand Context to Claude Code

With the design docs ready, the way you open each Claude Code session matters.

Please read @DESIGN.md and @TASK.md.
We're implementing "Phase 1: Auth API" now.
Review the completion conditions, then begin implementation.
If you have any questions, list them all upfront before starting — 
don't pause mid-implementation to ask.

The instruction to ask all questions upfront is worth emphasizing. It changes the interaction from repeated interruptions into one focused clarification round, followed by uninterrupted implementation.

When Writing the Design Doc Feels Too Slow

"Doesn't spending hours on a design doc defeat the purpose?" Fair question. The first design doc does take time — sometimes several hours.

The fix: have Claude Code write the first draft.

I want to build an app that does [brief description].

Using the DESIGN.md template, draft a design document for this.
Mark anything you're unsure about as TBD — I'll fill those in.

The AI produces a draft. You review it and fill the TBDs. This approach is typically 3–4x faster than writing from scratch, and the quality is usually good enough to build on.

The Core Insight

Most of the slowness in Claude Code-assisted development traces back to the same cause: a spec that asks the AI to make decisions it shouldn't have to make.

AI agents are implementation machines, not judgment machines. When you take on the judgment work upfront — in the form of a thorough design doc — the AI can do what it actually does well, at full speed.

Start your next project with a DESIGN.md. The first one might cost you a couple of hours. Everything after that will be faster than you've seen before.

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 $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

⟐ Claude Code2026-10-15
The Hook That Was Meant to Guard My Japanese Folder Never Blocked Anything — Python Was Reading stdin as cp932
A PreToolUse hook guarding folders like 経理 or 議事録 silently lets edits through when Python's stdin defaults to cp932. How I reproduced it, the three-line fix, and one command to check your own hooks.
⟐ Claude Code2026-10-14
I Set onFailure to block, and the Docs' rm -rf Guard Still Let Everything Through Without jq
When a PreToolUse guard hook fails, does the action go ahead or stop? The docs' own rm -rf example exits 0 and waves everything through when jq is missing. Ten failure modes run for real, the fix, and a script that finds fail-open guards in settings.json.
⟐ Claude Code2026-10-14
Grep's First 250 Lines Touched Only 42 of the 183 Files That Matched
Searching an article repository for the word hook returned 1,312 lines across 183 files. ripgrep, git grep and grep all finished in 11 to 35 ms, so speed was never the issue. Output size and ordering were. A script that estimates what a 250-line cutoff will miss, plus a search order backed by measurements.