> For the complete documentation index, see [llms.txt](https://studio-docs.sandbox.game/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://studio-docs.sandbox.game/working-efficiently-with-ai/understanding-context-windows.md).

# Understanding context windows

Every conversation you have with an AI assistant in Cursor has a limit on how much it can hold in mind at once. That limit is the context window. When you hit it — or push close to it — the quality of your AI's work degrades in ways that are not always obvious. Knowing what a context window is, and how to work within it, is the single most impactful habit you can build as a Sandbox Studio creator.

## The Core Explanation

### What a context window actually is

When you open a chat with Cursor's AI, everything in that conversation — your messages, the AI's replies, the files it has read, the code it has seen — is loaded into a running block of memory called the context window. The AI can only reason about what is inside that window. It has no memory of previous chat sessions, no awareness of files it has not been shown, and no concept of your project beyond what has been explicitly included.

The window is measured in tokens. A token is roughly a word, though punctuation and code syntax can each count as individual tokens. A typical Cursor chat session supports somewhere between 100,000 and 200,000 tokens, depending on the model. That sounds like a lot. In a complex game development session, it is not.

### What fills the window

Every exchange adds to the window. Your messages, the AI's responses, the contents of any files it reads, search results it pulls up — all of it accumulates. In a Sandbox Studio project specifically, a few things will eat tokens faster than you expect.

The engine skill files load automatically when the AI detects it needs Sandbox Studio-specific knowledge. The core engine skill alone is roughly 10,000 tokens. Multiplayer, UI kit, and asset-pack skills add more on top.

The .engine folder contains the full engine source code. If you ask the AI to explore it broadly, it can consume thousands of tokens in a single response before it has written a single line of your game code.

Scene files (.genesys-scene) are the most dangerous. These serialised scene files can be enormous. The AI is explicitly configured to avoid reading them unless you ask it to, but if you instruct it to open one, the context impact is severe and immediate.

Open files in your editor are surfaced to the AI as context. The more files you have open, the more passive context the AI is carrying.

### What happens when it fills up

The window does not throw an error. The AI does not warn you. It simply starts to lose fidelity.

The first sign is that the AI begins forgetting things established earlier in the conversation — instructions you gave, decisions you made together, code it already wrote. It may undo a change it made three responses ago because it no longer has that exchange in view. It may start repeating work.

More dangerously, it may start making confident errors. Because it is now working with an incomplete picture of your project, it fills gaps with plausible-sounding guesses. Those guesses look like real code, real answers, and real solutions. They are not.

The longer you push a single chat session, the worse this gets. A session that produces excellent results in the first hour can become actively counterproductive in the third.

### Handovers: starting a new chat cleanly

The right response to a filling context window is a handover. A handover is a deliberate, structured transition from one chat session to the next that preserves what the AI needs to know without carrying over everything it has accumulated.

Before closing a session that has run long, ask the AI to produce a short handover summary. Tell it to include: what was built, what decisions were made and why, what still needs doing, and any files or code it should read first in the new session. Keep this summary concise — it will itself consume tokens in the new chat.

Open the new chat, paste the handover summary as your first message, then continue. The new session starts clean with a full window, armed with the context it actually needs.

## Practical Guidance

* Start a new chat for every distinct task. Fixing a bug, building a new system, and refactoring a component are three separate tasks — give each one its own session.
* Keep only the files you need open in your editor. Open files add to your passive context automatically. Close files once you are done with them.
* Do not ask the AI to explore the engine source broadly. Ask it targeted questions about specific systems instead. If you need to understand how Actors work, ask about Actors specifically — not "how does the engine work."
* Never instruct the AI to open a .genesys-scene file unless you have a specific reason and understand the token cost. The scene editor manages those files — the AI does not need to.
* Ask for a handover summary before ending any long session. Even if you plan to continue later the same day, the summary costs you thirty seconds and can save you an hour of rework.
* In a new session, give the AI only the context it needs — paste the handover summary, reference the files relevant to the current task, and nothing more.

## Common Mistakes

| Mistake                                                                           | What to do instead                                                                             |
| --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Running one chat session for an entire feature from start to finish               | Break the work into tasks and start a fresh chat for each                                      |
| Asking the AI to "look at the whole project" or "check all my files"              | Reference only the specific files and systems relevant to what you are building                |
| Ignoring signs of degrading quality and pushing the session further               | Treat confusion, repeated mistakes, or forgotten instructions as a signal to do a handover now |
| Starting a new chat with no context and expecting the AI to remember last session | Always open new sessions with a handover summary                                               |
| Opening a .genesys-scene file in the AI chat without a specific reason            | Let the scene editor manage scene files; keep them out of the AI context                       |

The context window is not a limitless resource, and the AI will not tell you when it is running out. Treat every chat session as a focused work block with a natural end, and use handovers to carry the right knowledge — not everything — into the next one.

![](https://content.gitbook.com/content/WgFjStdWWXj1Wc6xnrcJ/blobs/YuZSMi98nupgNGAQbNZb/Unknown%20image)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://studio-docs.sandbox.game/working-efficiently-with-ai/understanding-context-windows.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
