Agent to manage long-running shell commands