If you add the following function to your .bashrc
function cd () {
builtin cd "$@" && [[ -f .aliases ]] && . .aliases;aliases
return 0
}
Every time you cd to a directory with an .aliases file it will get sourced.
Careful with security if others can create files on your machine.
With this trick aliases never get removed but you can write as much code as you like in the function.
ondir uses this trick and has a ton of bells and whistles.