Think4Ever
Product

Spec Drift: The Silent Failure of Agentic Coding

November 23, 20266 min read

Giving a coding agent detailed context, even a complete design, does not mean it will build the application you intended. It will build something that runs, while quietly drifting from the specification. We call this spec drift, and the agent is not the one who will tell you about it.

We built think4ever Gap Analysis, our newest feature, to catch it. Here is what it found on a real project.

What we found

We connected a real customer project to Claude Code through the Think MCP server. The full design was there for the agent to read: more than 100 screens, 34 business flows, 92 business rules, 26 roles and 126 data objects. Claude Code read it and built the app, phase by phase.

Then we measured the code against the design. The first analysis of one phase found 72% of the design in the code. The first analysis of the next phase found 8%.

This was not a weak prompt or a missing spec. The agent had everything. The gaps are the kind that look done and are not:

  • Screens and fields missing, while the main screens worked.
  • Flows that stopped at the happy path, with exceptions, approvals and later steps never built.
  • Business rules not enforced, even though they were in the design the agent read.
  • Functions with the right names and empty bodies, which look finished in a summary.

Why it happens

This is not a flaw of one tool. It is how today's coding agents work:

  • They optimize for "it runs". Compilers, tests and the browser tell the agent the code works. Nothing tells it the code is complete.
  • Context drifts, so the code drifts from the spec. A real design is large. Over a long session, parts of it drop out of the agent's working memory, and plausible assumptions fill the gaps. Context drift is the cause; spec drift is the result.
  • "Done" is self-reported. The agent decides when to stop, and grades its own work.

Speed and context are not conformance. Spec drift is silent: without an independent check against the design, the gap between "it runs" and "it is what we intended" stays invisible until users find it.

Design is the harness

This is the strongest argument for designing first. Without a design, agentic coding is ad hoc: the agent invents screens, data and flows as it goes, and nobody can say what is missing, because nothing defines what should be there.

With a design in think4ever, "done" has a definition. But handing the design to the agent only gives it context. A harness also needs a feedback loop that measures the code against the design and sends the gaps back. That is what Gap Analysis adds.

Introducing think4ever Gap Analysis

Gap Analysis is our newest think4ever feature. It shows what is built and what is still missing: it compares your think4ever design with the code in your project and puts a percentage on every part of it.

  • Every part of the design is scored: screens down to each field and button, business flows step by step, data objects, business rules, API endpoints, roles, and more. Red is mostly missing, orange is partly built, green is built.
  • Every score has a reason: what was found, what is missing, and the code itself, with the gap marked.
  • Findings become tasks: "Create tasks from the findings" puts every gap on the task board, with a sub-task for each missing point.
  • It works from your coding agent: Claude Code, Cursor or Codex can start an analysis, read the gaps and fix them over MCP, for example "Close the gaps of this task and check it again."

The closed loop

Design → Build → Bring the code back → Gap Analysis → Tasks → Fix → Check again

  1. Design in think4ever: concept, flows, data, rules and UI screens.
  2. Build with Claude Code over MCP, or Cursor, Codex or the think4ever agents.
  3. Bring the code back into think4ever and run Gap Analysis against the design.
  4. Create the task list from the findings.
  5. Hand the tasks to Claude Code to fix, then bring the fixed code back.
  6. Check again and repeat until the parts that matter are green.

The coding agent does the work. The design decides when it is finished.

In practice: a real project through the cycle

The screens below come from a real-life customer project, a manufacturing ERP designed in think4ever and coded by Claude Code over MCP, going through this cycle. Identifying details are blurred.

PhaseFirst analysisAfter closing gaps
Phase 272%94% one day later
Phase 38%87%, then 95% two days later
Gap Analysis in think4ever: every analysis kept by date and phase, with the score for each part of the design.
Every analysis is kept by date and phase: Phase 3 went from 8% to 87% to 95%, and Phase 2 from 72% to 94%.

At 95%, every one of the 90 items in the phase was built. Yet the analysis still found what matters most: business rules. Confirming a cut plan did not lock it as designed, and the rule "no colour mixing in a lay" had no reject path in the code. These are the gaps that pass a demo and fail in production, and the agent's own sense of "done" did not flag them.

The 95% Gap Analysis result: 90 items checked, with the remaining rule gaps called out in the summary.
The 95% analysis: 90 items checked against more than 1,100 files, with the remaining rule gaps called out in the summary.

The 65 remaining open points became 65 tasks with 53 sub-tasks, without running an agent or using credits. The tasks are handed to Claude Code to fix, the code comes back, and Gap Analysis checks it again.

The Create tasks from the findings dialog, turning 65 open points into 65 tasks with 53 sub-tasks.
Create tasks from the findings: every gap becomes a task for the team or the coding agent.

The takeaway

Do not ask a coding agent to judge whether it built what you intended. Give it a design, then measure the code against that design, every time.

Coding agents are fast and capable, and a design over MCP makes them far better. But even with full context, they do not reliably produce the intended application. Design defines what "done" means. Gap Analysis measures it, turns the gaps into tasks, and closes the loop until the code conforms to the design.

Try think4ever Gap Analysis on your own project: think4ever.com/docs/gap_analysis/

Learn more