Agent Panel: calls `git add --all` and freezes
Summary
When I send a message to the agent (either a real prompt, or a simple hi) no response is shown, and a process for git add --all is started.
Description
Steps to trigger the problem:
- Navigate to my project that is 5.5 GB in size with some large files not added to git
- Chose model "Claude 3.7 Sonnet" via zed
- Open the agent panel, give it a prompt like "make this parameter user configurable"
Actual Behavior: Upon hitting enter, my message disappears. No response from the agent appears. The CPU jumps to 100% because
git add --allruns. When I kill the git process, it starts again until I quit zed and kill the git process. Expected Behavior: The agent should not rungit add --all. It should answer me / show me a reply.
Zed Version and System Specs
Zed: v0.185.10 (Zed) OS: Linux Wayland opensuse-tumbleweed 20250428 Memory: 31 GiB Architecture: x86_64 GPU: Intel(R) Iris(R) Xe Graphics (ADL GT2) || Intel open-source Mesa driver || Mesa 25.0.5
Zed is configured to not run anything without asking for confirmation first:
Yeah, that's definitely not great. Seems we're doing git add --all automatically (i.e. claude has nothing to do with it, so running tools without confirmation setting doesn't apply) in order to checkpoint the project before running the assistant (to allow for reverting all assistant edits, even ones done through bash I assume).
There's probably a better way to do this, but for now until we have a better way I recommend making sure all the large files not in git are in a .gitignore or similar so git doesn't process them when git add --all is ran.
Thanks, I'm happy to hear that this is manually intended behavior and not some agent going rogue :)
I'll work on my project's git setup until this is fixed in Zed properly, thanks for the hint!
I also hit this issue but did not figure out what was happening until today. I'm guessing that other people are experiencing this issue but do not realize it.
A few days ago the agent started to be very slow, in the sense that when I posted a message I did not see my message until after 2-3 minutes and then the agent started working. This happened on each message I sent. This made the agent experience quite poor.
Then I also noticed that sometimes the fans on my laptop started spinning wildly, I did not give it much though until today when I noticed that someone was calling git add --all and it was indeed zed doing this and it was using a single CPU at 100% for a long time. Then I found this issue and could finally "fix" my problem.
The root cause of the issue was that I copied some large temporary files (a few GBs) into my project folder which I intended to delete in a few days.
I think this (unexpected) behavior should be at least documented and a warning given. It would be best if you could check the sizes of files which git would work on before running this command and give the user a warning if they are quite big.
We've implemented a fix for not tracking large files when creating checkpoints in the Agent:
- https://github.com/zed-industries/zed/pull/31352.
A partial fix so large files are not included will ship in today's Zed Preview. If you still run into this, comment below with steps to trigger and we can reopen.