How Anthropic Engineers Use Claude Code Daily: A Workflow to Reduce Guesswork and Rework
The article breaks down Anthropic's practical Claude Code workflow—interviewing requirements, generating HTML specs, and adding runtime verification—to prevent vague prompts, cut down on rework, and produce machine‑readable evidence for complex coding tasks.
Why Claude Code Needs More Than Prompt Length
Users find Claude Code fast for tiny tasks (e.g., fixing a function or adding a test) but costly for larger features because unclear requirements lead the model to make hidden assumptions that surface only after code generation.
Key insight: The more capable the model, the stricter the specification and verification must be.
Anthropic’s Three‑Phase Workflow
phase-1-exploration: Use AskUserQuestion to interview the user, producing a SPEC.md (≤80 lines) that lists target users, core flow, edge cases, permissions, and acceptance criteria. phase-2-planning: From the spec, generate 2‑4 static HTML prototypes that show happy path, empty state, error state, and permission‑restricted state, allowing visual comparison and early feedback. phase-3-verify: Build a small React todo app that exposes data-verify-* attributes (e.g., data-verify-unit="TodoApp", data-verify-total="3") so agents or CI can read a stable DOM contract without parsing implementation details.
Interview Step
Instead of a single request like “帮我做一个分账应用”, Claude first asks 8‑12 clarifying questions about target users, core processes, error handling, permissions, and edge cases, then outputs a concise spec.
我想做一个分账应用。
请先帮我 brainstorm 目标用户,
然后用 AskUserQuestion 深度采访我,
把所有模糊点问出来,最后形成 spec。The interview template limits questions to the essential five points and caps the spec at 80 lines to keep it readable.
HTML Prototype Step
Markdown is great for source docs, but HTML better conveys UI flow, state, and layout for human and model consumption. Claude generates multiple HTML mockups that can be opened side‑by‑side, screenshot, and fed back to the model.
读取 SPEC.md。
先不要实现正式代码。
请生成 3 个不同方向的静态 HTML 原型。
每个方向需要包含:
1. 核心页面;
2. 关键状态;
3. 空状态;
4. 错误状态;
5. 权限受限或不可操作状态;
6. 简短说明:这个方向适合什么场景,不适合什么场景。Verification Step
The verification layer adds a DOM contract that agents can query directly. Example component markup:
<section
data-verify-unit="BillingSummary"
data-verify-total="128.50"
data-verify-currency="USD"
data-verify-status="ready"></section>A verification script checks three things:
DOM contract exists.
Displayed amount matches the contract.
Boundary fixtures produce expected results.
请为 BillingSummary 增加一个最小验证面。
要求:
1. 组件根节点暴露 data-verify-unit、data-verify-total、data-verify-currency、data-verify-status;
2. 增加 3 个 fixture:正常状态、空状态、金额不一致状态;
3. 增加一个 verify 脚本,检查页面显示值和 data-verify-* 是否一致;
4. 如果无法观察到状态,返回 BLOCKED,不要假装 PASS;
5. 不要改业务逻辑,只增加验证面。The workflow changes the task rhythm from "write requirements → let Agent code → human review → rework" to "interview → spec → HTML prototype → implementation → runtime verification → decide next step", moving human judgment earlier and reducing hidden errors.
When to Apply the Process
Features with 2‑4 UI states and clear permission boundaries.
Tasks that previously required screenshot feedback.
Changes that need an end‑to‑end check after implementation.
Small tweaks (spelling, type fixes) don’t need a full interview; Markdown remains suitable for long‑term rule documents, while HTML shines for intermediate, visual artifacts.
Limitations and Costs
HTML consumes more tokens and the verification surface needs maintenance. It does not replace unit tests or type checking; it only ensures the agent can reliably observe the produced UI.
Getting Started
Pick a medium‑complex feature, run through the four phases, then review:
任务:实现 [功能名]
阶段 1:采访
- 让 Claude 先问 8 到 12 个问题
- 输出 SPEC.md(≤80 行)
- 标明非目标和验收标准
阶段 2:HTML 原型
- 输出 2 到 4 个 HTML 方向
- 每个方向包含 happy path、空状态、错误状态、权限受限状态
- 人先选方向,再进入实现
阶段 3:验证面
- 只选一个关键组件
- 暴露 data-verify-* 状态
- 准备至少 1 个正常 fixture 和 1 个边界 fixture
- 给 Agent 或 CI 一个可执行验证入口
阶段 4:回看
- 哪些问题在采访阶段已发现?
- 哪些返工在 HTML 原型避免?
- 哪些错误在验证面捕捉?
- 哪些步骤太重,下一次可删?After three successful runs, consider codifying the stable parts into project commands, skills, or templates.
References
Anthropic Code with Claude: How we Claude Code – https://claude.com/code-with-claude/session/sf-ext-how-we-claude-code
GitHub repo anthroics/cwc-workshops – https://github.com/anthropics/cwc-workshops
Claude Code Docs: Handle approvals and user input – https://code.claude.com/docs/en/agent-sdk/user-input
Simon Willison: The Unreasonable Effectiveness of HTML – https://simonwillison.net/2026/May/8/unreasonable-effectiveness-of-html/
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Architect
Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
