Codex 增强版:对标 Claude Code 新增 Agent Teams、Hooks、anthropic api Agent 、WebUI

2026-04-13 13:232阅读0评论SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐
问题描述:

基于原版 Codex,加了五个核心功能:

功能 一句话说明
Agent Teams 多 Agent 组队协作,任务分发 + 持久化消息
Hooks 18 种生命周期事件拦截,对齐 Claude Code
Anthropic API(Agent) 原生 anthropic-sdk-rs,直接用 Claude 模型
Web UI codex serve 启动浏览器交互,Axum + React + SSE
Remote Control 手机/其他设备远程控制本地 CLI 会话(就是在 TUI 里面启动 serve)

后面会重点优化 Agent 编排工作流。先看现在能干什么。


安装

一键安装(macOS / Linux / WSL):

curl -fsSL https://raw.githubusercontent.com/stellarlinkco/codex/main/scripts/install.sh | bash

Windows PowerShell:

irm https://raw.githubusercontent.com/stellarlinkco/codex/main/scripts/install.ps1 | iex

脚本自动检测 OS 和架构,二进制装到 ~/.local/bin。验证:

codex-cli-splash1898×1190 191 KB

codex --version # 输出类似:codex 1.2.1

系统要求:macOS 12+ / Ubuntu 22.04+(glibc >= 2.35)/ Windows 11 WSL2,4GB RAM 起步。


功能一:Web UI

codex serve 启动 webUI 默认随机端口+安全 Token ,搭配内网穿透可以远程 VibeCoding。

codex serve # 指定端口:codex serve --port 8080 # 不自动打开浏览器:codex serve --no-open

SCR-20260227-g0a862×1864 22.4 KB

基于 GitHub - tiann/hapi: App for Claude Code / Codex / Gemini / OpenCode, vibe coding anytime, anywhere 二次开发的,感谢 hapi。


功能二:Agent Teams

对标 Claude Code 的 Sub-Agents。多个 Agent 组队,各司其职。

Screenshot 2026-02-27 at 11.24.162220×1718 433 KB
Screenshot 2026-02-27 at 11.24.592220×1718 401 KB

查看 agent teams 的 tools
SCR-20260227-iqn1732×1130 192 KB

{ "team_id": "my-feature-team", "members": [ { "name": "planner", "task": "制定实现计划", "agent_type": "architect" }, { "name": "implementer", "task": "实现功能", "agent_type": "develop", "worktree": true }, { "name": "reviewer", "task": "审查代码", "agent_type": "code-review" } ] }

worktree: true 给 Agent 独立的 Git Worktree,避免互相踩文件。任务有锁、消息有持久化 Inbox(JSONL),进程崩了数据也不丢。

任务流很简单:team_task_listteam_task_claim_next → 干活 → team_task_complete。成员之间用 team_message 点对点聊,team_broadcast 群发。


功能三:Hooks

18 种生命周期事件,跟 Claude Code 的 Hooks 基本对齐。

[[hooks.pre_tool_use]] command = ["python3", "/Users/me/.codex/hooks/check_tool.py"] timeout = 5 [hooks.pre_tool_use.matcher] tool_name_regex = "^(shell|exec)$"

三种 Handler:

  • Command:跑 Shell 命令,stdin 进 JSON,stdout 出 JSON
  • Prompt:让模型判断,返回 {"ok": true/false}
  • Agent:起一个验证 Agent,能调工具做复杂检查

退出码 0 放行,2 阻断。Hook 输出可以注入上下文、改写工具输入、做权限决策。

Skill 级别也能定义 Hooks,在 SKILL.md 的 YAML frontmatter 里写,作用域限定在 Skill 激活期间。


功能四:多模型支持(Anthropic API)

config.toml 里定义 Provider,支持 openai 和 anthropic:

[model_providers.anthropic] name = "Anthropic" base_url = "https://api.anthropic.com" env_key = "ANTHROPIC_API_KEY" wire_api = "anthropic" model_provider = "anthropic" model = "claude-sonnet-4-5"

export ANTHROPIC_API_KEY="sk-ant-api03-..."

还能按 Agent 角色分配不同 Provider——Architect 用 Claude 推理,Developer 用 GPT 写代码,各取所需。


功能五:Remote Control

电脑上跑着 CLI,手机浏览器远程操控。目前是 MVP 阶段,轮询机制。

# TUI 里输入 /remote-control,handoff 到 serve /remote-control

Screenshot 2026-02-27 at 11.34.592220×1684 163 KB

会话 handoff 到 codex serve,浏览器接管。心跳 30 秒,断线自动重连(退避 1s → 2s → 4s → 8s → 30s 封顶)。


项目仓库:GitHub - stellarlinkco/codex: The open source coding agent. openai anthropic gemini

如果觉得好用可以给个 star 感谢

网友解答:
--【壹】--:

感谢支持


--【贰】--:

刚在知乎上看到。想分享到L站。没想到原来就是L站大佬做的


--【叁】--:

感谢支持


--【肆】--:

支持佬,这个需要卸载原来的codex吗?


--【伍】--:

谢谢大佬


--【陆】--:

猴哥爱你,都是好东西


--【柒】--:

感谢支持,不需要卸载可以同时存在,二进制可以自己改名字


--【捌】--:

好东西,已star


--【玖】--:

支持猴哥


--【拾】--:

牛的,猴哥


--【拾壹】--:

怎么没有评论


--【拾贰】--:

感谢大佬,学习一下


--【拾叁】--:

先耍一个小花招,让 claude 少睡几夜好觉


--【拾肆】--:

是啊。我看到的时候还挺奇怪的。这么好的工具照道理L站里有啊。怎么没看见?回来一刷,果然如此


--【拾伍】--:

这么巧


--【拾陆】--:

感谢,实用的扩展工具,已star


--【拾柒】--:

感谢支持!


--【拾捌】--:

感谢支持


--【拾玖】--:

大佬666
最新大作啊

问题描述:

基于原版 Codex,加了五个核心功能:

功能 一句话说明
Agent Teams 多 Agent 组队协作,任务分发 + 持久化消息
Hooks 18 种生命周期事件拦截,对齐 Claude Code
Anthropic API(Agent) 原生 anthropic-sdk-rs,直接用 Claude 模型
Web UI codex serve 启动浏览器交互,Axum + React + SSE
Remote Control 手机/其他设备远程控制本地 CLI 会话(就是在 TUI 里面启动 serve)

后面会重点优化 Agent 编排工作流。先看现在能干什么。


安装

一键安装(macOS / Linux / WSL):

curl -fsSL https://raw.githubusercontent.com/stellarlinkco/codex/main/scripts/install.sh | bash

Windows PowerShell:

irm https://raw.githubusercontent.com/stellarlinkco/codex/main/scripts/install.ps1 | iex

脚本自动检测 OS 和架构,二进制装到 ~/.local/bin。验证:

codex-cli-splash1898×1190 191 KB

codex --version # 输出类似:codex 1.2.1

系统要求:macOS 12+ / Ubuntu 22.04+(glibc >= 2.35)/ Windows 11 WSL2,4GB RAM 起步。


功能一:Web UI

codex serve 启动 webUI 默认随机端口+安全 Token ,搭配内网穿透可以远程 VibeCoding。

codex serve # 指定端口:codex serve --port 8080 # 不自动打开浏览器:codex serve --no-open

SCR-20260227-g0a862×1864 22.4 KB

基于 GitHub - tiann/hapi: App for Claude Code / Codex / Gemini / OpenCode, vibe coding anytime, anywhere 二次开发的,感谢 hapi。


功能二:Agent Teams

对标 Claude Code 的 Sub-Agents。多个 Agent 组队,各司其职。

Screenshot 2026-02-27 at 11.24.162220×1718 433 KB
Screenshot 2026-02-27 at 11.24.592220×1718 401 KB

查看 agent teams 的 tools
SCR-20260227-iqn1732×1130 192 KB

{ "team_id": "my-feature-team", "members": [ { "name": "planner", "task": "制定实现计划", "agent_type": "architect" }, { "name": "implementer", "task": "实现功能", "agent_type": "develop", "worktree": true }, { "name": "reviewer", "task": "审查代码", "agent_type": "code-review" } ] }

worktree: true 给 Agent 独立的 Git Worktree,避免互相踩文件。任务有锁、消息有持久化 Inbox(JSONL),进程崩了数据也不丢。

任务流很简单:team_task_listteam_task_claim_next → 干活 → team_task_complete。成员之间用 team_message 点对点聊,team_broadcast 群发。


功能三:Hooks

18 种生命周期事件,跟 Claude Code 的 Hooks 基本对齐。

[[hooks.pre_tool_use]] command = ["python3", "/Users/me/.codex/hooks/check_tool.py"] timeout = 5 [hooks.pre_tool_use.matcher] tool_name_regex = "^(shell|exec)$"

三种 Handler:

  • Command:跑 Shell 命令,stdin 进 JSON,stdout 出 JSON
  • Prompt:让模型判断,返回 {"ok": true/false}
  • Agent:起一个验证 Agent,能调工具做复杂检查

退出码 0 放行,2 阻断。Hook 输出可以注入上下文、改写工具输入、做权限决策。

Skill 级别也能定义 Hooks,在 SKILL.md 的 YAML frontmatter 里写,作用域限定在 Skill 激活期间。


功能四:多模型支持(Anthropic API)

config.toml 里定义 Provider,支持 openai 和 anthropic:

[model_providers.anthropic] name = "Anthropic" base_url = "https://api.anthropic.com" env_key = "ANTHROPIC_API_KEY" wire_api = "anthropic" model_provider = "anthropic" model = "claude-sonnet-4-5"

export ANTHROPIC_API_KEY="sk-ant-api03-..."

还能按 Agent 角色分配不同 Provider——Architect 用 Claude 推理,Developer 用 GPT 写代码,各取所需。


功能五:Remote Control

电脑上跑着 CLI,手机浏览器远程操控。目前是 MVP 阶段,轮询机制。

# TUI 里输入 /remote-control,handoff 到 serve /remote-control

Screenshot 2026-02-27 at 11.34.592220×1684 163 KB

会话 handoff 到 codex serve,浏览器接管。心跳 30 秒,断线自动重连(退避 1s → 2s → 4s → 8s → 30s 封顶)。


项目仓库:GitHub - stellarlinkco/codex: The open source coding agent. openai anthropic gemini

如果觉得好用可以给个 star 感谢

网友解答:
--【壹】--:

感谢支持


--【贰】--:

刚在知乎上看到。想分享到L站。没想到原来就是L站大佬做的


--【叁】--:

感谢支持


--【肆】--:

支持佬,这个需要卸载原来的codex吗?


--【伍】--:

谢谢大佬


--【陆】--:

猴哥爱你,都是好东西


--【柒】--:

感谢支持,不需要卸载可以同时存在,二进制可以自己改名字


--【捌】--:

好东西,已star


--【玖】--:

支持猴哥


--【拾】--:

牛的,猴哥


--【拾壹】--:

怎么没有评论


--【拾贰】--:

感谢大佬,学习一下


--【拾叁】--:

先耍一个小花招,让 claude 少睡几夜好觉


--【拾肆】--:

是啊。我看到的时候还挺奇怪的。这么好的工具照道理L站里有啊。怎么没看见?回来一刷,果然如此


--【拾伍】--:

这么巧


--【拾陆】--:

感谢,实用的扩展工具,已star


--【拾柒】--:

感谢支持!


--【拾捌】--:

感谢支持


--【拾玖】--:

大佬666
最新大作啊