From spec-first
Discovers session files for a repo across Claude Code and Codex, extracts metadata as JSONL (timestamps, branch, cwd, size, platform). For session-research agents.
npx claudepluginhub sunrain520/spec-firstThis skill uses the workspace's default tool permissions.
Agent-facing primitive. Discover session files and emit session metadata as JSONL across Claude Code and Codex.
Searches prior Claude-Code/Codex-CLI sessions for code patterns, decisions, or work via aichat CLI, jq parsing, and session file reads (max 3). For non-subagent CLI agents.
Analyzes Claude Code session history JSONL files to extract insights, summaries, and patterns from conversations. Processes current project or all sessions with bash, jq, and subagents.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Share bugs, ideas, or general feedback.
Agent-facing primitive. Discover session files and emit session metadata as JSONL across Claude Code and Codex.
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.
Space-separated positional args:
<repo> — repo folder name (e.g., my-project). Used for directory matching in Claude Code and as the CWD filter for Codex sessions.<days> — scan window in days (e.g., 7). Session files older than this are skipped.<platform> (optional) — one of claude, codex. Omit to search both supported platforms.--keyword K1[,K2,...] (optional) — filter to sessions whose user/assistant text matches at least one comma-separated keyword, using case-insensitive substring matching. Each emitted session line gains match_count and keyword_matches fields, and the _meta line gains files_matched. Use this instead of ad hoc per-file grep when ranking many sessions by topical relevance.Run the discovery-plus-metadata pipeline from the skill's own scripts/ directory:
bash scripts/discover-sessions.sh <repo> <days> [--platform <platform>] \
| tr '\n' '\0' \
| xargs -0 python3 scripts/extract-metadata.py --cwd-filter <repo>
To filter by keyword, append --keyword K1[,K2,...] to the extract-metadata.py invocation. Keyword scanning reads the full user/assistant text after cheap metadata and CWD filters pass, so it costs more than a metadata-only run. Use it for topical ranking, not as the default inventory path.
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.
Each session line is a JSON object. Common fields across platforms:
platform — claude or codexfile — absolute path to the session JSONLsize — file size in bytests — session start timestamp (ISO 8601)session — session identifierPlatform-specific fields:
branch (git branch) and last_ts (last message timestamp).cwd (working directory), source, cli_version, model, last_ts.
The final _meta line has files_processed, parse_errors, and optionally filtered_by_cwd (count of Codex sessions dropped by the CWD filter) and files_matched (count of sessions retained by the keyword filter, present only when --keyword was set).When --keyword is set, each session line additionally carries:
match_count — total occurrences across all keywords.keyword_matches — per-keyword counts, e.g. {"middleware": 4, "auth": 12}.Sessions with match_count: 0 are excluded from output.
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.