I sometimes work with files that are tens of thousands of lines long. What’s the recommended way to make sure the agent reads the whole file instead of only part of it?
Hey @Dahlia_Dinh, thanks for the question.
For files that large, Agent reads the content in ranges rather than keeping the entire file verbatim in context at once. The selected model also has a fixed context window, so older content may be summarized as the conversation fills up.
If you need a complete pass, start a fresh chat, choose a long-context model, reference the file with @, and use a prompt like:
“Read path/to/file.ext from line 1 through the end in consecutive, non-overlapping chunks. Track every range you read, do not skip any range, and confirm the final line number before answering. Summarize each chunk consistently before producing the final analysis.”
For code, searching for specific symbols or execution paths is usually more effective than reading every line. For logs or data, ask Agent to run a script that extracts or summarizes the relevant information first. This provides more reliable coverage while using less context.
You can monitor context usage with the context ring beside the prompt input: Prompting and context usage. If you share whether the file contains code, logs, or structured data, I can suggest a more specific workflow.