This code is a sample javaassist-based agent that records which classes have been loaded (eg, used). At periodic intervals, it prints the list of classes as a JSON blob to stdout.
You will need gradle 6.1 or later installed. To build, run gradle shawdowJar from the root of the repository. Note that gradle is not required to use the agent, only to rebuild it.