我经常同时开几个 Claude Code / Codex CLI 的 iTerm2 标签页,过一会儿就分不清哪个还在跑、哪个在等审批、哪个已经结束了。 所以做了个很小的开源工具: ai-tab-color 。 它会根据当前 Agent 状态自动修改 iTerm2 tab 的背景色: 🔵 蓝色:working 🔴 红橙色:waiting for approval 🟢 绿色:done ,保持到下次提交 prompt 安装: curl -fsSL https://github.com/misaka1018/ai-tab-color/releases/latest/download/install.sh | bash 项目地址: https://github.com/misaka1018/ai-tab-color 实现方式比较简单:Claude Code / Codex lifecycle hooks 只负责写状态,每个 CLI 会话启动一个轻量 poller ,默认每 5 秒检查状态,再通过 iTerm2 OSC 序列修改 tab...