Hey, zsh 5.8 we have several Ansible repositories in different directories. I often have to switch between them. Unfortunately the tab completion for all the Ansible commands caches known Hosts & Groups in the global variables _ansible_hosts & _ansible_groups. For me the effect is that the wrong set of hosts & groups is offered when I change to a different Ansible repo. How to reproduce: 1. Have two or more Ansible repositories with different inventories somewhere 2. cd into /path/to/first_ansible_tree 3. Type `anssible `, let tab completion cache hosts & groups 4. Hit again to verify that the offered completions match expected ones 5. cd into /path/to/other_ansible_tree 6. Type `ansible ` and observe that the offered completions still come from the first_ansible_tree, not from other_ansible_tree As a quick workaround I've modified the completion to also cache the working directory where _ansible_hosts & _ansible_groups were created. If the current working directory doesn't match the cached working directory, both variables are unset & their values cached again. This seems to work. The attached patch implements this. Feel free to use it however you want, or to apply a totally different solution. Thanks. Kind regards, mosu