First make these executable:
chmod +x list-environments.zsh
chmod +x delete-environment.zsh
Next: run ./list-environments.zsh and you will get output like this:
{
"items": [
{
"env_id": "[redacted-env-id]",
"kind": "single",
"display_name": "[redacted-device-name]",
"host_name": "[redacted-host-name]",
"name": "[redacted-device-name]",
"online": false,
"busy": false,
"os": "Mac OS",
"os_version": "26.x",
"arch": "arm64",
"app_server_version": "0.131.x-alpha",
"installation_id": "[redacted-installation-id]",
"client_type": "CODEX_DESKTOP_APP",
"originator": "Codex Desktop",
"terminal": "unknown",
"client_name": "codex-backend",
"client_version": "unknown",
"last_seen_at": "[redacted-timestamp]"
},
{
"env_id": "[redacted-env-id]",
"kind": "single",
"display_name": "[redacted-device-name]",
"host_name": "[redacted-host-name]",
"name": "[redacted-device-name]",
"online": false,
"busy": false,
"os": "Mac OS",
"os_version": "26.x",
"arch": "arm64",
"app_server_version": "0.130.x",
"installation_id": null,
"client_type": "CODEX_CLI",
"originator": "codex-backend",
"terminal": "xterm-256color",
"client_name": "codex-backend",
"client_version": "unknown",
"last_seen_at": "[redacted-timestamp]"
}
],
"cursor": null
}You can remove an environment using ./delete-environment.zsh '<env_id>', using the env_id from the first script.
Sometimes this script hangs after running, but you can refresh the mobile app and the environment will be gone.