/install codex-sessions-manager
Codex Sessions Manager
Overview
This skill manages local Codex sessions through the codex-sessions toolkit.
Use it when the user wants to work with local Codex conversation history instead of the current live chat thread.
Prerequisites
This skill requires the CLI to be built from this repository.
Why: The skill file (SKILL.md) is read by the AI agent. When the AI executes CLI commands from this file, it runs them in the current working directory — not the skill directory. So relative paths like dist/cli/index.js won't work unless the CLI is globally available.
Option 1 — Global install (recommended):
cd /path/to/where/you/cloned/codex-sessions-manager
npm install
npm run build
npm install -g . # makes `codex-sessions` available everywhere
Then use codex-sessions instead of node dist/cli/index.js in commands below.
Option 2 — Keep local, use full path:
cd /path/to/where/you/cloned/codex-sessions-manager
npm install
npm run build
Then replace node dist/cli/index.js below with the full path, e.g.:
node /home/you/codex-sessions-manager/dist/cli/index.js
When To Use
Use this skill for requests like:
- "列出我最近的 Codex 对话"
- "看一下这条 session 的详情"
- "导出这个会话"
- "删除这几个会话"
- "先预览删除会影响什么"
- "清理失效索引"
- "验证这条会话还有没有残留"
Do not use this skill for:
- generic ChatGPT history questions
- Claude Code session management
- editing the current conversation
Execution Order
1. Prefer MCP first
If the codex-sessions MCP server is available in the current Codex session, use these tools:
list_sessionsget_sessionexport_session_backuppreview_delete_sessionsdelete_sessions(requiresconfirm=trueto execute; without it, returns a preview)cleanup_session_indexescleanup_stale_indexesverify_sessions
2. Fall back to CLI when MCP is unavailable
If you installed globally (npm install -g .), use codex-sessions:
codex-sessions list --root ~/.codex --limit 20
codex-sessions show \x3Csession-id> --root ~/.codex
codex-sessions export \x3Csession-id> --root ~/.codex --output ./backup.json
codex-sessions delete \x3Csession-id...> --root ~/.codex
codex-sessions delete \x3Csession-id...> --root ~/.codex --yes
codex-sessions cleanup-index \x3Csession-id...> --root ~/.codex
codex-sessions cleanup-stale --root ~/.codex
codex-sessions verify \x3Csession-id...> --root ~/.codex
If you didn't install globally, replace codex-sessions with the full path to dist/cli/index.js.
Safety Rules
- Treat
deleteas destructive. Always preview first unless the user has already explicitly confirmed deletion. deletewithout--yesis the preferred safe preview path in CLI mode.cleanup-indexonly removes JSONL traces; it does not delete raw files or SQLite rows.cleanup-staleonly removes stale index records.- When the user asks to delete sessions, echo back the session IDs you are about to delete before executing if there is any ambiguity.
Response Style
- For list requests: show session ID, updated time, size, and a readable title.
- For show requests: summarize the session and include the key metadata.
- For delete requests: explain whether this is preview-only or actual deletion.
- For verify requests: report whether files, JSONL rows, and SQLite rows still remain.
Quick Examples
List recent archived sessions
Use MCP list_sessions with status=archived and limit=5.
CLI fallback:
node dist/cli/index.js list --root ~/.codex --status archived --limit 5
Preview deleting a session
Use MCP preview_delete_sessions.
CLI fallback:
node dist/cli/index.js delete 019d5240 --root ~/.codex
Actually delete confirmed sessions
Use MCP delete_sessions only after clear user confirmation, and pass confirm=true.
CLI fallback:
node dist/cli/index.js delete 019d5240 019d3de0 --root ~/.codex --yes
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install codex-sessions-manager - 安装完成后,直接呼叫该 Skill 的名称或使用
/codex-sessions-manager触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Codex Sessions Manager 是什么?
Use this skill when the user wants to inspect, search, export, verify, clean up, or delete local Codex sessions stored in ~/.codex. Trigger for requests abou... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 35 次。
如何安装 Codex Sessions Manager?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install codex-sessions-manager」即可一键安装,无需额外配置。
Codex Sessions Manager 是免费的吗?
是的,Codex Sessions Manager 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Codex Sessions Manager 支持哪些平台?
Codex Sessions Manager 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Codex Sessions Manager?
由 Rose(@1939869736luosi)开发并维护,当前版本 v1.0.0。