Smarter about directory context