tcsh: have the following in .cshrc (or .tcshrc)
set prompt="[%C3]: "
zsh: have the following in .zshrc
PS1="[%3C]%# "
bash: have the following in .bashrc
PS1='[${PWD#${PWD%/*/*/*}/}]\$ '
Lacking direct support this is a good approximation.