# agent: Show which lines were read when using \`read_file\` tool \(\#28077\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/9e38c45a9bc0c4db5d22c16b3021f00a213d3e88)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 9e38c45a9bc0c4db5d22c16b3021f00a213d3e88

Requested commit: 9e38c45a9bc0c4db5d22c16b3021f00a213d3e88

Commit: 9e38c45a9bc0c4db5d22c16b3021f00a213d3e88

Tree: 3bd4422f92be9d8efc0cdd03ff98d3b4545590f5

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
agent: Show which lines were read when using `read_file` tool (#28077)

This makes sure that we specify which lines the agent actually read,
avoids confusing scenarios such as:

<img width="642" alt="Screenshot 2025-04-04 at 10 22 10"
src="https://github.com/user-attachments/assets/2680c313-4f77-4971-8743-8e3f5327c18d"
/>

Here the agent starts out by actually only reading a certain amount of
lines when the first tool call happens, then it does a second tool call
to read the whole file. To the user this looks like to identical tool
calls.

Now:
<img width="621" alt="image"
src="https://github.com/user-attachments/assets/76222258-9cc8-4b7c-98c0-6d5cffb282f2"
/>
<img width="362" alt="image"
src="https://github.com/user-attachments/assets/293f2fc0-365d-4b84-8400-4c11474caeb8"
/>
<img width="420" alt="image"
src="https://github.com/user-attachments/assets/ca92493e-67ce-4d45-8f83-0168df575326"
/>



Release Notes:

- N/A
```

## Parents

- [1db3d92066bae1dc8e3c482faf3461ffcb9cf694](https://git.cafe/gitcafe/zed/commit/1db3d92066bae1dc8e3c482faf3461ffcb9cf694?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/9e38c45a9bc0c4db5d22c16b3021f00a213d3e88?format=markdown)
