If you ever wanted the shell to do something small after each command, the hook for it is a plain variable.
Bash executes the value of PROMPT_COMMAND before it prints the primary prompt. Put something in ~/.bashrc and it runs after every command you finish:
PROMPT_COMMAND='history -a'
That appends the new history lines to the history file right away, so a second terminal sees them without waiting for the first one to close. To run several things, join them with semicolons. The manual also says that if the variable is an array, every set element is run as a command, so you can keep the pieces apart:
PROMPT_COMMAND=('history -a' 'date +%T')
That saves the history and prints the time before every prompt.
Anything slow in there delays every prompt. A network call or a big git status in a large repository will make the shell feel sticky, so keep the hook short. Also append instead of overwrite when a framework already set the variable:
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
Otherwise you silently break whatever the other tool installed.
Further reading: bash(1) manual page