Hi Michael -
I am very surprised that you had to reinstall the agent to make it work after deleting this folder.
A breakdown of what is in the folder:
the .Agent folder contains a folder with all the deployment logs in it. I'd recommend not deleting this folder: the contents are all text (ie small) and could prove useful.
The .Agent folder also contains a cache of NuGet packages downloaded from the server. The agent might behave a little strangely and need a restart if you delete these while it's running, but otherwise you can safely delete them.
The other directories in this folder should correspond to package deployments for projects in Deployment Manager or agent upgrades. You should be careful when deleting these, since your currently deployed projects are probably in these folders: for example if you have a running IIS website, it will be located in here by default. As long as you are sure these deployments are past their sell-by-date, they can be deleted however.
In summary, I wouldn't be surprised if you had to restart the agent after deleting the contents of this directory, it could get confused about which files exist. It definitely shouldn't need to be reinstalled, though - it'd be really good to work out what's going on here so that we can fix it.
What exact behaviour were you seeing? Were there any errors in the Windows Event Viewer relating to the agent? Did you try restarting the agent services from the Windows Services control panel?
We are also looking at improving the use of this directory in the near future, and cleaning up unused files from here so that it takes up less space. If you have any strong opinions about how this should work, let us know. If you think this is currently the most important thing for us to be working on, vote for it on uservoice