The working directory persists between commands, but shell state does not. The shell environment is initialized from the user's profile (bash or zsh).