Commands: Only use ambient context on same project

Fixes #990

Manually verified.