← 返回 Skills 市场
1939869736luosi

Codex Sessions Manager

作者 Rose · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
35
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (SKILL.md)

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_sessions
  • get_session
  • export_session_backup
  • preview_delete_sessions
  • delete_sessions (requires confirm=true to execute; without it, returns a preview)
  • cleanup_session_indexes
  • cleanup_stale_indexes
  • verify_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 delete as destructive. Always preview first unless the user has already explicitly confirmed deletion.
  • delete without --yes is the preferred safe preview path in CLI mode.
  • cleanup-index only removes JSONL traces; it does not delete raw files or SQLite rows.
  • cleanup-stale only 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
安全使用建议
Before installing, confirm you trust the repository and its npm dependencies. When using the skill, remember that Codex session history may contain sensitive prompts, code, or secrets. Preview deletions, check session IDs carefully, and export backups before permanently removing sessions.
功能分析
Type: OpenClaw Skill Name: codex-sessions-manager Version: 1.0.0 The codex-sessions-manager skill bundle is a legitimate toolkit for managing local Codex conversation history stored in ~/.codex. It provides a CLI and an MCP server (src/mcp/server.ts) to list, export, and delete session data across files and SQLite databases. While the skill has destructive capabilities, the implementation in src/core/delete.ts and src/core/sqlite.ts includes safety mechanisms such as mandatory confirmation flags and deletion previews, and the AI instructions in SKILL.md explicitly reinforce these safety rules. No evidence of data exfiltration, malicious prompt injection, or unauthorized remote access was found.
能力评估
Purpose & Capability
The stated purpose and implementation are coherent: it lists, shows, exports, verifies, cleans, and deletes local Codex sessions under ~/.codex. Those capabilities inherently access private conversation history and can remove local records.
Instruction Scope
The instructions scope use to Codex session management and explicitly warn that delete is destructive, prefer preview mode, and require confirmation for actual deletion.
Install Mechanism
Although registry install metadata says there is no install spec, SKILL.md instructs users to build and optionally globally install a Node CLI from the repository. This is purpose-aligned but should be reviewed before running.
Credentials
The default target is ~/.codex and the code checks for a sessions/ directory, which is proportionate to the purpose. Users should still be aware that --root and export --output can point to user-selected paths.
Persistence & Privilege
No artifact-backed evidence shows credential use, background persistence, privilege escalation, or autonomous activity beyond user-invoked CLI/MCP tools. Global CLI installation is optional and disclosed.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install codex-sessions-manager
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /codex-sessions-manager 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
codex-sessions-manager v1.0.0 - Initial release of the codex-sessions-manager skill. - Supports listing, inspecting, exporting, verifying, cleaning up, and deleting local Codex sessions in ~/.codex. - Provides both MCP API and CLI execution paths, with safety and confirmation steps for destructive actions. - Includes clear guidance for when and how to use the skill and fallback strategies if global install is unavailable. - Outlines response formatting and best practices for session management tasks.
元数据
Slug codex-sessions-manager
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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。

💬 留言讨论