← Back to Skills Marketplace
1939869736luosi

Codex Sessions Manager

by Rose · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
35
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install codex-sessions-manager
Description
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...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install codex-sessions-manager
  3. After installation, invoke the skill by name or use /codex-sessions-manager
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug codex-sessions-manager
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 35 downloads so far.

How do I install Codex Sessions Manager?

Run "/install codex-sessions-manager" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Codex Sessions Manager free?

Yes, Codex Sessions Manager is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Codex Sessions Manager support?

Codex Sessions Manager is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Codex Sessions Manager?

It is built and maintained by Rose (@1939869736luosi); the current version is v1.0.0.

💬 Comments