Quokka Community edition is a plugin that achieves the same things as scratch files and goes a bit further by running the file and pre-hinting the results.
The files are not saved in your working tree, and you can view recent quokka files.
For me it replaced scratch files from Webstorm for vscode and even did better.