Fix: Stale Context Warning

Symptoms:

  • Claude suggests code changes that revert previous fixes.
  • Claude asks "What file were we working on?"
  • Claude hallucinates function names that don't exist.

The Cause

The Context Window acts like a sliding window. As you add new messages, the oldest messages (system prompts, initial file reads) fall off the "cliff". Once they are gone, Claude literally forgets they happened.

The Fix

1. The "Refresh" Protocol

Don't just keep chatting.

  1. Summarize: Ask Claude: "Summarize our current progress and the file state."
  2. Restart: Start a New Chat.
  3. Paste: Paste the summary into the new chat.

2. Re-read Key Files

If Claude is making mistakes about a file:

"Stop. Read src/app/page.tsx again. You are operating on stale information." This forces the current file content into the "fresh" part of the context window.

3. Use "Pinned" Context (Enterprise)

If you are on an Enterprise plan, use the "Project Knowledge" feature to pin README.md or coding-standards.md so they never fall out of context.