Changes introduced outside the agent window create a new state that is different from the agents.
After commands or changes are made outside of the agents doing; the agent would notice its world view changed and eventually recover, but that fills up precious context for it to bring itself up to date.
Why don't run the commands yourself then?