Skip to content

armgit / Wake

Public Imported from GitHub
0

All your AI agent sessions in one place — browse, search, resume. Rust + GPUI.

Rust

feat(plugin): bring the Wake plugin to Codex

Corey Chiuad25fbdc0108
diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json
new file mode 100644
index 0000000..70d3934
--- /dev/null
+++ b/.agents/plugins/marketplace.json
@@ -0,0 +1,20 @@
+{
+ "name": "wake",
+ "interface": {
+ "displayName": "Wake"
+ },
+ "plugins": [
+ {
+ "name": "wake",
+ "source": {
+ "source": "local",
+ "path": "./plugins/wake"
+ },
+ "policy": {
+ "installation": "AVAILABLE",
+ "authentication": "ON_INSTALL"
+ },
+ "category": "Developer Tools"
+ }
+ ]
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9369099..88db39a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+## [Unreleased]
+
+- New: Codex gets the Wake plugin too: one command adds it to the Codex CLI and the Codex app, and every new Codex session then starts knowing where your agents left off in the project, with Wake's MCP tools to read earlier sessions. Settings → Connect shows it in place of the Codex hooks setup; if you added that hook to ~/.codex/config.toml, remove it so new sessions don't get the context twice
+
## [0.9.0] — 2026-10-10
- New: New Claude Code and Codex sessions can start knowing where your agents left off in the project — the latest sessions from Claude Code, Codex, Cursor and the rest, each with its last question and reply. For Claude Code, install the Wake plugin with one command (it adds Wake's MCP tools too); Codex gets it through Codex hooks. Both are in Settings → Connect
diff --git a/DESIGN.md b/DESIGN.md
index b8faa2e..ba1ee53 100644
--- a/DESIGN.md
+++ b/DESIGN.md
@@ -135,7 +135,7 @@ macOS 不设置横跨三栏的自定义 header。主窗口透明标题栏高 44p
- 行内容 = 行首元素 + 标题 + 计数;计数一律 Label 档 muted。
- 组头 "Agents"/"Projects" 用 Body 档常规字重 + muted 色(与主导航同字号同字重,仅靠颜色区分——加粗会让组头压过它统辖的行)。行首是 13px 的折叠 chevron(收起指右、展开指下),坐在与导航行同一个 18px 行首槽位里、中心压 26.75 轴(用户 2026-09-22 定:箭头放到开头,对准上面菜单的图标与红绿灯的红灯;原先 chevron 跟在文字后);chevron 取 15px(与导航行图标同档,描边粗细一致),**不占 18px 槽位、按自己的框居中压轴**,再接统一的 `ICON_TEXT_GAP`——槽位居中再接同一间距,墨迹到文字会比导航行空出一截(chevron 墨迹只有约 5px 宽,用户同日"间隔太大");按框压轴后墨迹到文字视觉约 10.9px 与导航行相当,文字起点比导航行标签左 1.5px。
- 底部工具条常驻,总高 44px(含顶部 1px hairline),两端分置的**纯图标条**(2026-09-21 三轮定稿:六个一样的 ghost 图标挤一排分不出层级;带边框底色的分段盒子放在侧栏里像一个走错地方的表单控件——参照 Zed 状态栏 / Xcode 导航条,不带盒子):按钮统一 28×28、6px 圆角、14px 图标、2px 间距;**左端**——Sessions(messages-square,双气泡;单气泡的 message-square 留给消息级用途)/ Memory(brain)/ Insights(chart-column)三颗页切换,再接 brush-cleaning "Clean Up Sessions"(它是叠在会话视图上的模式,也靠左),当前页(或打开中的清理)那颗用侧栏行的选中色(`sidebar_accent` 底 + `sidebar_accent_foreground` 图标)做圆角底,与导航行选中态同一套语言;**右端只有齿轮 "Settings"**。左内边距 12.75 = 26.75(侧栏中轴)− 14(按钮半宽):最左那颗图标的中心与红绿灯红灯中心、导航行行首在同一条轴上。未选中的一律透明底、muted 图标,hover 才出色。**Refresh 不在工具条**:它住在每页页头右端(All Sessions 页头在 Sort 左侧,Memory / Insights 页头单独一个;tooltip 就叫 "Refresh"),会话页与 Insights 走整库重扫(Insights 的数据是扫描收尾派生的),Memory 页只同步记忆(读 Settings → Memory locations 的当下配置,不重扫会话;用户 2026-09-22 定各刷各的);进行中转圈并禁用,⌘R 恒为刷会话。Settings 同时进入 Wake 菜单并绑定 `⌘,`(其他平台 `Ctrl+,`),保持单例窗口。
-- Settings 默认 820×600,采用 180px 窄侧栏 + 内容页结构,固定为 General / Session locations / Memory locations / Remote hosts / Connect / Data / Updates / About 八项(侧栏项原叫 Locations,有了 Memory locations 后改成与页标题一致的 Session locations,用户 2026-09-21 定)(Connect 为 0.5.0 新增,插在 Remote hosts 与 Data 之间——两页都是"把 Wake 接到外部"的集成面,Data 之后是纯本地信息;Memory locations 是记忆可见层二期加的,紧挨 Locations——两页都是"Wake 读哪里");About 与功能设置分离并钉在侧栏底部,Wake 菜单的 About Wake 直达同一页。About 沿用 Kooky/Birth 的信息顺序:产品图标、名称、版本、tagline、GitHub、短分隔线、版权/许可证与作者署名。Updates 是独立功能页,仅在用户点击页面按钮或 macOS Wake 菜单的 Check for Updates 时读取 GitHub 最新正式 Release 元数据,明确呈现检查中/最新版/有新版/失败四种状态;有新版时打开 Release 页供用户下载,不后台检查、不自行覆盖应用包。内部常规文字按钮统一沿用主界面的 24px 高、6px 圆角和主题交互色,普通页面动作使用 muted 填充 + hairline;发现新版后的 View Update 是需要用户继续完成的主操作,使用 32px 高 primary 填充和轻阴影。Appearance 分段选择器也使用同一材质。General 只放真实可用的全局偏好,当前为持久化的 System / Light / Dark 外观选择与 Language(跟随系统或固定某个语言包,0.5.2 起);不提供默认 “Open In” 终端。Data 只展示 Wake 本地存储位置、会话数与磁盘占用并提供文件管理器入口,不重复放刷新或清库动作;常规 Refresh 的唯一入口仍是主侧栏底部。Locations 页按 AgentId 声明序以 agent 分组,品牌名只在组头出现一次;本机有数据的组优先,未检测到的 agent 默认收进可展开区。每条路径以路径为主信息、会话数/不可用状态为 muted 副信息,最右为逐路径开关;停用时只降低文字层级,开关与菜单保持完整对比度。行本身不承担编辑,`…` 菜单集中 Edit / Show in Finder / 自定义 Remove。顶部操作为低强调的 Add location,Restore defaults 收进页级 `…` 菜单且无偏离时禁用。添加/编辑仍复用 agent 下拉 + 可手输路径 + 目录选择表单;关闭 location 后保留配置、停止扫描/监听并从会话与搜索结果排除,重新开启即增量扫回;纯路径管理不做内容校验。**Memory locations 页与 Locations 同版式**(2026-09-21 记忆可见层二期):标题 "Memory locations" + 一句说明 + 右侧 Add location + 页级 `…` 里的 Restore defaults;按 AgentId 声明序分组,一行一个记忆来源——各家默认的(Claude 的 auto-memory 树与 `~/.claude/CLAUDE.md`、Codex 的 memories 目录、逐线程库、`~/.codex/AGENTS.md` 与 `rules/`、Gemini 的 `~/.gemini/GEMINI.md`、ZCode 的记忆树)、项目根模式(`<project>/CLAUDE.md`、`<project>/.cursor/rules` 一类,原样显示占位符)与用户加的自定义目录/文件;路径为主信息、文件数(或 "Not found")为 muted 副信息,最右逐来源开关;`…` 菜单:默认来源只有 Show in Finder(项目模式连这个也没有),自定义来源多 Edit / Remove。添加/编辑与 Session locations 是同一个表单(`open_path_form`),差别是字段叫 "Folder or file"、选择器也收文件。改动不换 roster,只补一轮增量扫描,记忆流随之更新。Remote hosts 页沿用 Locations 的版式:标题 + 说明,右侧低强调的 Sync now / Add host;host 列表为单张 popover 底圆角卡,一行一台(名字为主信息、同步状态为 muted 副信息,失败用 danger),`…` 菜单集中 Sync now / Remove,最右为开关;添加走与 location 同材质的单字段表单弹窗,SSH 前提说明放在字段下方。列表与详情页的远程会话以 `@host` 徽章标识:列表行为 primary 淡底填充胶囊(与 muted 项目胶囊区分),详情页与 model/source 同排用 primary 描边。Connect 页沿用 Data 页的版式,**只放状态与动作,不放文档**(用户 2026-09-08 三轮定稿:平级双卡带代码块、嵌套同卡、缩进从属卡都试过,根源是设置窗里塞了 README 内容,怎么排都像教程):标题 + 一句说明(不点名 MCP、不写 read-only 声明);「MCP server」卡 84px 一行显示 wake-mcp 名称与 mono 字体的 `~/…` 路径,右侧复制钮,不放"Ready"状态行,只在找不到二进制时给一行 danger 文案;「MCP clients」卡三行(Claude Code / Codex / Cursor),17px 品牌图标领行、客户端名为主信息、用法提示为 muted 副信息、右侧是 ghost 的 Show/Hide 切换(chevron 图标 + 文案,muted 前景,用户 2026-09-08 追加)加复制钮;代码块**默认收起**,展开后出现在该行下方、左缘对齐到文字轴(行内边距 16 + 图标 17 + 间距 12),secondary 填充 + 主题圆角的 mono 逐行渲染,Settings 重开即复位。0.6.x 起页面是**四个区块**(用户 2026-09-11 定稿):MCP server / MCP clients / Command line / Skill——MCP server / Command line / Skill 各一张 84px 信息卡、MCP clients 仍是三行客户端列表(wake-mcp、wake-cli 是二进制名与 mono 路径 + 复制路径的钮;wake-cli 那张在它**左侧**多一个终端图标的复制钮,复制「把它放进 PATH」的那行命令——两颗一样的复制图标并排分不清,所以换字形;最右留给两张卡同为复制路径的那颗,纵向才对得齐;deb/tar 已装进 `…/bin` 或 Windows 上没有可粘命令时这个按钮不出现;Skill 是 `npx skills add …` + 复制钮),区块标题为「Agents」时看不出这块特指 MCP,故改名 MCP clients 与上方 MCP server 成对。**说明性 caption 一律不放**——那正是"设置窗里塞 README"的复发形态;Setup guide 链接改挂在区块标题右端,规则是**每个面的第一个区块挂自己的文档**:MCP server → docs/mcp.md,Command line → docs/cli.md(MCP clients 与 Skill 分属这两个面的第二块,不重复挂)。最上面另有两块 **Claude Code plugin** / **Codex hooks**(新会话开场带上项目最近的会话;标题用各家正名,用户 2026-10-09 定),各是一个面、各挂自己的 Setup guide(docs/cli.md 的两节);卡是 48px 一行,只有一句用法(正文字号、前景色,与卡片标题行同一种字)+ 右端复制钮,不摆等宽命令、不加品牌图与名字行(区块标题已点名);Windows 上两块都不画。四块之后整页**超过一屏、需要滚动**——2026-09-08 那条"一屏放下"的约束随第三、四个区块作废,滚动容器本来就在(`flex_1().min_h_0().overflow_y_scroll()`),卡片记得 `flex_shrink_0` 否则会被压扁。**复制钮一律只有图标**(用户 2026-10-09 定:卡上已经摆着要复制的东西或一句用法,按钮上再写 Copy path / Copy command 是重复):与文字按钮同材质、同 24px 高的方钮,13px 图标,说明在 tooltip;复制反馈是图标原地变 check(tooltip 变 Copied)1.6s 后复原,**不弹通知**——gpui-component 的 toast 在窗口失活或被悬停时暂停自动关闭,在 Settings 从属窗里经常就挂着不走(用户 2026-09-08 反馈),且主界面的 Copy Session ID / Copy code 本来就不弹;页面只展示不代写别家配置。
+- Settings 默认 820×600,采用 180px 窄侧栏 + 内容页结构,固定为 General / Session locations / Memory locations / Remote hosts / Connect / Data / Updates / About 八项(侧栏项原叫 Locations,有了 Memory locations 后改成与页标题一致的 Session locations,用户 2026-09-21 定)(Connect 为 0.5.0 新增,插在 Remote hosts 与 Data 之间——两页都是"把 Wake 接到外部"的集成面,Data 之后是纯本地信息;Memory locations 是记忆可见层二期加的,紧挨 Locations——两页都是"Wake 读哪里");About 与功能设置分离并钉在侧栏底部,Wake 菜单的 About Wake 直达同一页。About 沿用 Kooky/Birth 的信息顺序:产品图标、名称、版本、tagline、GitHub、短分隔线、版权/许可证与作者署名。Updates 是独立功能页,仅在用户点击页面按钮或 macOS Wake 菜单的 Check for Updates 时读取 GitHub 最新正式 Release 元数据,明确呈现检查中/最新版/有新版/失败四种状态;有新版时打开 Release 页供用户下载,不后台检查、不自行覆盖应用包。内部常规文字按钮统一沿用主界面的 24px 高、6px 圆角和主题交互色,普通页面动作使用 muted 填充 + hairline;发现新版后的 View Update 是需要用户继续完成的主操作,使用 32px 高 primary 填充和轻阴影。Appearance 分段选择器也使用同一材质。General 只放真实可用的全局偏好,当前为持久化的 System / Light / Dark 外观选择与 Language(跟随系统或固定某个语言包,0.5.2 起);不提供默认 “Open In” 终端。Data 只展示 Wake 本地存储位置、会话数与磁盘占用并提供文件管理器入口,不重复放刷新或清库动作;常规 Refresh 的唯一入口仍是主侧栏底部。Locations 页按 AgentId 声明序以 agent 分组,品牌名只在组头出现一次;本机有数据的组优先,未检测到的 agent 默认收进可展开区。每条路径以路径为主信息、会话数/不可用状态为 muted 副信息,最右为逐路径开关;停用时只降低文字层级,开关与菜单保持完整对比度。行本身不承担编辑,`…` 菜单集中 Edit / Show in Finder / 自定义 Remove。顶部操作为低强调的 Add location,Restore defaults 收进页级 `…` 菜单且无偏离时禁用。添加/编辑仍复用 agent 下拉 + 可手输路径 + 目录选择表单;关闭 location 后保留配置、停止扫描/监听并从会话与搜索结果排除,重新开启即增量扫回;纯路径管理不做内容校验。**Memory locations 页与 Locations 同版式**(2026-09-21 记忆可见层二期):标题 "Memory locations" + 一句说明 + 右侧 Add location + 页级 `…` 里的 Restore defaults;按 AgentId 声明序分组,一行一个记忆来源——各家默认的(Claude 的 auto-memory 树与 `~/.claude/CLAUDE.md`、Codex 的 memories 目录、逐线程库、`~/.codex/AGENTS.md` 与 `rules/`、Gemini 的 `~/.gemini/GEMINI.md`、ZCode 的记忆树)、项目根模式(`<project>/CLAUDE.md`、`<project>/.cursor/rules` 一类,原样显示占位符)与用户加的自定义目录/文件;路径为主信息、文件数(或 "Not found")为 muted 副信息,最右逐来源开关;`…` 菜单:默认来源只有 Show in Finder(项目模式连这个也没有),自定义来源多 Edit / Remove。添加/编辑与 Session locations 是同一个表单(`open_path_form`),差别是字段叫 "Folder or file"、选择器也收文件。改动不换 roster,只补一轮增量扫描,记忆流随之更新。Remote hosts 页沿用 Locations 的版式:标题 + 说明,右侧低强调的 Sync now / Add host;host 列表为单张 popover 底圆角卡,一行一台(名字为主信息、同步状态为 muted 副信息,失败用 danger),`…` 菜单集中 Sync now / Remove,最右为开关;添加走与 location 同材质的单字段表单弹窗,SSH 前提说明放在字段下方。列表与详情页的远程会话以 `@host` 徽章标识:列表行为 primary 淡底填充胶囊(与 muted 项目胶囊区分),详情页与 model/source 同排用 primary 描边。Connect 页沿用 Data 页的版式,**只放状态与动作,不放文档**(用户 2026-09-08 三轮定稿:平级双卡带代码块、嵌套同卡、缩进从属卡都试过,根源是设置窗里塞了 README 内容,怎么排都像教程):标题 + 一句说明(不点名 MCP、不写 read-only 声明);「MCP server」卡 84px 一行显示 wake-mcp 名称与 mono 字体的 `~/…` 路径,右侧复制钮,不放"Ready"状态行,只在找不到二进制时给一行 danger 文案;「MCP clients」卡三行(Claude Code / Codex / Cursor),17px 品牌图标领行、客户端名为主信息、用法提示为 muted 副信息、右侧是 ghost 的 Show/Hide 切换(chevron 图标 + 文案,muted 前景,用户 2026-09-08 追加)加复制钮;代码块**默认收起**,展开后出现在该行下方、左缘对齐到文字轴(行内边距 16 + 图标 17 + 间距 12),secondary 填充 + 主题圆角的 mono 逐行渲染,Settings 重开即复位。0.6.x 起页面是**四个区块**(用户 2026-09-11 定稿):MCP server / MCP clients / Command line / Skill——MCP server / Command line / Skill 各一张 84px 信息卡、MCP clients 仍是三行客户端列表(wake-mcp、wake-cli 是二进制名与 mono 路径 + 复制路径的钮;wake-cli 那张在它**左侧**多一个终端图标的复制钮,复制「把它放进 PATH」的那行命令——两颗一样的复制图标并排分不清,所以换字形;最右留给两张卡同为复制路径的那颗,纵向才对得齐;deb/tar 已装进 `…/bin` 或 Windows 上没有可粘命令时这个按钮不出现;Skill 是 `npx skills add …` + 复制钮),区块标题为「Agents」时看不出这块特指 MCP,故改名 MCP clients 与上方 MCP server 成对。**说明性 caption 一律不放**——那正是"设置窗里塞 README"的复发形态;Setup guide 链接改挂在区块标题右端,规则是**每个面的第一个区块挂自己的文档**:MCP server → docs/mcp.md,Command line → docs/cli.md(MCP clients 与 Skill 分属这两个面的第二块,不重复挂)。最上面另有两块 **Claude Code plugin** / **Codex plugin**(新会话开场就知道各个 agent 停在哪,并装上 Wake 的 MCP 工具;标题用各家正名,用户 2026-10-09 定——Codex 那块起初是它官方的 hooks 配置,2026-10-10 有了 Codex 插件后改名),各是一个面、各挂自己的 Setup guide(docs/cli.md 的两节);卡是 48px 一行,只有一句用法(正文字号、前景色,与卡片标题行同一种字)+ 右端复制钮,不摆等宽命令、不加品牌图与名字行(区块标题已点名);Windows 上两块都不画。四块之后整页**超过一屏、需要滚动**——2026-09-08 那条"一屏放下"的约束随第三、四个区块作废,滚动容器本来就在(`flex_1().min_h_0().overflow_y_scroll()`),卡片记得 `flex_shrink_0` 否则会被压扁。**复制钮一律只有图标**(用户 2026-10-09 定:卡上已经摆着要复制的东西或一句用法,按钮上再写 Copy path / Copy command 是重复):与文字按钮同材质、同 24px 高的方钮,13px 图标,说明在 tooltip;复制反馈是图标原地变 check(tooltip 变 Copied)1.6s 后复原,**不弹通知**——gpui-component 的 toast 在窗口失活或被悬停时暂停自动关闭,在 Settings 从属窗里经常就挂着不走(用户 2026-09-08 反馈),且主界面的 Copy Session ID / Copy code 本来就不弹;页面只展示不代写别家配置。
- 工具条内的**状态行"常态沉默"**:仅刷新中或监听不可用时出现在按钮行上方;文案须可 truncate,窄侧栏放不下长句(故为 "Live updates off" 而非带操作建议的整句)。刷新中行首是与页头 Refresh 按钮 loading 态同一个 Spinner(12px、muted 色),文字下方 8px 处一条 3px 进度条(`Progress`,primary 色、轨道同色 20%;会话扫描按 done/total 定值,总数未知 / 记忆同步 / 远程同步走不定值滑动;2026-09-22 用户要的),出错时行首回到静态 refresh-cw 图标。
- 手动 Refresh 始终后台运行;进度复用侧栏状态行,完成后发通知("Sessions refreshed" / "Memory refreshed"),不用模态框阻断浏览、搜索或阅读。
- 不把项目包装成卡片,不堆叠分支、时间或重复图标。项目行不加彩色标识——同一图标重复十几次不传递信息。
diff --git a/README.md b/README.md
index 64b6e5f..79570fb 100644
--- a/README.md
+++ b/README.md
@@ -134,7 +134,7 @@ wake-cli refresh # update the index while Wake
It prints what the MCP tools return, asserted byte for byte in the test suite apart from a trailing newline the CLI adds, so an agent driving it through a shell sees what a connected one does. Full reference in [docs/cli.md](docs/cli.md).
-To make an agent reach for it without being told, install the bundled skill with `npx skills add iAmCorey/Wake` (or copy `skills/wake/` into `~/.claude/skills/wake/`). Every new session can also start knowing where your agents left off in the project — Claude Code, Codex and the rest, each with its last question and reply: for Claude Code, `claude plugin marketplace add iAmCorey/Wake && claude plugin install wake@wake` installs the Wake plugin, which does this and adds Wake's MCP tools in one go ([Claude Code plugin](docs/cli.md#claude-code-plugin)); Codex gets the same through [Codex hooks](docs/cli.md#codex-hooks). Both are in Settings → Connect.
+To make an agent reach for it without being told, install the bundled skill with `npx skills add iAmCorey/Wake` (or copy `skills/wake/` into `~/.claude/skills/wake/`). Every new session can also start knowing where your agents left off in the project — Claude Code, Codex and the rest, each with its last question and reply: for Claude Code, `claude plugin marketplace add iAmCorey/Wake --sparse .claude-plugin plugins/wake && claude plugin install wake@wake` installs the Wake plugin, which does this and adds Wake's MCP tools in one go ([Claude Code plugin](docs/cli.md#claude-code-plugin)); for Codex, `codex plugin marketplace add iAmCorey/Wake --sparse .agents/plugins --sparse plugins/wake && codex plugin add wake@wake` installs the same plugin ([Codex plugin](docs/cli.md#codex-plugin)). Both are in Settings → Connect.
## Zoom
diff --git a/crates/wake-core/src/cli.rs b/crates/wake-core/src/cli.rs
index aaa6ac0..7214ff7 100644
--- a/crates/wake-core/src/cli.rs
+++ b/crates/wake-core/src/cli.rs
@@ -793,24 +793,23 @@ project on the machine is in scope. Everything is read-only.";
/// 与 `wake-cli setup` 同一个来源
pub const SKILL_INSTALL: &str = "npx skills add iAmCorey/Wake";
-/// Claude Code 插件的安装命令:仓库根的 `.claude-plugin/marketplace.json` 就是插件市场,插件
-/// 在 `plugins/wake/`(SessionStart 钩子调 `wake-cli context` + wake-mcp)。与 Settings →
-/// Connect、`wake-cli setup` 同一个来源
-pub const CLAUDE_PLUGIN_INSTALL: &str =
- "claude plugin marketplace add iAmCorey/Wake && claude plugin install wake@wake";
-
-/// 这个平台给不给新会话开场的两家接法(Claude Code plugin / Codex hooks)。Windows 上不给:
-/// 插件的脚本是 sh,Codex 钩子在 Windows 上走哪个 shell 也没核实。判断只在这里——设置页与
-/// `wake-cli setup` 各自问它;片段函数本身不分平台,i18n 的死条目检查在 Windows 上也得看得见
-/// 这两句用法(片段给 None 时 Windows CI 必红,2026-10-09 Codex review)
-pub const SESSION_START_HOOKS: bool = !cfg!(target_os = "windows");
-
-/// 让每个新会话一开场就拿到这个项目最近的会话(`wake-cli context`)的两家接法,各用各家的
-/// 正名(用户 2026-10-09 定:不自己起名字):**Claude Code plugin** 装仓库里的插件,MCP 一起
-/// 带上;**Codex hooks** 是 Codex 官方的钩子功能,给一段用户级配置——Codex 插件里的钩子只在
-/// 桌面版手动安装时生效、插件里的 MCP 只认远端服务,做成插件命令行用户什么都拿不到;用户加的
-/// 钩子 Codex 一律要在 /hooks 里批准过才跑。Settings → Connect 的两块与 `wake-cli setup`
-/// 同源,给不给看 `SESSION_START_HOOKS`
+/// 两家插件的安装命令,Settings → Connect、`wake-cli setup` 与文档同一个来源(tests/cli.rs 卡
+/// 文档里的写法)。插件都在 `plugins/wake/`,Claude Code 的市场是仓库根的
+/// `.claude-plugin/marketplace.json`,Codex 的是 `.agents/plugins/marketplace.json`。`--sparse`
+/// 只检出市场文件与插件目录:不加的话两家都把整个仓库克隆下来(约 6 MB、还随官网素材长),只为
+/// 读几 KB 的插件文件,Codex 每次升级市场还会重来一遍
+pub const CLAUDE_PLUGIN_INSTALL: &str = "claude plugin marketplace add iAmCorey/Wake --sparse .claude-plugin plugins/wake && claude plugin install wake@wake";
+/// 见 `CLAUDE_PLUGIN_INSTALL`
+pub const CODEX_PLUGIN_INSTALL: &str = "codex plugin marketplace add iAmCorey/Wake --sparse .agents/plugins --sparse plugins/wake && codex plugin add wake@wake";
+
+/// 这个平台给不给两家插件(Claude Code plugin / Codex plugin)。Windows 上不给:插件的脚本是 sh。
+/// 判断只在这里——设置页与 `wake-cli setup` 各自问它;片段函数本身不分平台,i18n 的死条目检查
+/// 在 Windows 上也得看得见这两句用法(片段给 None 时 Windows CI 必红,2026-10-09 Codex review)
+pub const AGENT_PLUGINS: bool = !cfg!(target_os = "windows");
+
+/// 让每个新会话一开场就知道各个 agent 停在哪(`wake-cli context`)、顺带装上 Wake 的 MCP 工具
+/// 的两家插件,各用各家的正名(用户 2026-10-09 定:不自己起名字)。Settings → Connect 的两块与
+/// `wake-cli setup` 同源,给不给看 `AGENT_PLUGINS`
pub fn claude_plugin_snippet() -> crate::mcp::SetupSnippet {
crate::mcp::SetupSnippet {
client: "Claude Code",
@@ -821,22 +820,14 @@ pub fn claude_plugin_snippet() -> crate::mcp::SetupSnippet {
}
}
-/// 见 `claude_plugin_snippet`
-pub fn codex_hooks_snippet(cli_bin: &Path) -> crate::mcp::SetupSnippet {
- // 路径先按 sh 引好,整条再引成 TOML 字符串
- let command = crate::mcp::json_quote(&format!(
- "{} context 2>/dev/null || true",
- sh_quote(&cli_bin.to_string_lossy())
- ));
+/// 见 `claude_plugin_snippet`。Codex 只在用户信任过插件的钩子之后才跑它,一句用法里交代清楚
+pub fn codex_plugin_snippet() -> crate::mcp::SetupSnippet {
crate::mcp::SetupSnippet {
client: "Codex",
agent: AgentId::Codex,
- hint: "Add to ~/.codex/config.toml, then approve it in /hooks",
- copy_label: "Copy config",
- text: format!(
- "[[hooks.SessionStart]]\nmatcher = \"startup|clear\"\n\n\
- [[hooks.SessionStart.hooks]]\ntype = \"command\"\ncommand = {command}\ntimeout = 30"
- ),
+ hint: "Run in a terminal, then trust its hook in Codex's /hooks",
+ copy_label: "Copy command",
+ text: CODEX_PLUGIN_INSTALL.to_string(),
}
}
@@ -929,18 +920,18 @@ pub fn setup_text(f: &SetupFacts<'_>) -> String {
project. Manual install: copy `skills/wake/` from the repository into\n\
`~/.claude/skills/wake/`.\n"
));
- if SESSION_START_HOOKS {
- out.push_str(&snippet_section(
- "Claude Code plugin",
- &claude_plugin_snippet(),
- "Every new session starts knowing where your agents left off in this project, and\n\
- Claude gets Wake's MCP tools to read those sessions.",
- ));
- out.push_str(&snippet_section(
- "Codex hooks",
- &codex_hooks_snippet(f.cli_bin),
- "Every new Codex session starts knowing where your agents left off in this project.",
- ));
+ if AGENT_PLUGINS {
+ for s in [claude_plugin_snippet(), codex_plugin_snippet()] {
+ out.push_str(&snippet_section(
+ &format!("{} plugin", s.client),
+ &s,
+ &format!(
+ "Every new {0} session starts knowing where your agents left off in this\n\
+ project, and {0} gets Wake's MCP tools to read those sessions.",
+ s.client
+ ),
+ ));
+ }
}
// 片段按 agent 认,不按下标——那个顺序是 Connect 页的事;hint 也用它自己
// 带的,两个 bin 的 setup 输出才真的同形
@@ -1427,13 +1418,9 @@ mod tests {
assert!(t.contains(SKILL_INSTALL), "{t}");
assert!(t.contains("~/.claude/skills/wake/"), "{t}");
assert!(t.contains("claude mcp add"));
- // 开场上下文的两段跟着平台走(Windows 上不给),判断只在 SESSION_START_HOOKS
- assert_eq!(
- t.contains("## Claude Code plugin"),
- SESSION_START_HOOKS,
- "{t}"
- );
- assert_eq!(t.contains("## Codex hooks"), SESSION_START_HOOKS, "{t}");
+ // 两家插件跟着平台走(Windows 上不给),判断只在 AGENT_PLUGINS
+ assert_eq!(t.contains("## Claude Code plugin"), AGENT_PLUGINS, "{t}");
+ assert_eq!(t.contains("## Codex plugin"), AGENT_PLUGINS, "{t}");
let t = setup_text(&SetupFacts {
cli_bin: &cli_bin,
@@ -1450,27 +1437,6 @@ mod tests {
.ends_with("Note: no Wake index at /tmp/wake.db"));
}
- #[test]
- fn plugin_and_hooks_snippets_call_context_with_the_given_binary() {
- // 片段不分平台(Windows 上不显示由 SESSION_START_HOOKS 管),这条三个平台都跑
- let bin = PathBuf::from("/Apps/My Wake.app/Contents/MacOS/wake-cli");
- assert_eq!(claude_plugin_snippet().text, CLAUDE_PLUGIN_INSTALL);
- let codex = codex_hooks_snippet(&bin);
- assert!(
- codex.text.starts_with("[[hooks.SessionStart]]"),
- "{}",
- codex.text
- );
- // 带空格的路径按 sh 引好,外面再套一层 TOML basic string
- assert!(
- codex.text.contains(
- "command = \"'/Apps/My Wake.app/Contents/MacOS/wake-cli' context 2>/dev/null || true\""
- ),
- "{}",
- codex.text
- );
- }
-
#[test]
fn path_command_is_pasteable_or_absent() {
let bundled = PathBuf::from("/Apps/Wake.app/Contents/MacOS/wake-cli");
diff --git a/crates/wake-core/src/mcp/mod.rs b/crates/wake-core/src/mcp/mod.rs
index f89b892..d8395e0 100644
--- a/crates/wake-core/src/mcp/mod.rs
+++ b/crates/wake-core/src/mcp/mod.rs
@@ -266,16 +266,11 @@ pub struct SetupSnippet {
pub text: String,
}
-/// 接入片段里的字符串字面量:带引号、按 JSON 转义——TOML basic string 与 JSON 的转义
-/// 子集兼容,一个写法同时给 TOML 与 JSON 两种配置用,Windows 的反斜杠与含空格路径都安全
-pub(crate) fn json_quote(s: &str) -> String {
- serde_json::to_string(s).unwrap_or_default()
-}
-
-/// 三家客户端的接入片段(UI 的 Connect 页与 `wake-mcp setup` 同源)。路径一律
-/// 经 `json_quote`
+/// 三家客户端的接入片段(UI 的 Connect 页与 `wake-mcp setup` 同源)。路径一律按 JSON 字符串
+/// 引好——TOML basic string 与 JSON 的转义子集兼容,一个写法同时给 TOML 与 JSON 两种配置用,
+/// Windows 的反斜杠与含空格路径都安全
pub fn setup_snippets(bin: &Path) -> Vec<SetupSnippet> {
- let quoted = json_quote(&bin.to_string_lossy());
+ let quoted = serde_json::to_string(&bin.to_string_lossy()).unwrap_or_default();
vec![
SetupSnippet {
client: "Claude Code",
diff --git a/crates/wake-core/tests/cli.rs b/crates/wake-core/tests/cli.rs
index 98225ce..9037c48 100644
--- a/crates/wake-core/tests/cli.rs
+++ b/crates/wake-core/tests/cli.rs
@@ -882,41 +882,90 @@ fn context_shows_where_each_agent_left_off_or_nothing() {
}
/// 插件只是一层壳:清单、钩子、MCP 配置都指向仓库里真实存在的脚本,钩子调的是 `wake-cli
-/// context`,启动脚本找的正是各平台打包落下二进制的地方。`claude plugin validate` 不在 CI
-/// 里跑,这里卡住最容易漂的几处
+/// context`,启动脚本找的正是各平台打包落下二进制的地方。Claude Code 与 Codex 共用一个插件
+/// 目录,各读各的清单与市场文件。`claude plugin validate` 与 Codex 都不在 CI 里跑,这里卡住
+/// 最容易漂的几处
#[test]
-fn the_claude_code_plugin_points_at_real_files() {
+fn the_plugins_point_at_real_files() {
let repo = Path::new(env!("CARGO_MANIFEST_DIR")).join("../..");
let json = |path: PathBuf| -> Value {
serde_json::from_str(&std::fs::read_to_string(path).unwrap()).unwrap()
};
+ // 安装命令最后一段 `<插件>@<市场>` 与市场文件对得上
+ let install_id = |market: &Value| {
+ format!(
+ "{}@{}",
+ market["plugins"][0]["name"].as_str().unwrap(),
+ market["name"].as_str().unwrap()
+ )
+ };
let market = json(repo.join(".claude-plugin/marketplace.json"));
let entry = &market["plugins"][0];
- let id = format!(
- "{}@{}",
- entry["name"].as_str().unwrap(),
- market["name"].as_str().unwrap()
- );
- assert!(cli::CLAUDE_PLUGIN_INSTALL.ends_with(&id), "{id}");
+ assert!(cli::CLAUDE_PLUGIN_INSTALL.ends_with(&install_id(&market)));
let plugin = repo.join(entry["source"].as_str().unwrap());
let manifest = json(plugin.join(".claude-plugin/plugin.json"));
assert_eq!(manifest["name"], entry["name"]);
- let hooks = json(plugin.join("hooks/hooks.json"));
- let command = hooks["hooks"]["SessionStart"][0]["hooks"][0]["command"]
- .as_str()
- .unwrap();
- assert!(
- command.contains("${CLAUDE_PLUGIN_ROOT}/scripts/session-start"),
- "{command}"
+ // 钩子两家共用,整份钉死:Codex 按这份定义(matcher、命令、超时)认信任,改一个字所有
+ // Codex 用户的钩子就停了、要去 /hooks 重新信任——行为上的改动放进 scripts/session-start
+ assert_eq!(
+ json(plugin.join("hooks/hooks.json")),
+ json!({ "hooks": { "SessionStart": [{
+ "matcher": "startup|clear",
+ "hooks": [{
+ "type": "command",
+ "command": "sh \"${CLAUDE_PLUGIN_ROOT}/scripts/session-start\"",
+ "timeout": 30
+ }]
+ }]}})
);
let start = std::fs::read_to_string(plugin.join("scripts/session-start")).unwrap();
assert!(start.contains("wake-cli context"), "{start}");
+ // MCP 两家各写一份:Claude Code 的 stdio 配置没有 cwd、插件路径靠 ${CLAUDE_PLUGIN_ROOT};
+ // Codex 不展开 MCP 参数里的变量(只展开钩子命令),写相对路径 + cwd "."(插件根,Codex
+ // 自带的插件也这么写),直接放在清单里。Codex 只给 MCP 子进程几个默认环境变量(PATH、
+ // HOME 这些),启动脚本认的 WAKE_BIN_DIR 要点名放行,不然 Wake 装在别处的人钩子能用、
+ // MCP 却找不到 wake-mcp
let mcp = json(plugin.join(".mcp.json"));
let args = &mcp["mcpServers"]["wake"]["args"];
assert_eq!(args[0], "${CLAUDE_PLUGIN_ROOT}/scripts/wake");
assert_eq!(args[1], "wake-mcp");
+ let codex_market = json(repo.join(".agents/plugins/marketplace.json"));
+ let codex_entry = &codex_market["plugins"][0];
+ assert!(cli::CODEX_PLUGIN_INSTALL.ends_with(&install_id(&codex_market)));
+ assert_eq!(
+ codex_entry["source"]["path"], entry["source"],
+ "同一个插件目录"
+ );
+ let codex_manifest = json(plugin.join(".codex-plugin/plugin.json"));
+ assert_eq!(codex_manifest["name"], codex_entry["name"]);
+ // Codex 按版本缓存装好的插件,版本不变就不重装:跟 Wake 一起走,发版改 Cargo.toml 时一并改
+ assert_eq!(codex_manifest["version"], env!("CARGO_PKG_VERSION"));
+ assert_eq!(
+ codex_manifest["mcpServers"]["wake"],
+ json!({
+ "command": "sh",
+ "args": ["./scripts/wake", "wake-mcp"],
+ "cwd": ".",
+ "env_vars": ["WAKE_BIN_DIR"]
+ })
+ );
+ for field in ["logo", "composerIcon"] {
+ let asset = codex_manifest["interface"][field].as_str().unwrap();
+ assert!(plugin.join(asset).is_file(), "{field}: {asset}");
+ }
+ // 文档里的安装命令就是 Connect 页复制的那条
+ for doc in ["README.md", "docs/cli.md", "docs/mcp.md"] {
+ let text = std::fs::read_to_string(repo.join(doc)).unwrap();
+ for command in [cli::CLAUDE_PLUGIN_INSTALL, cli::CODEX_PLUGIN_INSTALL] {
+ assert!(
+ text.contains(command),
+ "{doc} 里的安装命令过时了: {command}"
+ );
+ }
+ }
+
let launcher = std::fs::read_to_string(plugin.join("scripts/wake")).unwrap();
assert!(launcher.contains("/Applications/Wake.app/Contents/MacOS"));
// tar 包装进 ~/.local/bin、deb 装进 /usr/bin
diff --git a/crates/wake/locales/zh-Hans.json b/crates/wake/locales/zh-Hans.json
index 66791be..b3b2200 100644
--- a/crates/wake/locales/zh-Hans.json
+++ b/crates/wake/locales/zh-Hans.json
@@ -493,9 +493,9 @@
"Theme": "主题",
"Its branch stays and shows the whole conversation.": "它的分支会留下,显示完整的对话。",
"Its {} branches stay and show the whole conversation.": "它的 {} 个分支会留下,显示完整的对话。",
- "Add to ~/.codex/config.toml, then approve it in /hooks": "加进 ~/.codex/config.toml,再在 Codex 的 /hooks 里批准",
"Claude Code plugin": "Claude Code 插件",
- "Codex hooks": "Codex Hooks",
"Run in a terminal to install the Wake plugin": "在终端里运行,安装 Wake 插件",
- "Copy the command that adds wake-cli to PATH": "拷贝把 wake-cli 加进 PATH 的命令"
+ "Copy the command that adds wake-cli to PATH": "拷贝把 wake-cli 加进 PATH 的命令",
+ "Codex plugin": "Codex 插件",
+ "Run in a terminal, then trust its hook in Codex's /hooks": "在终端里运行,再在 Codex 的 /hooks 里信任它的钩子"
}
diff --git a/crates/wake/src/i18n.rs b/crates/wake/src/i18n.rs
index fa03d81..e7b45fa 100644
--- a/crates/wake/src/i18n.rs
+++ b/crates/wake/src/i18n.rs
@@ -651,12 +651,11 @@ mod tests {
/// 这里直接问那个 API,改了名就在这里红,而不是变成一条静默的死译文。开场上下文的两块
/// 在 Windows 上不显示,但片段函数不分平台、语言包也不分平台,所以这里照列
fn from_wake_core(key: &str) -> bool {
- let x = std::path::Path::new("x");
- wake_core::mcp::setup_snippets(x)
+ wake_core::mcp::setup_snippets(std::path::Path::new("x"))
.into_iter()
.chain([
wake_core::cli::claude_plugin_snippet(),
- wake_core::cli::codex_hooks_snippet(x),
+ wake_core::cli::codex_plugin_snippet(),
])
.any(|s| s.hint == key || s.copy_label == key)
}
diff --git a/crates/wake/src/settings.rs b/crates/wake/src/settings.rs
index 5b89a08..3be8688 100644
--- a/crates/wake/src/settings.rs
+++ b/crates/wake/src/settings.rs
@@ -33,10 +33,10 @@ const SETTINGS_PAGE_TOP: Zpx = Zpx(38.);
/// Connect 页两条 Setup guide 的去处:MCP 面与命令行面各自的完整文档
const CONNECT_GUIDE_URL: &str = "https://github.com/iAmCorey/Wake/blob/main/docs/mcp.md";
const CONNECT_CLI_GUIDE_URL: &str = "https://github.com/iAmCorey/Wake/blob/main/docs/cli.md";
-const CONNECT_PLUGIN_GUIDE_URL: &str =
+const CONNECT_CLAUDE_PLUGIN_GUIDE_URL: &str =
"https://github.com/iAmCorey/Wake/blob/main/docs/cli.md#claude-code-plugin";
-const CONNECT_CODEX_HOOKS_GUIDE_URL: &str =
- "https://github.com/iAmCorey/Wake/blob/main/docs/cli.md#codex-hooks";
+const CONNECT_CODEX_PLUGIN_GUIDE_URL: &str =
+ "https://github.com/iAmCorey/Wake/blob/main/docs/cli.md#codex-plugin";
fn icon(path: &'static str) -> Icon {
Icon::empty().path(path)
@@ -234,10 +234,10 @@ struct ConnectInfo {
/// MCP clients 卡的三行:文案与片段来自 wake-core,与 `wake-mcp setup`
/// 同源;GUI 只展示与复制,不代写别家配置
snippets: Vec<wake_core::mcp::SetupSnippet>,
- /// Claude Code plugin 与 Codex hooks 两块各一行,与 `wake-cli setup` 同源;这个平台不给
- /// (`cli::SESSION_START_HOOKS` 为假,即 Windows)时是 None,两块都不画
+ /// Claude Code plugin 与 Codex plugin 两块各一行,与 `wake-cli setup` 同源;这个平台不给
+ /// (`cli::AGENT_PLUGINS` 为假,即 Windows)时是 None,两块都不画
claude_plugin: Option<wake_core::mcp::SetupSnippet>,
- codex_hooks: Option<wake_core::mcp::SetupSnippet>,
+ codex_plugin: Option<wake_core::mcp::SetupSnippet>,
}
impl ConnectInfo {
@@ -246,10 +246,9 @@ impl ConnectInfo {
let cli = BinaryFacts::probe("wake-cli");
Self {
snippets: wake_core::mcp::setup_snippets(std::path::Path::new(&mcp.path)),
- claude_plugin: wake_core::cli::SESSION_START_HOOKS
+ claude_plugin: wake_core::cli::AGENT_PLUGINS
.then(wake_core::cli::claude_plugin_snippet),
- codex_hooks: wake_core::cli::SESSION_START_HOOKS
- .then(|| wake_core::cli::codex_hooks_snippet(std::path::Path::new(&cli.path))),
+ codex_plugin: wake_core::cli::AGENT_PLUGINS.then(wake_core::cli::codex_plugin_snippet),
cli_path_command: wake_core::cli::path_command(std::path::Path::new(&cli.path)),
mcp,
cli,
@@ -1107,28 +1106,31 @@ impl SettingsView {
// 区块同一种写法:(标题, 文档链接, 卡),有没有链接、有没有这块都写在数据里,
// 间距一律"不是第一块就加",不靠各块自己记。链接的规则一句话:**每个面的第一个
- // 区块挂自己的文档**——Claude Code plugin、Codex hooks 各是一面,MCP 面 = MCP server
- // + MCP clients,命令行面 = Command line + Skill。两家的开场上下文放最前:插件一条
- // 命令就把 MCP 与开场上下文一起装好,是最省事的那条路。标题用各家的正名(用户
- // 2026-10-09 定:不自己起名字;Codex 那个是它官方的 hooks,不是插件);这两块
- // Windows 上没有(片段给 None)
+ // 区块挂自己的文档**——Claude Code plugin、Codex plugin 各是一面,MCP 面 = MCP server
+ // + MCP clients,命令行面 = Command line + Skill。两家的插件放最前:一条命令就把 MCP
+ // 与开场交接一起装好,是最省事的那条路。标题用各家的正名(用户 2026-10-09 定:不自己
+ // 起名字;Codex 那块原先是它官方的 hooks 配置,2026-10-10 有了真正的 Codex 插件才改名);
+ // 这两块 Windows 上没有(片段给 None)
let sections = [
(
t("Claude Code plugin"),
- Some(("connect-plugin-setup-guide", CONNECT_PLUGIN_GUIDE_URL)),
+ Some((
+ "connect-claude-plugin-setup-guide",
+ CONNECT_CLAUDE_PLUGIN_GUIDE_URL,
+ )),
info.claude_plugin
.as_ref()
- .map(|s| one_line_card(s, "connect-copy-plugin")),
+ .map(|s| one_line_card(s, "connect-copy-claude-plugin")),
),
(
- t("Codex hooks"),
+ t("Codex plugin"),
Some((
- "connect-codex-hooks-setup-guide",
- CONNECT_CODEX_HOOKS_GUIDE_URL,
+ "connect-codex-plugin-setup-guide",
+ CONNECT_CODEX_PLUGIN_GUIDE_URL,
)),
- info.codex_hooks
+ info.codex_plugin
.as_ref()
- .map(|s| one_line_card(s, "connect-copy-codex-hooks")),
+ .map(|s| one_line_card(s, "connect-copy-codex-plugin")),
),
(
t("MCP server"),
diff --git a/docs/cli.md b/docs/cli.md
index cdd9304..4f6074b 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -146,7 +146,7 @@ Wake: recent sessions in this project, across your coding agents (5 of 9 from th
Read one with the wake_get_session tool, or run `wake-cli show <key>`.
```
-It is what the [Claude Code plugin](#claude-code-plugin) and the [Codex hooks](#codex-hooks) setup run: whatever the hook
+It is what the [Claude Code plugin](#claude-code-plugin) and the [Codex plugin](#codex-plugin) run: whatever the hook
prints lands in the new session's context, where a "no sessions" reply or a list of other
projects would only be noise. A subfolder counts as its project, as with `--project
"$PWD"`. Your home folder and the filesystem root never count as the project a folder
@@ -272,7 +272,7 @@ Two things to know:
Two ways to teach it, same content. To hand every new session this project's recent
sessions before the agent even asks, see [Claude Code plugin](#claude-code-plugin) and
-[Codex hooks](#codex-hooks).
+[Codex plugin](#codex-plugin).
**A skill, once, for every project** — the repository ships one at `skills/wake/`:
@@ -301,16 +301,16 @@ It needs Wake 0.9.0 or later and covers macOS and Linux. Settings → Connect sh
command with a copy button.
```bash
-claude plugin marketplace add iAmCorey/Wake && claude plugin install wake@wake
+claude plugin marketplace add iAmCorey/Wake --sparse .claude-plugin plugins/wake && claude plugin install wake@wake
```
-Inside a session, `/plugin marketplace add iAmCorey/Wake` and then `/plugin install
-wake@wake` do the same. The plugin carries no binaries of its own: it runs the `wake-cli`
-and `wake-mcp` inside your installed Wake (set `WAKE_BIN_DIR` to their folder if Wake
-lives somewhere other than the usual place). If you added the `wake` MCP server by hand
-earlier, remove it with `claude mcp remove wake` so the tools are not listed twice.
-`claude plugin update wake@wake` updates it, or turn on auto-update for the `wake`
-marketplace in `/plugin`.
+`--sparse` checks out only the plugin's folders instead of the whole repository. Inside a
+session, `/plugin marketplace add iAmCorey/Wake` and then `/plugin install wake@wake` do the
+same. The plugin carries no binaries of its own: it runs the `wake-cli` and `wake-mcp`
+inside your installed Wake (set `WAKE_BIN_DIR` to their folder if Wake lives somewhere
+other than the usual place). If you added the `wake` MCP server by hand earlier, remove it
+with `claude mcp remove wake` so the tools are not listed twice. `claude plugin update
+wake@wake` updates it, or turn on auto-update for the `wake` marketplace in `/plugin`.
**Without the plugin**, the same hook goes in `~/.claude/settings.json` (every project) or
in a project's `.claude/settings.json`; add the MCP server as [docs/mcp.md](mcp.md#claude-code)
@@ -337,11 +337,27 @@ shows:
Use `wake-cli`'s full path if it is not on your `PATH` (see *Where it lives*).
-## Codex hooks
+## Codex plugin
-Codex gets the same start through its own [hooks](https://developers.openai.com/codex/hooks).
-Add this to `~/.codex/config.toml` — Settings → Connect shows it with your path to
-`wake-cli` filled in:
+The same plugin works in Codex, in the CLI and in the Codex app: every new session starts
+knowing where your agents left off in the project, and Codex gets Wake's MCP tools to read
+those sessions. It needs Wake 0.9.0 or later and covers macOS and Linux. Settings → Connect
+shows the command with a copy button.
+
+```bash
+codex plugin marketplace add iAmCorey/Wake --sparse .agents/plugins --sparse plugins/wake && codex plugin add wake@wake
+```
+
+Codex runs a plugin's hook only after you trust it: start Codex, open `/hooks` and trust
+Wake's session-start hook. Codex asks again whenever the hook changes. As with Claude Code,
+the plugin carries no binaries and runs the `wake-cli` and `wake-mcp` inside your installed
+Wake. If you added the `wake` MCP server to `~/.codex/config.toml` by hand earlier, remove
+that entry so the tools are not listed twice; likewise, if you pasted Wake's
+`[[hooks.SessionStart]]` block there from Wake 0.9.0's Settings → Connect, remove it, or
+every new session gets the context twice.
+
+**Without the plugin**, add the hook to `~/.codex/config.toml` yourself, approve it in
+`/hooks`, and add the MCP server as [docs/mcp.md](mcp.md#codex) shows:
```toml
[[hooks.SessionStart]]
@@ -353,24 +369,17 @@ command = "/Applications/Wake.app/Contents/MacOS/wake-cli context 2>/dev/null ||
timeout = 30
```
-Codex runs a hook you added only after you approve it: start Codex and open `/hooks`. For
-Wake's tools in Codex, add the MCP server as [docs/mcp.md](mcp.md#codex) shows. There is no
-Codex plugin: Codex runs a plugin's hooks only when the plugin was installed by hand in its
-desktop app, and a plugin's MCP server has to be a remote one, so a plugin could not do this
-from the command line. Like the Claude Code plugin, this needs Wake 0.9.0 or later and covers
-macOS and Linux.
-
For both:
-- What gets injected is titles, keys, dates and models for up to five sessions — not
- transcripts. The agent reads one with `wake_get_session` or `wake-cli show` when it needs
- the details.
+- What gets injected is up to five recent sessions, each with its agent, title, key, last
+ question and the first line of its last reply — not transcripts. The agent reads one with
+ `wake_get_session` or `wake-cli show` when it needs the details.
- `startup|clear` covers new sessions and `/clear`. A resumed or compacted session keeps
its own history, so the hook stays out of those.
- A lookup made by the hook is not the agent asking Wake, so it does not show up in
Insights under *Agents asking Wake*; the lookups the agent then makes on its own do.
-- None of this edits another tool's configuration: Claude Code installs its own plugin,
- and the hook settings are yours to paste.
+- None of this edits another tool's configuration: Claude Code and Codex install the plugin
+ themselves, and the hook settings are yours to paste.
- On Windows, use the skill and the MCP server for now.
## When
diff --git a/docs/mcp.md b/docs/mcp.md
index f9b07f6..85c30d7 100644
--- a/docs/mcp.md
+++ b/docs/mcp.md
@@ -23,9 +23,14 @@ claude mcp add --scope user wake -- "/Applications/Wake.app/Contents/MacOS/wake-
```
Or install the Wake plugin instead, which adds this server and starts every new session
-knowing where your agents left off in the project — `claude plugin marketplace add iAmCorey/Wake && claude plugin
-install wake@wake` (see [Claude Code plugin](cli.md#claude-code-plugin)). Use one or the other, not
-both, or the tools are listed twice.
+knowing where your agents left off in the project (see
+[Claude Code plugin](cli.md#claude-code-plugin)):
+
+```bash
+claude plugin marketplace add iAmCorey/Wake --sparse .claude-plugin plugins/wake && claude plugin install wake@wake
+```
+
+Use one or the other, not both, or the tools are listed twice.
### Codex
@@ -36,6 +41,15 @@ Add to `~/.codex/config.toml`:
command = "/Applications/Wake.app/Contents/MacOS/wake-mcp"
```
+Or install the Wake plugin instead, which adds this server and starts every new session
+knowing where your agents left off in the project (see [Codex plugin](cli.md#codex-plugin)):
+
+```bash
+codex plugin marketplace add iAmCorey/Wake --sparse .agents/plugins --sparse plugins/wake && codex plugin add wake@wake
+```
+
+Use one or the other, not both, or the tools are listed twice.
+
### Cursor
Merge into `~/.cursor/mcp.json`:
@@ -93,8 +107,8 @@ wake_list_sessions with the current directory, then wake_get_session for the rel
Claude Code and Codex can also be told where your agents left off in the project when a
session starts — each recent session with its last question and reply — through a hook
that runs `wake-cli context`; see
-[Claude Code plugin](cli.md#claude-code-plugin) and [Codex hooks](cli.md#codex-hooks) in the
-command-line guide. The Claude Code plugin brings this MCP server along.
+[Claude Code plugin](cli.md#claude-code-plugin) and [Codex plugin](cli.md#codex-plugin) in the
+command-line guide. Both plugins bring this MCP server along.
### A worked example
diff --git a/plugins/wake/.codex-plugin/plugin.json b/plugins/wake/.codex-plugin/plugin.json
new file mode 100644
index 0000000..15256f1
--- /dev/null
+++ b/plugins/wake/.codex-plugin/plugin.json
@@ -0,0 +1,51 @@
+{
+ "name": "wake",
+ "version": "0.9.0",
+ "description": "Every new session starts knowing where your coding agents left off in this project, and Wake's MCP tools let Codex search and read any earlier session from any agent. Read-only; needs the Wake app.",
+ "author": {
+ "name": "Corey Chiu",
+ "url": "https://github.com/iAmCorey"
+ },
+ "homepage": "https://github.com/iAmCorey/Wake",
+ "repository": "https://github.com/iAmCorey/Wake",
+ "license": "MIT",
+ "keywords": [
+ "sessions",
+ "history",
+ "memory",
+ "context",
+ "mcp"
+ ],
+ "mcpServers": {
+ "wake": {
+ "command": "sh",
+ "args": [
+ "./scripts/wake",
+ "wake-mcp"
+ ],
+ "cwd": ".",
+ "env_vars": [
+ "WAKE_BIN_DIR"
+ ]
+ }
+ },
+ "interface": {
+ "displayName": "Wake",
+ "shortDescription": "Pick up where your other coding agents left off",
+ "longDescription": "Wake indexes every coding-agent session on this machine — Claude Code, Codex, Cursor and the rest. With this plugin, each new Codex session starts with where your agents left off in the project, each recent session with its last question and reply, and Codex can search and read any earlier session through Wake's read-only MCP tools. Needs the Wake app.",
+ "developerName": "Corey Chiu",
+ "category": "Developer Tools",
+ "capabilities": [
+ "Read"
+ ],
+ "websiteURL": "https://github.com/iAmCorey/Wake",
+ "defaultPrompt": [
+ "What was I working on in this project?",
+ "Did we discuss this error in an earlier session?",
+ "Continue where Claude Code left off"
+ ],
+ "brandColor": "#1F3C63",
+ "composerIcon": "./assets/logo.png",
+ "logo": "./assets/logo.png"
+ }
+}
diff --git a/plugins/wake/assets/logo.png b/plugins/wake/assets/logo.png
new file mode 100644
index 0000000..9efb503
Binary files /dev/null and b/plugins/wake/assets/logo.png differ
diff --git a/plugins/wake/scripts/session-start b/plugins/wake/scripts/session-start
index 3345c3f..f76af87 100755
--- a/plugins/wake/scripts/session-start
+++ b/plugins/wake/scripts/session-start
@@ -1,8 +1,9 @@
#!/bin/sh
-# SessionStart hook: prints where your agents left off in this project, which Claude Code
-# adds to the new session's context. `wake-cli context` prints nothing when the project has no recent
-# sessions. When Wake is not installed or has no index yet, this stays quiet too — a hook
-# should never get in the way of starting a session.
+# SessionStart hook (Claude Code and Codex): prints where your agents left off in this
+# project, which the agent adds to the new session's context. `wake-cli context` prints
+# nothing when the project has no recent sessions. When Wake is not installed or has no
+# index yet, this stays quiet too — a hook should never get in the way of starting a
+# session.
cd "${CLAUDE_PROJECT_DIR:-.}" 2>/dev/null || exit 0
sh "$(dirname "$0")/wake" wake-cli context 2>/dev/null
exit 0