Building off the answer provided by [Groggle](https://unix.stackexchange.com/users/184829/groggle), you can create an alternative cd (ch) in your ~/.bash_profile like.
function ch () {
cd "$@"
export HISTFILE="$(pwd)/.bash_history"
}
automatically exporting the new HISTFILE value each time ch is called.
The default behavior in bash only updates your history when you end a terminal session, so this alone will simply save the history to a .bash_history file in whichever folder you happen to end your session from. A solution is mentioned in [this post](https://askubuntu.com/questions/67283/is-it-possible-to-make-writing-to-bash-history-immediate) and detailed on [this page](http://web.archive.org/web/20090815205011/http://www.cuberick.com/2008/11/update-bash-history-in-realtime.html), allowing you to update your HISTFILE in realtime.
A complete solution consists of adding two more lines to your ~/.bash_profile,
shopt -s histappend
PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
changing the history mode to append with the first line and then configuring the history command to run at each prompt.