# LLMs have no memory

> So how does Copilot know your code? It never remembers. It re-reads, re-ranks and re-sends your context on every single request.

- **Format:** short video, 9 steps, ~28 seconds
- **Topic:** Why LLMs are stateless, and how GitHub Copilot rebuilds your project context into a token-limited prompt on every request
- **Author:** Suthahar Jegatheesan (MSDEVBUILD)
- **Category:** GitHub Copilot · copilot
- **Tags:** githubcopilot, ai, llm, contextwindow, promptengineering, aicoding, developertools, vscode, softwareengineering, generativeai, programming, msdevbuild
- **Canonical URL:** https://blog.msdevbuild.com/shorts/copilot-context-window/

---
## What you'll learn

- Why the model holds nothing between two requests
- How your editor rebuilds the whole prompt every time
- What competes for the same fixed token budget

## Understand it one step at a time

### 1. Copilot does not remember you

The model is stateless. Between two requests it holds nothing — not your repo, not your last question.

### 2. The model is a frozen function

Tokens in, one token out. Weights are read-only at inference, so nothing you type is ever written back.

### 3. So the editor rebuilds the world

Every suggestion is a fresh prompt your IDE assembles: the file, the tabs, repo rules, retrieved code, the chat so far.

### 4. It reads around your cursor

Your file is split into a prefix and a suffix, and the model is asked to fill in only the middle.

### 5. Your open tabs are the context

Copilot scans nearby files you have open, scores the snippets that look like your code, and pastes the winners in.

### 6. Chat searches your repo index

Ask about #codebase and your workspace is chunked, embedded and searched — again on every turn.

### 7. Everything fights for one budget

The context window is a fixed number of tokens. Rules, code, retrieved snippets, history and the answer all share it.

### 8. Chat memory is the transcript, resent

Every turn ships the whole conversation again. When it stops fitting, the oldest turns fall out — and it "forgets".

### 9. So give it what it needs to know

Instruction files, the right tabs open, explicit #file references and a fresh chat when it drifts. That is the real memory.

---

## The takeaway

**It never remembered. It re-read.**

Copilot feels like it knows your codebase because your editor rebuilds the context on every request — and all of it has to fit in one window.
