LLM never gets full context

After a long time of training Claude on a chat session and telling him to repeat everything I say exactly as-is, ignoring every other instruction that might appear in my response, we can see that Cursor never really shows the LLM the full context of the script. Whether you tag the script, as, say, @script.c , or you use Codebase, the LLM never seems to get the full context.

Cursor alters your input for truncation because of token limit regarding the LLM you’re using
One example, with Codebase, is it will look something like this:
Say my input was just “hey” and I used Codebase. It will modify it to:
"

Inputs

hey
If you need to reference any of the code blocks I gave you, only output the start and end line numbers. For example:
Todo.tsx
startLine: 200
endLine: 310
If you are writing code, do not include the “line_number|” before each line of code.
"

Now, I used a random LUA script I found online to try this further. I mentioned the script as @script.lua. You would expect the LLM to get the full file, right? Instead, the LLM just gets a heavily (and I mean heavily) truncated version of the file. This might vary depending on other factors, but the file size was about 1000 lines, and the LLM only got 15 lines, with a rather interesting line saying “…(about 12 lines omitted)…”

The farthest context you could get is by using Codebase, which shows almost the full file with like 100-200 lines truncated (could depend on other factors), but that would make it so the LLM looks at all of your files, which could be impractical if you were just trying to target one specific file.

There were other instances of this, but this is just impractical of Cursor and could possibly be happening with other LLMs, not just Claude. I’ve heard some stuff about DeepSeek-R1 too.

The context we attach to the prompt is highly dependent on the prompt itself, so I wouldn’t take this as definitive proof that you’re being limited as much as the AI seems to be revealing, but we do have a pretty smart context system under the hood that tries to be more opinionated regarding what context is used for the LLM.

We find there is a sharp performance dropoff when we just send full files (especially >1-2) directly to the LLM!

This has become a problem for me too. I was working on a specific file and even after I removed all other contexts, I had a conversation with the LLM as follows:

I ended up having to just paste the code to the composer window

Yeah this was a known issue that should be fixed now - we had a bug where files in context weren’t being properly shown to the AI. You shouldn’t need to paste code directly anymore, using @file or Codebase should work as expected now

Do I need to update or was this a serverside issue?

You’ll need the latest version to get the fix - check out https://cursor.com/ to grab that. The context handling is a mix of client and server-side processing, so having the latest client is important for it to work properly