# agent: Snapshot context in user message instead of recreating it \(\#27967\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 315f1bf16843044c8b8b3a0b35111d515a9a4c3e

Requested commit: 315f1bf16843044c8b8b3a0b35111d515a9a4c3e

Commit: 315f1bf16843044c8b8b3a0b35111d515a9a4c3e

Tree: ef87f3c1dac09519cb35175e79a41f23559a835d

Author: Agus Zubiaga

Committer: GitHub

## Message

```
agent: Snapshot context in user message instead of recreating it (#27967)

This makes context essentially work the same way as `read-file`,
increasing the likelihood of cache hits.

Just like with `read-file`, we'll notify the model when the user makes
an edit to one of the tracked files. In the future, we want to send a
diff instead of just a list of files, but that's an orthogonal change.


Release Notes:
- agent: Improved caching of files in context

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
```

## Parents

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

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