Skip to content
Back to skills

Examples

ASecurity

Use this skill when the user wants to inspect, search, export, verify,

  • 13 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 19, 2026
ai-agentsbashgit

Works with

  • cli
  • mcp

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned October 19, 2026

npx -y skills add 1939869736luosi/codex-sessions-manager --skill examples --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Examples?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Examples
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/1939869736luosi-examples/badge)](https://www.skillsdirectory.com/skills/1939869736luosi-examples)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: codex-sessions-manager
description: Use this skill when the user wants to inspect, search, export, verify,
  clean up, delete, restore, or purge local Codex sessions stored under ~/.codex.
metadata:
  source: https://github.com/1939869736luosi/codex-sessions-manager
---

# Codex Sessions Manager

## Overview

CLI-first local Codex session audit and cleanup tool. Inspect what remains under `~/.codex`, audit leftovers after the official UI delete/archive flow, clean hidden local residues by exact session ID, and verify the local surfaces this release understands.

This is not a UI product, TUI, detail page, incremental scanner, or automatic cleanup service.

## Setup

```bash
npm install -g codex-sessions-manager
codex-sessions --version
```

The default Codex root is `~/.codex`. Use `--root <path>` for a different root.

## When To Use

- List/filter/search sessions (by project, time, status, source)
- Show session detail or timeline
- Inspect session family (parent/child/subagent/side/fork)
- Audit what remains locally after official UI delete
- Scan root for likely residue candidates
- Preview batch delete scope without executing
- Build explicit-ID delete plans
- Export session backup
- Delete sessions (permanent or recoverable trash)
- Restore or purge trash entries
- Verify post-delete cleanliness
- Clean stale JSONL indexes

## CLI Quick Reference

```bash
codex-sessions doctor [--json] [--details]
codex-sessions list [--limit N] [--project TEXT] [--status S] [--source-kind K]
codex-sessions sources [--json]
codex-sessions projects
codex-sessions show <id>
codex-sessions events <exact-id> [--output FILE]
codex-sessions family <id> [--children|--parents|--subagents|--impact|--full]
codex-sessions audit <id> [--json]
codex-sessions audit-root [--limit 50] [--status S...] [--source S...]
codex-sessions preview-root [--limit 50] [--status S...] [--source S...]
codex-sessions monthly-review [--limit 50] [--status S...] [--source S...] [--details]
codex-sessions export <id> [--output ./backup.json]
codex-sessions plan-delete <id...> [--include-children] [--include-family] [--json]
codex-sessions plan-delete --source-kind K --limit N [--json]
codex-sessions preview-plan <file> [--json]
codex-sessions delete <id...> [--trash] [--yes]
codex-sessions trash-list
codex-sessions restore <id> --yes
codex-sessions purge <id> --yes
codex-sessions cleanup-index <id...> [--yes]
codex-sessions cleanup-stale [--yes]
codex-sessions verify <id...>
```

## Safety Rules

- All destructive commands require `--yes` (CLI) or `confirm=true` (MCP); without it you get preview only.
- Always run a separate preview before any destructive action, then require explicit user confirmation.
- `preview`, `plan-delete`, `family`, `impact`, `audit-root`, `preview-root`, `monthly-review` are read-only. They are never deletion authorization.
- Permanent delete removes only exact thread-linked logs. Trash retains them; restore leaves them unchanged; final purge removes them unless that ID is live again. Memory is always retained.
- Delete never recursively adds parent, child, or family sessions. List every intended ID explicitly.
- P11 exact-key global-state refs are removable only through explicit-ID confirmed delete.
- Unknown global-state refs are warnings only; do not delete them automatically.
- Rollback is best-effort, not crash-safe transaction.

## MCP (Optional, Advanced)

```bash
codex-sessions-mcp                       # default: read-only profile (17 tools)
codex-sessions-mcp --profile admin       # all 23 tools including destructive ops
```

Invalid `--profile` values exit with code 1. Default is read-only for safety.

## Detailed References

For full CLI/MCP parameter reference, safety model, and advanced rules:

- [Detailed tool reference](../skills/codex-sessions-manager/docs/SKILL_DETAIL.md)
- [Safety guide](../skills/codex-sessions-manager/docs/SAFETY.md)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.