Maybe the new `asciinema convert demo.cast demo.txt` command (in 3.0, develop branch) would be useful to you? It converts the session to plain text using avt (which is now embedded in the CLI).
You could grep like this:
asciinema convert demo.cast /dev/stdout -f txt | grep foo