Apply to my task
arXiv:2603.17104 ★ 92 Mar 17, 2026

Specification Drift & ProjectGuard: Why AI Forgets Early Decisions — and How to Fix It

Key result

Early agreements with AI don't vanish — they sink. A plausible reason (the paper doesn't isolate one): new messages pull focus toward the latest text, and long sessions get compacted. "The structure should look like this," said 40 turns ago, can lose weight by the end. The paper's ProjectGuard protects early decisions in long coding sessions by automatically keeping a two-part project state: what was decided (semantic state) and what was built (structural state). Our manual version is a living "project brief". The brief goes at the start of every new request — and early decisions become "fresh" again, as if you'd written everything in one prompt. In the SLUMP study, ProjectGuard recovered ~90% of the lost semantic faithfulness on Claude Code without any changes to the model (on Codex there was little semantic loss to recover, but module reuse improved).

01

TL;DR

The longer you explain a task piece by piece, the worse the AI sticks to your early decisions by the end. The SLUMP study documented this in coding agents: giving the full specification up front produced a more faithful result than the same requirements scattered across about 60 turns of conversation on 16 of 20 papers with Claude Code and 14 of 20 with Codex.

The problem: AI has no reliable "commitment tracker." When you say early on "the structure should look like this" and then spend 40 messages refining details, the final result often drifts from what you agreed on. A plausible reading (the paper measures only the end result and doesn't isolate a cause) is that early decisions get buried under layers of new instructions, or lost when a long session is compacted. Especially vulnerable is structural integration — wiring early modules/blocks into the final result. In one example from the paper, the agent built the right module early on, but the final integrated code bypassed it and used a simplified version instead.

The fix (ProjectGuard): an external, automatically maintained project state with two parts: semantic (what was decided) and structural (what's already built in the code and how it connects). Before every coding turn, a task brief built from it is injected into the request. The result on Claude Code: 90% of the lost semantic faithfulness was recovered without changing the model itself. Below, we adapt this into a brief you keep by hand; that manual version is our adaptation and was not tested in the paper.

Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.

02

Method Blueprint

BEFORE YOU START:
  Create a "Project Brief" — a living document

  [SEMANTIC STATE]
  - Project goal and constraints
  - Key design decisions (locked in)
  - What we're NOT doing (rejected alternatives)

  [STRUCTURAL STATE]
  - What's already built (blocks, sections, components)
  - How they connect to each other
  - What must not break in the next steps

IN EVERY NEW TASK:
  STEP 0: Update the brief (if anything changed)
  STEP 1: Paste the current brief → before the new request
  STEP 2: Give a specific task → the next step of the project
  STEP 3: Ask it to check the result against the brief → consistency check

WHEN OPENING A NEW CHAT:
  Paste the full brief into the first message → before any instructions

Keep the brief up to date by hand, or ask the AI to update it after each session. (In the paper, ProjectGuard builds and updates this state automatically, deriving the structural part from the code itself. The "NOT doing" list and the end-of-task check are our additions.)

03

Example in Action

Our illustration. The paper tested coding agents implementing ML papers, not writing tasks.

Task: Kevin is launching a YouTube channel about investing — in the spirit of the big personal-finance channels, but for 25-35-year-olds with zero stock market experience. He develops the pilot episode over several sessions with Claude: first the concept, then the structure, then the script. The problem: by the third session the AI is writing like the Wall Street Journal, having forgotten the "conversational tone, no jargon" and the "story → mechanics → takeaway" format agreed on in the first.

Prompt:

# PROJECT BRIEF — YouTube channel "Money Without an MBA"

## SEMANTIC STATE (locked-in decisions)

**Episode goal:** explain how dividends work — without brokerage jargon  
**Audience:** a 28-year-old office manager from Columbus, Ohio who has never bought a stock  
**Tone:** conversational, like explaining it to a friend at a bar — not a lecture, not a manual  
**What we're NOT doing:** no technical breakdown of valuation ratios, no recommendations 
   to buy specific stocks

**Key decisions:**
- Format of every section: story → mechanics → takeaway for the viewer
- Use Coca-Cola as the example — everyone knows it
- Episode length: 8-10 minutes (≈1,200-1,500 words of script)
- The first line must hook the viewer in 5 seconds — no "Hey everyone"

## STRUCTURAL STATE (what's already built)

**Block 1 — "The Hook" (done):**
"Imagine getting paid every year just because you once 
 bought something. It's not a scheme and it's not crypto. It's dividends."

**Block 2 — "How It Works" (done):**
Explained through an analogy with renting out an apartment. 
Terms: dividend yield, shareholder of record — both already explained.

**Block 3 — "The Coca-Cola Example" (IN PROGRESS — your task now):**
Needed: concrete 2023-2024 numbers, what receiving dividends looks like 
in practice; don't explain how to open a brokerage account

**Block 4 — "What the Viewer Should Do" (not started):**
Scheduled after block 3

---

**Task right now:** write Block 3 — the Coca-Cola example.  
Format: story → mechanics → takeaway. Tone — same as blocks 1 and 2.  
At the end, check: does anything you wrote violate any of the locked-in decisions above?

Expected result (our illustration, not measured in the paper):
The model gets the full project context before doing the task. The answer should contain Block 3 in the right format and tone — no jargon, with analogies, in the "story → mechanics → takeaway" structure. At the end comes a self-check: the model explicitly compares what it wrote against the decisions in the brief and flags anything that diverges. That's the kind of thing that tends to get lost over several sessions without a brief.

04

Why It Works

The LLM's weakness: the model doesn't keep an internal "decision log." Early constraints and agreements become less "visible" as the conversation grows, and coding agents also compact (summarize) long sessions, which can drop details; the authors attribute ProjectGuard's gains on Claude Code to compensating for these compaction losses. The paper does not claim a single mechanism.

The LLM's strength: the model is excellent at following explicit, freshly stated instructions. If a constraint sits right before the task, it follows it. The brief turns early decisions from "something we mentioned a few sessions ago" into "right here, in front of you, right now."

How the method exploits this: injecting the brief makes every locked-in decision equally "fresh," no matter when it was made. The semantic state protects against drift in meaning, the structural state against the model building something new instead of reusing what exists. Together they mimic what happens with a single-shot prompt: the entire specification is available at once.

Control levers:

  • Update frequency — update the brief after every session, or only after major decisions. The more dynamic the project, the more often.
  • The "What we're NOT doing" section → our addition, not part of ProjectGuard (which records only accepted decisions). Listing rejected alternatives should keep the model from drifting back to them later.
  • The check at the end of the prompt ("compare against the brief") → drop it if you don't need an explicit check. Keep it for critical tasks.
  • Detail in the structural state → the more precisely the links between blocks are described, the less the model will "rewrite" them during integration.
05

Prompt Template

# PROJECT BRIEF — {project name}

## SEMANTIC STATE

**Goal:** {what we're creating and why}
**Audience:** {who it's for — specifically}
**Tone and style:** {how, and how not}
**What we're NOT doing:** {rejected options, constraints}

**Locked-in decisions:**
- {decision 1 — what exactly and why}
- {decision 2}
- {decision N}

## STRUCTURAL STATE

**{Component/block 1} — status: {done / approved}:**
{short description or key elements}

**{Component/block 2} — status: {done / approved}:**
{short description}

**{Component N} — status: {in progress — current task}:**
{what needs to be done}

---

**Task:** {the specific assignment for this request}
**Output format:** {what I want to get}
**At the end:** check the result against the locked-in decisions above — 
flag any discrepancies.

What to fill in: - {project name} → the name of the document, channel, product, article - {locked-in decisions} → everything agreed on earlier that must not change - {what we're NOT doing} → rejected options, this is critical - {component status} → "done," "approved," "in progress," "not started"


🚀 Quick start — paste into the chat:

I'm running a long project with AI and want to use the "Project Brief" technique 
to fight drift in meaning. Help me fill in the template for my task: 
{describe the project in 2-3 sentences}. Ask me questions to fill in every field.

[paste the template above]

The LLM will ask: what's already been decided and locked in, which components/blocks are done, what must not change — because those fields are critical for the brief to work as insurance against drift. It'll take the template's structure and adapt it to your project.

06

From the Paper (our paraphrase)

ProjectGuard maintains two synchronized external states:

  1. Semantic state — stores durable project knowledge: design commitments, implementation decisions, supporting resources. It's conservative: it records only accepted facts, not every proposal.

  2. Structural state — reflects the repository's organization: files, public symbols, interface relationships, derived from the code.

Before each coding turn, a forecaster combines the current request + the user's previous requests + the external state → and generates a task brief for the agent. The brief highlights relevant design commitments, specifies which modules to preserve or revise, and surfaces repository constraints so edits stay compatible.

When live context runs short → ProjectGuard starts a fresh session and injects the rendered project brief with the current semantic and structural state.

Results on Claude Code: 90% of the semantic-faithfulness gap recovered (mean component score 2.718 to 3.000, vs 3.031 with the full spec up front), fully faithful components up from 118 to 181 of 371, severe failures down from 72 to 49. On Codex: semantic gains were negligible (there was little gap to recover), but reuse of earlier modules improved on 15 of 19 papers.

07

Limitations

⚠️ Manual work: In this manual version you have to update the brief yourself after every significant decision (ProjectGuard does it automatically). If you forget, you inject a stale state that can mislead the model.

⚠️ Not for short tasks: If the project fits in a single chat with full context, just give everything at once in the first message. The brief is for multi-session work or very long conversations.

⚠️ Structural drift is the most widespread loss: Without help, both Claude Code and Codex lost structural integration (reuse of early modules), roughly halving it, while semantic loss was large only on Claude Code. ProjectGuard improved reuse on most papers, but on Claude Code the gain was modest (median +12%). State it explicitly in the brief: "these blocks must be reused, not rewritten."

⚠️ Tests don't catch drift: In the paper, how many of the agent's own tests passed said little about faithfulness to the intended design: tests check what was built, not what you wanted. A self-check against the brief ("compare with the locked-in decisions") is our suggestion for this; the paper didn't test it.

08

Resources

Paper: When the Specification Emerges: Benchmarking Faithfulness Loss in Long-Horizon Coding Agents
Authors: Lu Yan, Xuan Chen, Xiangyu Zhang — Purdue University
Benchmark (open-source): github.com/lunaryan/drift-benchmark
Related work: PaperBench (Starace et al., 2025), MLRBench (Chen et al., 2025), LMR-Bench (Yan et al., 2025)

Research digest

Key result

Early agreements with AI don't vanish — they sink. A plausible reason (the paper doesn't isolate one): new messages pull focus toward the latest text, and long sessions get compacted. "The structure should look like this," said 40 turns ago, can lose weight by the end. The paper's ProjectGuard protects early decisions in long coding sessions by automatically keeping a two-part project state: what was decided (semantic state) and what was built (structural state). Our manual version is a living "project brief". The brief goes at the start of every new request — and early decisions become "fresh" again, as if you'd written everything in one prompt. In the SLUMP study, ProjectGuard recovered ~90% of the lost semantic faithfulness on Claude Code without any changes to the model (on Codex there was little semantic loss to recover, but module reuse improved).

Principle

The model doesn't reliably separate what's important from what isn't, and in long sessions older messages tend to carry less influence (the paper itself doesn't test this mechanism). The brief games this mechanism: every time, it puts early decisions right before the task — as if you'd only just agreed on them. The brief's two sections do different jobs. The semantic state covers the goal, tone and locked-in decisions; we also add what we're NOT doing (our addition: rejected alternatives should keep the model from drifting back to them later). The structural state covers what's been built, how the blocks connect, and what must not break. Without the second section, the model builds a new component instead of reusing the old one.

Why it works

The SLUMP study pinpointed a specific bottleneck: structural integration suffers most — wiring early blocks into the final result. In one of the paper's examples, the agent built the right module early on, and the final integrated code bypassed it with a simplified version. Without help, reuse of earlier modules roughly halved on both platforms. The essence of the fix: the brief mimics a single big prompt. The whole specification is available at once — no matter when the decisions were made. The model is great at following explicit, fresh instructions. The brief makes early decisions just as explicit and fresh as ones you just wrote.

When to apply

Long AI projects where key decisions are made at the start and specific tasks come later — writing a book or course chapter by chapter, building a product module by module, creating a series of materials with a consistent style and structure, especially when the work spans several separate sessions and chats. NOT for simple one-off requests — there the brief only slows you down.

Mini recipe

1. Create the brief before you start. Two sections: "What we decided" (goal, audience, tone, constraints, rejected options) and "What's built" (finished blocks, their status, how they connect). We also recommend a "What we're NOT doing" section (our addition, not tested in the paper). 2. Paste the brief at the start of every request — before the task, not after. Format: brief first, then "Task: [the specific action right now]". 3. Add a check at the end: `At the end, check the result against the locked-in decisions above — flag any discrepancies.` Drop this line only for non-critical tasks. 4. Update the brief after every session. Add new decisions, change block statuses (not started → in progress → done). Ask the AI to update the brief right at the end of the session — give it the current version and tell it what changed.

Examples

Our illustration (the paper tested coding agents, not writing): [BAD]: `Keep writing chapter 3, stick to the conversational style and structure from the first two chapters` (The model doesn't remember what "your conversational style" is. By chapter three it's already writing like a textbook.) [GOOD]: `# PROJECT BRIEF — the book "Finance for Humans" ## WHAT WE DECIDED Goal: explain personal finance to someone with no economics background Audience: a 30-year-old manager from a small Midwestern town who has never read a business book Tone: conversational, like explaining it to a friend — no jargon, no lecturing What we're NOT doing: no charts, no formulas, no "experts recommend" Structure of every chapter: real-life story → mechanics → one-sentence takeaway ## WHAT'S BUILT Chapter 1 "Budget" — done. Hero: Jake from Cleveland, the coffee example. Chapter 2 "Debt" — done. Same hero Jake, the phone payment plan example. Chapter 3 "Emergency Fund" — IN PROGRESS, current task. --- Task: write the section "Why three months, not six" for chapter 3. Format: story → mechanics → takeaway. Tone same as chapters 1 and 2. At the end, check against the locked-in decisions — flag any discrepancies.` (The model gets the full project context right before the task. Jake isn't going anywhere, the tone won't slide into textbook mode, and the chapter structure stays intact.)

In plain words

Coding agents and complex chatbots screw up not because they're dumb, but because they have the memory of a goldfish. The SLUMP study showed it: when the requirements arrive piece by piece over about 60 requests, the final code is less faithful to them than when the full spec is given up front. This is called specification faithfulness loss. The paper doesn't pin down one cause, but an LLM doesn't keep a rigid rulebook in its head, and long agent sessions get compressed, so early requirements can fade in favor of fresh context.

It's like hiring a contractor, handing them a detailed blueprint for a house, and then showing up every day with little tweaks as you go. A month later you get a shed with gold-plated door handles, because the contractor forgot about the foundation while obsessing over curtain colors. Technically they're working, but the big picture fell apart because the day-to-day pushed out the strategy. In coding this turns into a mess: the agent writes functions that contradict the architecture approved at the very start.

The researchers' verdict: one detailed spec at the start beat the same instructions smeared across a long conversation on 16 of 20 projects with Claude Code and 14 of 20 with Codex. The main working method here is maximum specificity up front. If you chop a task into 60 steps, the model is likely to lose some of the thread. What works best is setting hard boundaries right away, instead of hoping the AI will "remember" what you agreed on three hours ago.

The principle plausibly goes beyond code. If you're building a content plan or writing a script across several sessions, Claude or GPT may slide into dull corporate-speak by the end, forgetting your "bold style." It was tested only on coding agents, but the same risk likely applies to other long-horizon work. SEO copy, longreads, complex funnels — anywhere with a "long horizon" of planning, the AI starts hallucinating and cutting corners at your expense.

Bottom line: stop playing "gradual refinement" unless you want garbage at the end. Either write an exhaustive spec up front, or keep feeding the key decisions into every new request, which is what the paper's ProjectGuard does automatically (on Claude Code it recovered 90% of the lost semantic faithfulness). Long context is a trap where old instructions die first. Those who can package a task compactly get results; everyone else gets nicely formatted junk.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on Specification Drift & ProjectGuard: Why AI Forgets Early Decisions — and How to Fix It arXiv:2603.17104

Sign in to apply this study New accounts get 50 free credits.