Latexmk (or more general build tools like SCons and taskfile.dev) detect necessary runs in the build process when dependent files are changed based on a check sum of the content. Latexmk generates for this purpose a file with the extension .fdb_latexmk where filenames with check sums are stored.
I could imagine a similar functionality for runcode. Is this feasible to add to the cache option?