如果你的codex也老是这样,不妨试着把下面的skill发给它!
安装方法:新建文件夹 ~/.codex/skills/configure-local-proxy/,在里面新建 SKILL.md,粘贴以下内容;重启 Codex 后生效。
---
name: configure-local-proxy
description: Detect the active local proxy application's HTTP/SOCKS port and create or update `.codex/.env` with HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, and NO_PROXY. Use when a user asks to configure Codex or a workspace to use their local proxy, asks to find their proxy port, or supplies this proxy-environment-variable workflow.
---
# Configure Local Proxy
Detect the port first; never assume the example port is active.
## Workflow
1. Inspect existing `HTTP_PROXY`, `HTTPS_PROXY`, and `ALL_PROXY` environment variables.
2. Identify running local proxy clients, such as Clash/Mihomo, v2ray/Xray, sing-box, NekoRay, or Shadowsocks.
3. Read the application's active configuration and extract a usable local proxy port. Prefer `mixed-port` when present; otherwise use the HTTP `port` for HTTP(S) variables and the SOCKS port for `ALL_PROXY`. If the process exposes listeners, use them only when accessible without elevated privileges.
4. If no port can be determined safely, report that result and request the user's port. Do not create a guessed configuration.
5. Preserve unrelated lines in an existing workspace `.codex/.env`; add or replace only these values:
```dotenv
HTTP_PROXY="http://127.0.0.1:<port>"
HTTPS_PROXY="http://127.0.0.1:<port>"
ALL_PROXY="socks5h://127.0.0.1:<port>"
NO_PROXY="localhost,127.0.0.1,::1"