Partial work towards re-landing #44936. Both the `clang_tidy` and `githooks` passage could benefit from being able to automatically find the latest `compile_commands.json` output, which means that some common code should exist in the `tools/` directory. This is a very minimal (but tested) library for doing exactly that.