When editing the Cake file, during edit select 'Add [tool|addin] from nuget' command and add something.
The tool (or addin) will be added to the Cake file as it is, on the disk but not in the file that is currently open.
Example:

I see two possible soltions:
- If the file is already open simply add the content to the current file (without saving it) - not sure if that's possible, though
- Ask the user to save, before the file is modified.