I don't have a 'classes.txt' file:
root@sftp-test2:/var/lib/puppet/state# l
total 44
drwxr-xr-x. 2 root root 4096 Dec 4 13:09 graphs
-rw-r-----. 1 root root 22128 Dec 13 10:40 last_run_report.yaml
-rw-r--r--. 1 root root 521 Dec 13 10:40 last_run_summary.yaml
-rw-r-----. 1 root root 263 Dec 13 10:40 resources.txt
-rw-rw----. 1 root root 5775 Dec 13 10:40 state.yaml
I ended up coming up with this (it works, but it's clunky):
grep /etc/puppet/modules last_run_* | awk '{print $3}' | awk -F/ '{print $5}' | sort -u