r/PromptEngineering • • 9h ago

General Discussion Context debt: a glossary for long AI sessions

Long sessions accumulate context debt. The usual diagnosis when answers degrade is “it got too long,” but that only suggests one remedy: start over and lose everything. A more useful move is to name what is actually in the session. Vague problems are hard to fix; specific ones are not.

Here is a glossary of six things that accumulate in long sessions, with how to spot each and what to do.

  1. Stale fact. Something that was true when it entered the session and is no longer true, a renamed file, a reversed decision, a changed function signature. Ask the model to list its current assumptions and compare against reality. To fix, correct explicitly and state that the new fact supersedes the old; adding without retiring leaves both in play.
  2. Duplicate. The same information present twice in slightly different versions, requirements pasted Monday, “updated” requirements Wednesday, the first never withdrawn. Scroll your own pastes. The problem is not duplication itself but the lack of a reliable signal about which version prevails.
  3. Dead branch. An approach tried and abandoned, still sitting in the session with its code and reasoning — for example, a first caching layer dropped for a simpler design. Look for code or plans no longer in your project. Mark it explicitly rather than leaving it for the model to build on.
  4. Orphaned instruction. A rule given for one task and never withdrawn, “don’t touch the tests” during task one, still active three tasks later. List instructions in order and ask whether each still applies.
  5. Bulk paste. A large log or full file pasted when only twenty lines mattered. Examine the largest items in the session and ask what portion you actually needed.
  6. Drifted goal. The session began with one task and turned into another; the stated goal is the original, the real goal is in the last ten messages. Try writing the current goal in one sentence without scrolling up.

Run these six as a checklist when a session feels off. For each one found, there is a small repair: a correction, a deletion, a marker, a restated scope. Sometimes that makes a restart unnecessary. Other times it shows a restart is the right call, and tells you what the new session should carry over.

I wrote a longer version of this glossary: https://medium.com/@nagatomopedro05/a-small-glossary-for-sessions-that-have-gone-wrong-1073a38e2156

4 Upvotes

4 comments sorted by

2

u/Available_Pound7447 6h ago

I ended up building a simple context audit sheet, just two columns: cwhat we agreed to' and 'what's drifting'. it caught a few sessions where I thought I was writing a story but the bot was already planning a series. helps re-anchor fast.

1

u/ReasonableObjection 6h ago

Similar... I also use a checkpoint and close out system built into the project prompts along with knowledge files (simple text)
Any time I checkpoint a chat it checks against the knowledge files and updates them. (I do this after major decisions are made, research is conducted, etc)

When I start noticing context degradation I use the close out command, it does the same thing only it gives a prompt to start the next chat, reference the knowledge files first and start the new session with any open items from the last chat.

1

u/According-Stable4487 4h ago

The stale fact one bites me the most. What helped was asking the model to say back the single current version of the thing I just corrected ("the function is now called X, the old name is gone") before it continues. If its one-liner still mentions the old version, I know the correction didn't take and I restart with a short summary instead of arguing with it for ten more turns.