I love how the whole thing is just two commands. You can actually just add this to your .zshrc to have the full functionality
function zshaddhistory() {
echo "${1%%$'\n'}|${PWD} " >> ~/.zsh_history_ext
}
function jog() {
grep -v "jog" ~/.zsh_history_ext | grep -a --color=never "${PWD} " | cut -f1 -d"|" | tail
}