CLAUDE LABJP
QUOTA — The 50 percent weekly usage boost for Claude Code subscribers ended on August 19. Allowances are back to standard today, so long agent runs need rethinking across the weekCONTEXT — v2.1.234 cut the built-in claude-api skill from over 200k tokens to roughly 25k by loading its reference docs on demand rather than all at oncePERMISSIONS — In v2.1.235, permission dialog text and what a grant actually covers now always match, and the don't ask again option is withheld when contents cannot be fully shownCACHE — Fixed whole-prompt-cache invalidation when a language server disconnected or reconnected mid-session, which had been quietly hurting hit rates on long sessionsSESSION — Claude Code now continues your session automatically when a claude.ai usage limit resets. Turn it off under Continue automatically at usage limit in /configPRICING — Claude Sonnet 5's introductory $2 per million input and $10 output ends August 31; standard $3 and $15 pricing starts September 1, eleven days outQUOTA — The 50 percent weekly usage boost for Claude Code subscribers ended on August 19. Allowances are back to standard today, so long agent runs need rethinking across the weekCONTEXT — v2.1.234 cut the built-in claude-api skill from over 200k tokens to roughly 25k by loading its reference docs on demand rather than all at oncePERMISSIONS — In v2.1.235, permission dialog text and what a grant actually covers now always match, and the don't ask again option is withheld when contents cannot be fully shownCACHE — Fixed whole-prompt-cache invalidation when a language server disconnected or reconnected mid-session, which had been quietly hurting hit rates on long sessionsSESSION — Claude Code now continues your session automatically when a claude.ai usage limit resets. Turn it off under Continue automatically at usage limit in /configPRICING — Claude Sonnet 5's introductory $2 per million input and $10 output ends August 31; standard $3 and $15 pricing starts September 1, eleven days out
Articles/Claude.ai
Claude.ai/2026-07-06Advanced

When Instructions Fade in Long Conversations: Measuring Adherence and Pulling It Back

System-prompt instructions quietly lose their grip as a conversation grows. This piece turns that drift into a number you can track, then fixes it with prompt structure and mid-conversation re-anchoring, backed by runnable code and measured results.

Claude48system prompt3long conversationprompt design6instruction following

Premium Article

One evening I was batch-generating drafts for four sites at once.

The first several came back with exactly the heading structure I had asked for. But somewhere around the twentieth, a "summary" section I had never requested began quietly slipping in. No errors. The model was writing with full confidence, and writing something slightly different each time.

I only noticed the next morning, looking at the diffs. It was unsettling. Nothing had broken. The instructions had simply faded.

The longer a conversation runs, the more quietly a system prompt loses its grip. This piece is about catching that fade as a number rather than a hunch, and then pulling behavior back with prompt structure and a mid-conversation fix, all traced through runnable code and measured results.

Why instructions fade as conversations grow

Several independent forces stack up behind fading instructions.

One is position. The system prompt is pinned to the front of the conversation, but as turns accumulate, the model leans harder on recent context. The rules up front become relatively "far away."

Another is dilution. Once twenty turns of exchange are in the history, the ten lines of constraints you placed at the start are a tiny fraction of the whole. The absolute amount of rule text hasn't changed, but its weight has dropped.

Then there is competition. When you slip a new request or an exception into the middle of a conversation, it acts as an implicit override and quietly collides with the original rules.

None of this is the simple story of "the model forgot." It's the priority of adherence sliding along with the center of gravity of the context. That's exactly why we start by measuring.

Turning adherence into a number

As long as you're saying "it feels like it's drifting," you can't verify whether any fix actually worked. So we define the rules as a set of checks that can be judged mechanically, and produce an adherence score for each turn of the conversation.

For a concrete target, imagine we want the model to obey three rules: "always start headings with H2," "never use bullet points," and "don't append a sources section." The judging is done with deterministic checks such as regular expressions, never relying on the model's own self-report.

import os
import re
from anthropic import Anthropic
 
client = Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
 
SYSTEM_PROMPT = """You are an assistant that drafts technical articles.
Always obey these rules.
1. Headings must start with ##.
2. Do not use bullet points (lines beginning with - or *).
3. Do not append a "Sources" or "References" section at the end."""
 
# Judge each rule with a deterministic function (True = obeyed)
def rule_heading(text: str) -> bool:
    return bool(re.search(r"^##\s", text, re.MULTILINE))
 
def rule_no_bullets(text: str) -> bool:
    return not re.search(r"^\s*[-*]\s", text, re.MULTILINE)
 
def rule_no_sources(text: str) -> bool:
    return not re.search(r"(Sources|References)", text)
 
CHECKS = {
    "heading": rule_heading,
    "no_bullets": rule_no_bullets,
    "no_sources": rule_no_sources,
}
 
def adherence(text: str) -> float:
    passed = sum(1 for fn in CHECKS.values() if fn(text))
    return passed / len(CHECKS)

Next, we send nearly the same "probe" request on every turn and record the adherence score each time. The history keeps growing, so the context gets longer as the turns advance. Keeping the probe text almost identical isolates the change as coming from prompt length rather than from what we asked.

PROBE = "Write about 60 words of body text under this heading. Any topic is fine."
 
def run_session(turns: int, reanchor_every: int = 0):
    history = []
    curve = []
    digest = "Strict: (1) headings start with ## (2) no bullets (3) no trailing Sources section"
    for t in range(1, turns + 1):
        # Re-inject the rule digest at a fixed interval (0 disables it)
        if reanchor_every and t % reanchor_every == 0:
            history.append({"role": "user", "content": digest})
            history.append({"role": "assistant", "content": "Understood. I will strictly comply."})
        history.append({"role": "user", "content": PROBE})
        resp = client.messages.create(
            model="claude-sonnet-5",
            max_tokens=400,
            system=SYSTEM_PROMPT,
            messages=history,
        )
        out = resp.content[0].text
        history.append({"role": "assistant", "content": out})
        curve.append((t, adherence(out)))
    return curve

The point of this harness is that judgment never depends on human eyes or on the model grading itself. An adherence of 1.0 means every rule was obeyed; 0.66 means one has slipped, at a glance. Run run_session(50) in the bare state first, and watch the shape of the decay.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A small harness that scores instruction adherence turn by turn (Anthropic SDK, runnable as written)
Locating the turn band where rules break, then restoring adherence by restructuring the system prompt (before/after)
A re-anchoring implementation that re-injects a rule digest mid-conversation, with measured cadence tuning
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
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 →

Related Articles

Claude.ai2026-03-15
AI Partner — Intermediate Guide: Better Prompts, Memory Workarounds, and Multiple Personas
Ready to go deeper? Learn how to write tighter system prompts, work around Claude's memory limits, prevent character breaks, and run multiple AI personas for different parts of your life.
Claude.ai2026-08-18
What to Settle Before Watermarked Claude Text Ships Inside Your App
Claude models released on or after August 2, 2026 embed watermarks in generated text and attach C2PA-signed provenance metadata to files. Here is how I redrew the line for shipped copy, plus a measured look at where image metadata disappears and a submission gate that keeps provenance reproducible.
Claude.ai2026-07-12
Using Claude's Reflect Monthly Review to Tune a Solo Dev Rhythm
How to read Claude's new Reflect monthly review as a planning tool for the month ahead rather than a report card, grounded in the day-to-day rhythm of solo development.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →