iTranslated by AI
Investigating the Number of Lines AI Coding Tools Like Cursor and Claude Code Can Read at Once
Motivation
I wanted to identify the cause of issues such as functions being regenerated in tools like Cursor or Roo Code.
Information by Provider
- Information as of April 26, 2025
Each provider differs in the number of lines they read from a file at a time.
- Cline: Defined by file size (300KB)
- Roo Code: Cline+; the default is 500 lines, and the number of lines is variable.
-
(Unofficial) Claude Code: 2000 lines
There is no official source, but it seems that several investigations have been conducted by volunteers.
I will omit the source for certain reasons. -
Cursor: 500 lines => 250 lines
- Codex: The maximum number of lines is undefined, but in practice, an error occurs and a split request is issued when the context length is exceeded.
- (Unofficial) Windsurf: 200 lines (however, it understands the overview through symbols)
- GitHub Copilot Agent: Summarization is triggered at 500 lines or more.
- Devin: The number of lines for splitting is unknown, but it understands the context in a RAG format.
What Does This Mean?
Even when using Gemini 1.5 Pro or Claude 3.7 Sonnet, the context is chopped up into the line counts mentioned above, which means that for files with a large number of lines, the long context isn't being fully utilized.
However, this is reasonable from a development perspective. Making it variable depending on the model is somewhat troublesome, and it could lead to negative perceptions if costs were to increase.
Also, when using Vector Indexing like Cursor does, small chunks can improve the accuracy of the search.
While this approach might allow the system to grasp the overall structure, details like type information might be lost. It's a trade-off in that case.
Ultimately, it's possible that not making the retrieval of long code the default results in faster responses from the LLM, leading to a better user experience.
Evidence That Fragmented Context Hinders Performance
By only keeping the last 512 tokens as code context (w/o out-of-window context), we can see that the performance is nearly the same as UniXcoder … which shows the importance of modeling long code context.
By only keeping the last 512 tokens as code context (without out-of-window context), we can see that the performance is nearly the same as UniXcoder... which shows the importance of modeling long code context.
Our experimental results demonstrate that code completion can benefit from taking longer context into consideration, and our LongCoder achieves superior performance
Our experimental results demonstrate that code completion can benefit from taking longer context into consideration, and our LongCoder achieves superior performance.
This essentially suggests that being able to maintain a longer context leads to better performance compared to fixed-length contexts.
Why Claude Code is Expensive
From the above, Claude Code reads a significantly higher number of lines than the others.
This is likely why the token consumption becomes astronomical.
There is also speculation that the prompt itself might be very heavily constructed...
Conclusion
From the above, we can draw the following conclusions:
How to Choose an Editor
If you want to write code with a large number of lines, or if you want to do "vibe coding" without worrying too much about the details:
=> Cline, Codex, Roo Code (with limits already modified), Claude Code
(It seems likely that one of the reasons OpenAI and Claude released their own CLI editors is related to this.)
Vibe coding is also recommended here:
If you want to scan the entire folder and handle minor inconsistencies by fixing them yourself:
=> Cursor, Windsurf, etc.
Bonus
If you found this interesting, I would appreciate it if you could follow me 🙇
Past Articles
About what can currently be done with local LLMs:
What is needed to use each editor, etc.:
Discussion