Anyone/anything solving the issue of bash histories in multiple (intricated) tmux sessions is an INSTANT win !!!! [Q: can this tool help? As far as in understand, it seems that YEEEES!!!]
#write to history file at each shell prompt
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
(Unless I read your comment wrong.)