Skip to content
Back to skills

Ce Session Inventory

ASecurity

Discover session files for a repo across Claude Code, Codex, and Cursor, and extract session metadata (timestamps, branch, cwd, size, platform). Invoked by session-research agents — not intended for direct user queries.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 25, 2026
ai-agentspythonbashgit

Works with

  • claude code
  • cursor
  • cli

Security analysis

A100/100

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

Scanned September 25, 2026

npx -y skills add Najeebullah3124/awesome-claude-universe --skill ce-session-inventory --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ce Session Inventory?

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

Security grade badge for Ce Session Inventory
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/najeebullah3124-ce-session-inventory/badge)](https://www.skillsdirectory.com/skills/najeebullah3124-ce-session-inventory)

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: ce-session-inventory
description: "Discover session files for a repo across Claude Code, Codex, and Cursor, and extract session metadata (timestamps, branch, cwd, size, platform). Invoked by session-research agents — not intended for direct user queries."
user-invocable: false
context: fork
---

# Session inventory

Agent-facing primitive. Discover session files and emit session metadata as JSONL across Claude Code, Codex, and Cursor.

This skill exists so that agents researching session history do not need to know the layout of session stores on disk or the JSONL shapes of each platform. The scripts under `scripts/` own that knowledge.

## Arguments

Space-separated positional args:

1. `<repo>` — repo folder name (e.g., `my-project`). Used for directory matching in Claude Code and Cursor, and as the CWD filter for Codex sessions.
2. `<days>` — scan window in days (e.g., `7`). Session files older than this are skipped.
3. `<platform>` *(optional)* — one of `claude`, `codex`, `cursor`. Omit to search all three.

## Execution

Run the discovery-plus-metadata pipeline from the skill's own `scripts/` directory:

```bash
bash scripts/discover-sessions.sh <repo> <days> [--platform <platform>] \
  | tr '\n' '\0' \
  | xargs -0 python3 scripts/extract-metadata.py --cwd-filter <repo>
```

Return the raw stdout verbatim — one JSON object per session, then a final `_meta` line. Callers parse the JSONL directly, so do not paraphrase, reformat, or summarize.

If discovery finds no files, the pipeline still emits a clean `_meta` line (`files_processed: 0`). Return that as-is.

## Output format

Each session line is a JSON object. Common fields across platforms:

- `platform` — `claude`, `codex`, or `cursor`
- `file` — absolute path to the session JSONL
- `size` — file size in bytes
- `ts` — session start timestamp (ISO 8601)
- `session` — session identifier

Platform-specific fields:

- Claude Code adds `branch` (git branch) and `last_ts` (last message timestamp).
- Codex adds `cwd` (working directory), `source`, `cli_version`, `model`, `last_ts`.
- Cursor has no in-file timestamps or metadata — `ts` is derived from file mtime and `session` from the containing directory name.

The final `_meta` line has `files_processed`, `parse_errors`, and optionally `filtered_by_cwd` (count of Codex sessions dropped by the CWD filter).

## Error handling

If the discovery script errors (e.g., unreadable home directory, permission failure), let the error surface to the caller. Do not substitute git log, file listings, or other sources — this skill's contract is session metadata, nothing else.

If `_meta` reports `parse_errors > 0`, return the JSONL as-is. The caller decides how to handle partial data.

Files in this skill

  • SKILL.md2.7 KB
  • scripts/discover-sessions.sh2.4 KB
  • scripts/extract-metadata.py6.3 KB

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.

Comments

Loading comments…