Back to Blog
Case StudiesJune 202620 min read

AI Coding Assistants Degrade Before They Fail

A real-world case study on how structured implementation briefs improved speed, reliability, and first-pass quality in a large production codebase

A real-world case study on how structured implementation briefs improved speed, reliability, and first-pass quality in a large production codebase.

On one task, an AI coding assistant consumed close to a million tokens and still failed to produce a usable branch. On a comparable task in the same codebase, a structured, implementation brief-led workflow resolved the issue in 3 messages.

That contrast changed how I think about AI-assisted development at production scale.

This was not a toy repo or a tutorial project. It was a 30K+ file production codebase across four production repositories. At that scale, workflow mistakes do not stay contained. Context sprawl compounds, architecture drift compounds, and silent logic errors become harder to catch before the correction spiral gets expensive.

What follows is a write-up of two related experiences: one direct A/B comparison, and one larger implementation completed with a brief and compared against a realistic no-brief baseline grounded in prior sessions on the same codebase.

At production scale, the bottleneck in AI-assisted development is not model capability. It is how well the problem has been translated into an executable brief.

The Setup

I did not skip briefing because I believed in "vibe coding." I skipped it because I thought the first task would be a quick fix.

On a 30K+ file codebase, that assumption turned out to be expensive. Here is the shared context for both cases:

Shared conditionDetail
Codebase30K+ files across four production repositories
Coding environmentCursor with Opus 4.6
Comparison shapeOne direct A/B comparison and one observed result with a realistic no-brief baseline

The tool names matter less than the pattern: one path relied on iterative prompting inside the coding environment, while the other externalized the thinking into a structured brief before implementation began.

Why Scale Changes Everything

Most AI coding discussions are based on small, clean repositories where almost any workflow looks good. That is not a useful benchmark.

On a large production system, the failure modes become obvious: context gets fragmented, architectural decisions drift, business logic gets reinterpreted mid-stream, and late-stage fixes create new inconsistencies.

If a workflow still holds up at this scale, it is probably real.

Case 1: The A/B Comparison

The first case started as what I assumed was a small production fix.

I used planning mode, which is generally considered the safer and more structured approach. That rules out an easy explanation. This was not reckless agent-mode flailing. This was the "careful" workflow.

More specifically, the planning happened inside Cursor itself. The model was trying to understand the problem, shape the approach, and implement it against the same live context window.

And it still collapsed.

How this case was run

ElementDetail
First attemptPlanning done inside Cursor with Opus 4.6
Brief creation for second attempt4 messages inside QEEK using Kimi 2.5
Second attempt handoffBrief loaded into Cursor for review and execution
Comparison typeDirect A/B on the same class of problem

This is what makes the contrast meaningful: the implementation environment stayed broadly the same, but the planning moved from the coding context into a much stronger external brief.

Without a Brief

Without a brief, even planning mode spiraled into:

  • 193 assistant turns
  • ~500K–1.2M tokens
  • A branch that ultimately had to be abandoned

The failure was progressive. The system slowly lost coherence, started contradicting earlier decisions, and turned each correction into the seed of the next problem.

With a Brief

For the second attempt, I loaded the brief into Cursor through QEEK MCP as a reviewable input rather than forcing an explicit planning phase. In my workflow, that usually leaves room for the model to refine the brief further before implementation if needed.

In this case, it effectively went straight to coding.

I cannot prove exactly why. But my read is that the brief was complete and well-structured enough that the model did not need to spend much of its context budget re-planning the task.

With a structured brief, the same issue was diagnosed and resolved in:

  • 3 user messages
  • 3 assistant turns
  • ~150K–200K tokens

That was the branch that shipped.

What made that branch different was not simply that it began with more text. It began with a much sharper definition of the task. The product problem, the user journey, the trigger mechanics, the backend constraints, the failure states, and the implementation edge cases had already been surfaced before coding started.

That matters because it changed what the model had to do inside the coding session.

Instead of spending its best reasoning cycles reconstructing intent from a large codebase, inferring workflow details from scattered components, or discovering brittle failure points halfway through execution, it could work against a much clearer target. The brief had already done a large share of the cognitive work.

That is the hidden difference between the two branches. One relied on the model to discover the shape of the solution while implementing it. The other gave the model a more executable version of the problem from the start.

Outcome Comparison

MetricWith BriefWithout Brief
User messages315
Assistant turns3193
Estimated tokens~150K–200K~500K–1.2M
Flow shapeSingle focused fixCorrection spiral → branch restart
Review outcomeStructurally strongerInconsistent, discarded
Estimated Cost$1$4-10

No mode reliably protects you from context degradation at real-world scale. The brief did.

Case 2: The More Important Result

After Case 1, I changed the workflow.

For the second task, I briefed first and only then moved into implementation.

The task was a unified color-coding system for metrics across an analytics dashboard. It touched 28 files inside the same 30K+ file, four-repo codebase.

How this case was run

ElementDetail
Brief creationPolished in 6 messages inside QEEK using Kimi 2.5
Execution handoffBrief loaded into Cursor via QEEK MCP
Coding setupCursor with Opus 4.6
Comparison typeObserved result plus a realistic no-brief baseline grounded in prior comparable sessions

Unlike Case 1, this was not a strict live A/B. The no-brief comparison is an estimate, but it is an estimate grounded in repeated prior sessions on the same codebase and the same general class of work.

On the surface, that can sound like a smaller or more cosmetic piece of work.

It was not.

The underlying problem was not just visual inconsistency. Different parts of the product were expressing metric health in different ways, using different thresholds, different interpretations of what counted as "good," and different signals for what users should do next. Solving it properly meant aligning product semantics, UX behaviour, and implementation logic across multiple surfaces. It was a systems problem before it was a styling task, and the brief treated it that way.

That helps explain why the brief had such a large effect.

Instead of asking the coding agent to infer the right solution from scattered code and partial prompts, the implementation started from a structured brief that had already done much of the cognitive work. The brief clarified the problem, made the user impact explicit, captured constraints, surfaced trade-offs, and grounded the solution in the reality of the existing codebase.

That changed the nature of execution.

The model was no longer being asked to discover the architecture while implementing it. It was being asked to execute against a clearer map.

Result With a Structured Brief

  • 28 files modified
  • 2 iterations
  • 0 linter errors introduced
  • ~25 minutes to completion
  • ~$2 cost

Realistic No-Brief Estimate

Grounded in Case 1 and similar prior sessions on the same codebase, the no-brief path would likely have looked like this:

MetricWith BriefWithout Brief (est.)
Files modified2828
Code iterations210–15
User messages518–25+
Input tokens~270K~1.2M–1.8M
Linter errors010–15+
Time to completion~25 min~2–3 hours
Cost~$2~$10–18

Two iterations. Twenty-eight files. Zero corrections. It is a fundamentally different operating mode.

What Changed

The gains in speed, cost, and implementation quality came from giving the model a much better starting point.

The brief had already reduced ambiguity before execution began. Product intent was clearer, boundaries were clearer, the architectural direction was clearer, and edge cases were less likely to be discovered halfway through implementation.

That meant the coding agent had less guesswork to do.

That part often gets missed.

The visible part of the workflow is code generation. The less visible part is the work that happens immediately before it: defining the problem well enough that the model does not have to improvise its way toward the right solution.

In these case studies, that upstream step carried much more weight than it might appear to.

Where QEEK Actually Helped

It would be easy to describe the role of QEEK too loosely here and make this sound more salesy than it needs to be.

The useful point is narrower and more concrete.

QEEK mattered because it helped turn codebase context into a more executable brief. Its value was not just that it could inspect multiple repositories, but that it could do so with enough product, system, and architecture awareness to produce a sharper description of the work before implementation began.

In practice, I typically load that brief into Cursor through QEEK MCP with room for the model to review and refine it further. What was notable in these cases was not that planning disappeared entirely, but that far less of it needed to happen inside the coding session itself.

That upstream clarity changed how execution went.

The coding agent still had to implement the solution. But it was operating with clearer intent, better constraints, and a more accurate picture of the system it was modifying. My inference is that this also reduced the amount of planning Cursor/Opus needed to do inside the live coding context, which helps explain why execution became more direct. The downstream effect was fewer false starts, less wasted iteration, and higher first-pass quality.

That is the broader lesson I took from both cases.

The important variable was not just the model. It was the combination of model capability with precise, context-rich briefing.

Why the Brief Worked

The reason these implementations finished more cleanly was not just that a brief existed. It was that the brief removed ambiguity before any code was written. Every important decision had already been made or at least surfaced explicitly: domain logic, architecture direction, implementation boundaries, scope, and edge cases.

The AI was not being asked to discover the solution while implementing it.

It was being asked to execute against a map that already reflected product intent and system reality. A vague brief still leaves the model guessing, and guessing is where most AI coding errors come from.

I've run this codebase enough times to treat it as an operational fact: the output is only as good as the upfront context you provide it.

The Hidden Pattern: AI Quality Follows a Curve

Observed pattern rather than lab benchmark. Brief-first workflows keep the most important work in the model’s highest-coherence zone, while no-brief workflows push execution into degradation and frustration.

The most important thing I learned from working this way is that AI assistants do not fail randomly. They degrade predictably instead, and the threshold arrives earlier than most developers expect.

ZoneIterationsWhat’s happening
Peak1–3Full context window, strongest reasoning, best architecture decisions
Transition4–6Context compression begins, small inconsistencies appear
Degradation7–10State drift, contradictory logic, correction spiral begins
Frustration10+Severe context loss, defensive patches, high error rate

This is the part I think most people miss.

The no-brief workflow pushes work into the degradation and frustration zones. The brief-first workflow keeps the important work inside the peak zone. That is why the results feel so different.

Planning Mode vs. Agent Mode

Planning mode degrades more slowly than agent mode, but it still degrades.

Case 1 made that very clear. The "safer" mode was still not safe enough once context quality started slipping.

Silent Errors Are the Real Risk

Extra time and tokens are recoverable. Logic errors that pass linting and review are not.

These are the failures that pass linting, pass type checks, and often survive review because the code looks clean even though the meaning is wrong. This is especially risky when business logic is inverted, threshold-based, or distributed across multiple layers.

A good brief forces that logic to be specified upfront: exact thresholds, business rules, edge-case behavior, and scope boundaries. It makes the workflow faster and more safe.

The Optimal Workflow

The practical workflow is simple: do the hard thinking early, compress it into a brief, then execute in a fresh context window while quality is still high.

The goal is to make sure the real work happens while the model is still operating at peak quality.

Phase 1: Planning

Use the early iterations to explore approaches, clarify domain logic, and decide architecture. Do not implement yet.

Phase 2: Briefing

Convert those decisions into a structured brief artifact.

This becomes the interface between thinking and execution.

Phase 3: Execution

Start a fresh context window with the brief loaded.

Implement while the model still has full context and maximum coherence.

That is the pattern that consistently works: Think first. Brief second. Execute fresh.

What a Good AI Brief Actually Contains

The brief is where the real engineering work happens. After working through both of these cases, I no longer think of a good brief as a tidy summary of requirements. A good brief is an executable definition of the work. It should reduce ambiguity far enough that the model is not forced to infer product intent, system behaviour, or architectural boundaries from scattered code.

The strongest briefs I have worked with tend to cover six things. The user problem: what is changing, for whom, and why it matters. Without this, the model implements something locally correct but product-wrong. Explicit target behaviour: how the feature should behave in practice, including user states, transitions, edge cases, and failure conditions. System and business constraints: permissions, billing rules, threshold logic, data contracts, and cross-system dependencies. These are the non-negotiables that are often where production implementations go wrong. Architectural direction: where code should live, what to centralize, what to keep local, which patterns to follow, and which shortcuts to avoid. Known failure modes: brittle areas, prior bugs, naming mismatches, or places where the existing codebase is likely to mislead the model. Surfacing these early is one of the highest-leverage things a brief can do. And clear acceptance boundaries: what counts as done, what must not change, and what should be verified.

A good brief changes the kind of iteration you get. Instead of using iterations to discover the shape of the problem, you use them to refine execution against a problem that has already been defined clearly.

What Made These Briefs Different

What stood out in both case studies was the combination of disciplines inside the brief.

These were a combination of technical specs, and product summaries. They included: product intent, UX behaviour, system constraints, architectural decisions, implementation detail and failure handling.

That combination is what made them useful to a coding agent. The model was not being asked to synthesize all of that from the codebase on the fly. Instead, it was being given a version of the problem that had already been translated into an executable shape.

Directional comparison based on observed patterns. Brief-first shifts effort from late correction loops into upfront clarity and cleaner execution.

Prompts vs. Briefs

PromptsBriefs
ReactiveProactive
Fragmented contextStructured context
High iterationLow iteration
Architecture discovered mid-streamArchitecture decided upfront
Cheap per stepCheap overall
Higher risk of driftHigher consistency and safety

This is why I no longer think of prompting and briefing as variations of the same thing. They are different workflows.

Prompting is improvising. Briefing is engineering. We should stop confusing the two.

Field Notes From Doing This Repeatedly

A few patterns have held up across repeated work on this codebase:

  • Even with a strong brief, a second pass may still catch files with no prior logic in that area
  • The highest-risk failures are semantic business-logic errors, not syntax issues
  • Planning mode degrades more slowly than agent mode, but it still degrades at scale
  • The correction spiral is real: each late-stage fix can inject the next inconsistency
  • Without a brief, architecture thrash becomes likely: patch inline, then centralize, then rework again
  • Token numbers should be treated directionally unless pulled from billing dashboards; the pattern matters more than the exact count

The Bottom Line

AI coding assistants are not unreliable. But they are not infinitely stable either. They degrade under load, and at production scale that degradation arrives faster than most developers expect.

These cases show that planning works better when the hard thinking has already been documented into a strong brief. The alternative is problem solving inside a live coding environment with a shrinking coherence window.

The brief is the mechanism that moves the hard thinking to occur before the model touches any code. On this codebase, that difference looked like:

  • One path spiraled into 193 turns and a discarded branch; the QEEK led path shipped in 3 messages
  • The other QEEK led implementation took 2 iterations across 28 files with zero corrections

It comes down to deciding where the real thinking happens. Define the work clearly enough, and the model can stay effective while it does.

About the Author:

May Ranzarek is an entrepreneur, tech founder, and product/systems architect with a proven track record of building businesses. He has founded and scaled businesses past $50M in value. As the founder of QEEK, he combines strategic vision with hands-on execution across product, systems, and technology. His work sits at the intersection of innovation, architecture, and scale. His current focus is on how structured AI workflows change what's actually possible in production-scale development.

Structured briefs are the interface between intent and shippable code.

Try QEEK